From 72b5e26c91242232f75f6d9128de0985da4b284e Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 24 Nov 2024 12:24:45 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/ZulAman):=20Dont=20cast=20Gust=20of?= =?UTF-8?q?=20Wind=20if=20about=20to=20start=20Electr=E2=80=A6=20(#20717)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 57e3d8635..bab5e2602 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -52,7 +52,8 @@ enum Says enum Misc { - ACTION_STORM_EXPIRE = 1 + ACTION_STORM_EXPIRE = 1, + GROUP_ELECTRICAL_STORM = 1 }; constexpr auto NPC_SOARING_EAGLE = 24858; @@ -91,14 +92,16 @@ struct boss_akilzon : public BossAI }, 10s, 18s); ScheduleTimedEvent(20s, 30s, [&] { - DoCastRandomTarget(SPELL_GUST_OF_WIND, 1); + if (scheduler.GetNextGroupOcurrence(GROUP_ELECTRICAL_STORM) > 5s) + DoCastRandomTarget(SPELL_GUST_OF_WIND, 1); }, 20s, 30s); ScheduleTimedEvent(10s, 20s, [&] { DoCastVictim(SPELL_CALL_LIGHTNING); }, 12s, 17s); - ScheduleTimedEvent(1min, [&] { + scheduler.Schedule(1min, GROUP_ELECTRICAL_STORM, [this](TaskContext context) + { Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50, true); if (!target) { @@ -123,7 +126,9 @@ struct boss_akilzon : public BossAI _isRaining = true; } }, Seconds(urand(47, 52))); - }, 1min); + + context.Repeat(); + }); ScheduleTimedEvent(47s, 52s, [&] { if (!_isRaining)