From 15f645d751cf952285788a8857ae9074cc9be51e Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Sun, 19 Nov 2023 13:44:02 +0200 Subject: [PATCH] fix(Scripts/ManaTombs): Pandemonius should aggro the enitre room (#17764) * fix(Scripts/ManaTombs): Pandemonius should aggro the enitre room * how does this work * . --- .../Auchindoun/ManaTombs/boss_pandemonius.cpp | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index 256662e70..0bb09ab1e 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -39,6 +39,17 @@ enum Groups GROUP_VOID_BLAST = 1 }; +enum RoomAdds +{ + NPC_SCAVENGER = 18309, + NPC_CRYPT_RAIDER = 18311, + NPC_SORCERER = 18313, +}; + +float const ROOM_PULL_RANGE = 70.0f; +float const ROOM_ENTERANCE = -50.0f; +float const ROOM_EXIT = -145.0f; + constexpr uint8 MAX_VOID_BLAST = 5; struct boss_pandemonius : public BossAI @@ -68,18 +79,22 @@ struct boss_pandemonius : public BossAI context.Repeat(); }) .Schedule(8s, 23s, [this](TaskContext context) + { + if (!(context.GetRepeatCounter() % (MAX_VOID_BLAST + 1))) { - if (!(context.GetRepeatCounter() % (MAX_VOID_BLAST + 1))) - { - context.Repeat(15s, 25s); - } - else - { - DoCastRandomTarget(SPELL_VOID_BLAST); - context.Repeat(500ms); - context.DelayGroup(GROUP_VOID_BLAST, 500ms); - } - }); + context.Repeat(15s, 25s); + } + else + { + DoCastRandomTarget(SPELL_VOID_BLAST); + context.Repeat(500ms); + context.DelayGroup(GROUP_VOID_BLAST, 500ms); + } + }) + .Schedule(0s, [this](TaskContext) + { + PullRoom(); + }); BossAI::JustEngagedWith(who); } @@ -95,6 +110,22 @@ struct boss_pandemonius : public BossAI Talk(SAY_DEATH); BossAI::JustDied(killer); } + + void PullRoom() + { + std::list creatureList; + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCAVENGER, ROOM_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, me, NPC_CRYPT_RAIDER, ROOM_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SORCERER, ROOM_PULL_RANGE); + for (Creature* creature : creatureList) + { + if (creature && (creature->GetPositionY() < ROOM_ENTERANCE && creature->GetPositionY() > ROOM_EXIT)) + { + creature->SetInCombatWithZone(); + } + } + creatureList.clear(); + } }; void AddSC_boss_pandemonius()