diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 21594b2566e2ad..198abc87921403 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -102,15 +102,6 @@ struct boss_alar : public BossAI }); } - void JustReachedHome() override - { - BossAI::JustReachedHome(); - if (me->IsEngaged()) - { - ConstructWaypointsAndMove(); - } - } - void Reset() override { BossAI::Reset(); @@ -129,6 +120,15 @@ struct boss_alar : public BossAI ConstructWaypointsAndMove(); } + void JustReachedHome() override + { + BossAI::JustReachedHome(); + if (me->IsEngaged()) + { + ConstructWaypointsAndMove(); + } + } + void JustEngagedWith(Unit* who) override { BossAI::JustEngagedWith(who); @@ -158,6 +158,29 @@ struct boss_alar : public BossAI ScheduleMainSpellAttack(0s); } + bool CanAIAttack(Unit const* victim) const override + { + if (me->isMoving()) + return true; + + return me->IsWithinMeleeRange(victim); + } + + void EnterEvadeMode(EvadeReason why) override + { + if (why == EVADE_REASON_BOUNDARY) + { + BossAI::EnterEvadeMode(why); + } + else + { + if (me->GetThreatMgr().GetThreatList().empty()) + { + BossAI::EnterEvadeMode(why); + } + } + } + void JustDied(Unit* killer) override { BossAI::JustDied(killer);