fix(scripts/Ulduar): Two fixes to Algalon encounter (#4852)

This commit is contained in:
UltraNix
2021-03-17 15:08:25 +01:00
committed by GitHub
parent 252f56c097
commit 0d19ac4312
2 changed files with 29 additions and 2 deletions

View File

@@ -347,6 +347,11 @@ public:
me->SetInCombatWithZone();
return;
}
else if (events.GetPhaseMask() & PHASE_NORMAL)
{
DoAction(ACTION_ASCEND);
return;
}
ScriptedAI::EnterEvadeMode();
}
@@ -596,9 +601,20 @@ public:
}
}
bool IsInRoom()
{
if (me->GetExactDist2d(&me->GetHomePosition()) > 45.f || me->GetPositionZ() < 410.f)
{
DoAction(ACTION_ASCEND);
return false;
}
return true;
}
void UpdateAI(uint32 diff) override
{
if ((!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && !UpdateVictim()) /*ZOMG!|| !CheckInRoom()*/)
if (!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && (!UpdateVictim() || !IsInRoom()))
return;
events.Update(diff);
@@ -1026,6 +1042,17 @@ public:
_summonTimer = urand(22000, 24000);
}
void JustSummoned(Creature* summon) override
{
if (TempSummon* summ = me->ToTempSummon())
{
if (Creature* algalon = ObjectAccessor::GetCreature(*me, summ->GetSummonerGUID()))
{
algalon->AI()->JustSummoned(summon);
}
}
}
void UpdateAI(uint32 diff) override
{
_summonTimer += diff;