mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 19:35:42 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user