fix(Core/Creature): Prevent combat movement disabled creatures from r… (#18428)

* fix(Core/Creature): Prevent combat movement disabled creatures from repositioning if target moves within model boundary

* fixbuild

* Apply suggestions from code review
This commit is contained in:
Andrew
2024-02-27 10:11:39 -03:00
committed by GitHub
parent b2e2cbfc13
commit 6df652a8dd
32 changed files with 71 additions and 74 deletions
@@ -45,7 +45,7 @@ struct boss_quartermaster_zigris : public BossAI
void Reset() override
{
_Reset();
SetCombatMovement(false);
me->SetCombatMovement(false);
_hasDrunkPotion = false;
}
@@ -120,11 +120,11 @@ struct boss_quartermaster_zigris : public BossAI
{
DoCastVictim(SPELL_SHOOT);
me->GetMotionMaster()->Clear();
SetCombatMovement(false);
me->SetCombatMovement(false);
}
else if (!me->IsWithinLOSInMap(me->GetVictim()))
{
SetCombatMovement(true);
me->SetCombatMovement(true);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveChase(me->GetVictim());
}
@@ -359,7 +359,7 @@ public:
Talk(SAY_GAMESBEGIN_2);
DoCast(me, SPELL_NEFARIANS_BARRIER);
SetCombatMovement(false);
me->SetCombatMovement(false);
me->SetImmuneToPC(false);
AttackStart(SelectTarget(SelectTargetMethod::Random, 0, 200.f, true));
events.ScheduleEvent(EVENT_SHADOWBLINK, 500ms);