fix(Scripts/TheEye): Fix Alar not using abilities if no target is in … (#18678)

fix(Scripts/TheEye): Fix Alar not using abilities if no target is in range
This commit is contained in:
Andrew 2024-04-06 14:14:55 -03:00 committed by GitHub
parent 3a93ae1af1
commit 8ef8ddad24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);