fix(Scripts/ZulAman): Dont cast Gust of Wind if about to start Electr… (#20717)

This commit is contained in:
Andrew
2024-11-24 12:24:45 -03:00
committed by GitHub
parent c1c9443dd1
commit 72b5e26c91
@@ -52,7 +52,8 @@ enum Says
enum Misc enum Misc
{ {
ACTION_STORM_EXPIRE = 1 ACTION_STORM_EXPIRE = 1,
GROUP_ELECTRICAL_STORM = 1
}; };
constexpr auto NPC_SOARING_EAGLE = 24858; constexpr auto NPC_SOARING_EAGLE = 24858;
@@ -91,6 +92,7 @@ struct boss_akilzon : public BossAI
}, 10s, 18s); }, 10s, 18s);
ScheduleTimedEvent(20s, 30s, [&] { ScheduleTimedEvent(20s, 30s, [&] {
if (scheduler.GetNextGroupOcurrence(GROUP_ELECTRICAL_STORM) > 5s)
DoCastRandomTarget(SPELL_GUST_OF_WIND, 1); DoCastRandomTarget(SPELL_GUST_OF_WIND, 1);
}, 20s, 30s); }, 20s, 30s);
@@ -98,7 +100,8 @@ struct boss_akilzon : public BossAI
DoCastVictim(SPELL_CALL_LIGHTNING); DoCastVictim(SPELL_CALL_LIGHTNING);
}, 12s, 17s); }, 12s, 17s);
ScheduleTimedEvent(1min, [&] { scheduler.Schedule(1min, GROUP_ELECTRICAL_STORM, [this](TaskContext context)
{
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50, true); Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50, true);
if (!target) if (!target)
{ {
@@ -123,7 +126,9 @@ struct boss_akilzon : public BossAI
_isRaining = true; _isRaining = true;
} }
}, Seconds(urand(47, 52))); }, Seconds(urand(47, 52)));
}, 1min);
context.Repeat();
});
ScheduleTimedEvent(47s, 52s, [&] { ScheduleTimedEvent(47s, 52s, [&] {
if (!_isRaining) if (!_isRaining)