diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 9eafa136e..c8ff8cf9a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -473,7 +473,7 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura std::vector 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; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 6a0992894..797913d46 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -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;