Skip to content

Commit

Permalink
fix(Scripts/TheEye): Fix Alar not using abilities if no target is in … (
Browse files Browse the repository at this point in the history
azerothcore#18678)

fix(Scripts/TheEye): Fix Alar not using abilities if no target is in range
  • Loading branch information
Nyeriah authored Apr 6, 2024
1 parent 3a93ae1 commit 8ef8dda
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,6 @@ struct boss_alar : public BossAI
});
}

void JustReachedHome() override
{
BossAI::JustReachedHome();
if (me->IsEngaged())
{
ConstructWaypointsAndMove();
}
}

void Reset() override
{
BossAI::Reset();
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8ef8dda

Please sign in to comment.