diff --git a/zone/bot.cpp b/zone/bot.cpp index ecd1dd84e..f07c5bf8f 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9708,6 +9708,7 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck } //LogBotSpellChecksDetail("{} says, 'Doing CanCastSpellType checks of {} on {}.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); if (!CanCastSpellType(spell_type, spell_id, tar)) { + LogBotSpellChecksDetail("{} says, 'Cancelling cast of {} on {} due to CanCastSpellType.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); return false; } @@ -11994,7 +11995,7 @@ bool Bot::HasRequiredLoSForPositioning(Mob* tar) { bool Bot::HasValidAETarget(Bot* caster, uint16 spell_id, uint16 spell_type, Mob* tar) { int spell_range = caster->GetActSpellRange(spell_id, spells[spell_id].range); - int spell_ae_range = caster->GetActSpellRange(spell_id, spells[spell_id].aoe_range); + int spell_ae_range = caster->GetAOERange(spell_id); int target_count = 0; for (auto& close_mob : caster->m_close_mobs) { @@ -12005,6 +12006,18 @@ bool Bot::HasValidAETarget(Bot* caster, uint16 spell_id, uint16 spell_type, Mob* } switch (spell_type) { + case BotSpellTypes::AELull: + if (m->GetSpecialAbility(SpecialAbility::PacifyImmunity)) { + continue; + } + + break; + case BotSpellTypes::AEMez: + if (m->GetSpecialAbility(SpecialAbility::MesmerizeImmunity)) { + continue; + } + + break; case BotSpellTypes::AEDispel: if (m->GetSpecialAbility(SpecialAbility::DispellImmunity)) { continue; @@ -13134,11 +13147,9 @@ bool Bot::IsImmuneToBotSpell(uint16 spell_id, Mob* caster) { ( IsEffectInSpell(spell_id, SE_Root) || IsEffectInSpell(spell_id, SE_MovementSpeed) - ) - ) { - if (GetSpecialAbility(SpecialAbility::SnareImmunity)) { - return true; - } + ) + ) { + return true; } if (IsLifetapSpell(spell_id)) { diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 56841172e..5508b1d37 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -1068,10 +1068,8 @@ std::vector Bot::GetPrioritizedBotSpellsBySpellType(Bot* cas if ( caster->IsCommandedSpell() || !AE || - ( - BotSpellTypeRequiresAEChecks(spell_type) && - caster->HasValidAETarget(caster, bot_spell_list[i].spellid, spell_type, tar) - ) + !BotSpellTypeRequiresAEChecks(spell_type) || + caster->HasValidAETarget(caster, bot_spell_list[i].spellid, spell_type, tar) ) { BotSpell_wPriority bot_spell; bot_spell.SpellId = bot_spell_list[i].spellid; @@ -1433,7 +1431,8 @@ Mob* Bot::GetFirstIncomingMobToMez(Bot* caster, int16 spell_id, uint16 spell_typ Mob* result = nullptr; if (caster && caster->GetOwner()) { - int spell_range = (!AE ? caster->GetActSpellRange(spell_id, spells[spell_id].range) : caster->GetActSpellRange(spell_id, spells[spell_id].aoe_range)); + int spell_range = caster->GetActSpellRange(spell_id, spells[spell_id].range); + int spell_ae_range = caster->GetAOERange(spell_id); int buff_count = 0; NPC* npc = nullptr; @@ -1464,7 +1463,7 @@ Mob* Bot::GetFirstIncomingMobToMez(Bot* caster, int16 spell_id, uint16 spell_typ } if (IsPBAESpell(spell_id)) { - if (spell_range < Distance(caster->GetPosition(), m->GetPosition())) { + if (spell_ae_range < Distance(caster->GetPosition(), m->GetPosition())) { continue; } } @@ -2732,7 +2731,11 @@ bool Bot::IsValidSpellRange(uint16 spell_id, Mob* tar) { float range = spells[spell_id].range + GetRangeDistTargetSizeMod(tar); - if (IsAnyAESpell(spell_id)) { + if ( + spells[spell_id].target_type != ST_AETargetHateList && + !IsTargetableAESpell(spell_id) && + IsAnyAESpell(spell_id) + ) { range = GetAOERange(spell_id); }