mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
fix(Scripts/Karazhan): allow Moroes and adds to reset when an add is pulled out of the room (#17072)
* initial * doforallsummons * error fix
This commit is contained in:
@@ -209,10 +209,36 @@ struct boss_moroes : public BossAI
|
||||
return Acore::Containers::SelectRandomContainerElement(guestList);
|
||||
}
|
||||
|
||||
bool CheckGuestsInRoom()
|
||||
{
|
||||
bool guestsInRoom = true;
|
||||
summons.DoForAllSummons([&guestsInRoom](WorldObject* summon)
|
||||
{
|
||||
if ((summon->ToCreature()->GetPositionX()) < -11028.f || (summon->ToCreature()->GetPositionY()) < -1955.f) //boundaries of the two doors
|
||||
{
|
||||
guestsInRoom = false;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
return guestsInRoom;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
|
||||
if (!CheckGuestsInRoom())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
summons.DoForAllSummons([](WorldObject* summon)
|
||||
{
|
||||
summon->ToCreature()->AI()->EnterEvadeMode();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user