refactor(Core/EventMap): Refactor EventMap and related scripts (#23121)

Co-authored-by: Kelno <3866946+kelno@users.noreply.github.com>
Co-authored-by: Peter Keresztes Schmidt <carbenium@outlook.com>
This commit is contained in:
天鹭
2025-10-13 09:19:24 +08:00
committed by GitHub
parent 8e1426c06a
commit 9c49349e1e
168 changed files with 1468 additions and 1593 deletions
@@ -135,14 +135,14 @@ public:
if (_slaughterProgress == 2)
{
for (uint32 i = 0; i < 33; ++i)
events.ScheduleEvent(EVENT_SPAWN_MINDLESS, 5000 + i * 210);
events.ScheduleEvent(EVENT_SPAWN_MINDLESS, Milliseconds(5000 + i * 210));
if (Creature* baron = instance->GetCreature(_baronRivendareGUID))
if (GameObject* gate = baron->FindNearestGameObject(GO_SLAUGHTER_GATE_SIDE, 200.0f))
gate->SetGoState(GO_STATE_ACTIVE);
}
if (_slaughterProgress == 3)
{
events.ScheduleEvent(EVENT_SPAWN_BLACK_GUARD, 20000);
events.ScheduleEvent(EVENT_SPAWN_BLACK_GUARD, 20s);
}
if (_slaughterProgress == 4)
{
@@ -296,7 +296,7 @@ public:
_baronRunProgress = DATA_BARON_RUN_GATE;
_baronRunTime = 45;
DoCastSpellOnPlayers(SPELL_BARON_ULTIMATUM);
events.ScheduleEvent(EVENT_BARON_TIME, 60000);
events.ScheduleEvent(EVENT_BARON_TIME, 60s);
if (Creature* baron = instance->GetCreature(_baronRivendareGUID))
baron->AI()->Talk(SAY_BARON_INIT_YELL);
@@ -379,12 +379,12 @@ public:
data >> _barthilasrunProgress;
if (_baronRunTime)
{
events.ScheduleEvent(EVENT_BARON_TIME, 60000);
events.ScheduleEvent(EVENT_BARON_TIME, 60s);
}
if (_slaughterProgress > 0 && _slaughterProgress < 4)
{
events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 5000);
events.ScheduleEvent(EVENT_FORCE_SLAUGHTER_EVENT, 5s);
}
}
@@ -455,20 +455,20 @@ public:
if (i == 0)
{
// set timer to reset the trap
events.ScheduleEvent(EVENT_GATE1_TRAP, 30 * MINUTE * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_GATE1_TRAP, 1800s);
// set timer to reopen gates
events.ScheduleEvent(EVENT_GATE1_DELAY, 20 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_GATE1_DELAY, 20s);
// set timer to spawn the plagued critters
events.ScheduleEvent(EVENT_GATE1_CRITTER_DELAY, 2 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_GATE1_CRITTER_DELAY, 2s);
}
else if (i == 1)
{
// set timer to reset the trap
events.ScheduleEvent(EVENT_GATE2_TRAP, 30 * MINUTE * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_GATE2_TRAP, 1800s);
// set timer to reopen gates
events.ScheduleEvent(EVENT_GATE2_DELAY, 20 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_GATE2_DELAY, 20s);
// set timer to spawn the plagued critters
events.ScheduleEvent(EVENT_GATE2_CRITTER_DELAY, 2 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_GATE2_CRITTER_DELAY, 2s);
}
}
}