mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
fix(scripts/Ulduar): Two fixes to Algalon encounter (#4852)
This commit is contained in:
@@ -473,7 +473,7 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura
|
||||
std::vector<Player*> tList;
|
||||
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
{
|
||||
if (me->GetDistance(itr->GetSource()) > maxdist || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
|
||||
if (!me->IsWithinDistInMap(itr->GetSource(), maxdist) || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
|
||||
continue;
|
||||
if (excludeAura && itr->GetSource()->HasAura(excludeAura))
|
||||
continue;
|
||||
|
||||
@@ -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