[Bot] Update Bot Logic to ignore ST_TargetsTarget when buffing (#2584)

* [Bot] Update Bot Logic to ignore ST_TargetsTarget when buffing

* Fix Not Operator

* Update botspellsai.cpp

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
Aeadoin 2022-11-27 14:39:34 -05:00 committed by GitHub
parent fb4d4e1382
commit f6c5560e9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -371,13 +371,22 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
continue; continue;
} }
// Validate target // Validate target
// TODO: Add ST_TargetsTarget support for Buffing.
if (!((spells[selectedBotSpell.SpellId].target_type == ST_Target || spells[selectedBotSpell.SpellId].target_type == ST_Pet || tar == this || if (
spells[selectedBotSpell.SpellId].target_type == ST_Group || spells[selectedBotSpell.SpellId].target_type == ST_GroupTeleport || !(
(botClass == BARD && spells[selectedBotSpell.SpellId].target_type == ST_AEBard)) (
&& !tar->IsImmuneToSpell(selectedBotSpell.SpellId, this) spells[selectedBotSpell.SpellId].target_type == ST_Target ||
&& (tar->CanBuffStack(selectedBotSpell.SpellId, botLevel, true) >= 0))) { spells[selectedBotSpell.SpellId].target_type == ST_Pet ||
continue; (tar == this && spells[selectedBotSpell.SpellId].target_type != ST_TargetsTarget) ||
spells[selectedBotSpell.SpellId].target_type == ST_Group ||
spells[selectedBotSpell.SpellId].target_type == ST_GroupTeleport ||
(botClass == BARD && spells[selectedBotSpell.SpellId].target_type == ST_AEBard)
) &&
!tar->IsImmuneToSpell(selectedBotSpell.SpellId, this) &&
tar->CanBuffStack(selectedBotSpell.SpellId, botLevel, true) >= 0
)
) {
continue;
} }
// Put the zone levitate and movement check here since bots are able to bypass the client casting check // Put the zone levitate and movement check here since bots are able to bypass the client casting check