razuvious strategy

This commit is contained in:
Yunfan Li
2023-07-18 21:00:49 +08:00
parent 67a23fae3f
commit 9c1bb63d10
21 changed files with 326 additions and 265 deletions

View File

@@ -248,9 +248,9 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
// check activity
AllowActivity();
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) {
return;
}
// if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) {
// return;
// }
Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL);
if (currentSpell && currentSpell->getState() == SPELL_STATE_CASTING && currentSpell->GetCastTime())
{
@@ -2007,6 +2007,12 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell,
return false;
}
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL) != nullptr) {
LOG_DEBUG("playerbot", "CanCastSpell() target name: {}, spellid: {}, bot name: {}, failed because has current channeled spell",
target->GetName(), spellid, bot->GetName());
return false;
}
if (bot->HasSpellCooldown(spellid)) {
if (!sPlayerbotAIConfig->logInGroupOnly || bot->GetGroup()) {
LOG_DEBUG("playerbots", "Can cast spell failed. Spell not has cooldown. - target name: {}, spellid: {}, bot name: {}",