mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
fix(scripts/Ulduar): Two fixes to Algalon encounter (#4852)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user