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

View File

@@ -115,7 +115,7 @@ public:
me->GetMotionMaster()->MoveIdle();
me->CastSpell(me, SPELL_TELEPORT, false);
events.CancelEvent(EVENT_SPELL_CORRUPT_SOUL);
events.DelayEvents(6000);
events.DelayEvents(6s);
events.RescheduleEvent(EVENT_SPELL_FEAR, 8s, 14s);
}
}

View File

@@ -225,14 +225,14 @@ public:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true))
me->CastSpell(target, SPELL_WELL_OF_SOULS, false);
events.Repeat(25s, 30s);
events.DelayEventsToMax(4000, 0);
events.DelayEventsToMax(4s, 0);
break;
case EVENT_SPELL_UNLEASHED_SOULS:
me->CastSpell(me, SPELL_UNLEASHED_SOULS, false);
Talk(SAY_FACE_UNLEASH_SOUL);
Talk(EMOTE_UNLEASH_SOUL);
events.Repeat(30s, 40s);
events.DelayEventsToMax(5000, 0);
events.DelayEventsToMax(5s, 0);
me->setAttackTimer(BASE_ATTACK, 5500);
break;
case EVENT_SPELL_WAILING_SOULS:
@@ -241,7 +241,7 @@ public:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
me->CastCustomSpell(SPELL_WAILING_SOULS_TARGETING, SPELLVALUE_MAX_TARGETS, 1, target, false);
events.Repeat(80s);
events.DelayEventsToMax(20000, 0);
events.DelayEventsToMax(20s, 0);
break;
}

View File

@@ -131,7 +131,7 @@ public:
Talk(SAY_DEFILING_HORROR);
me->CastSpell((Unit*)nullptr, SPELL_DEFILING_HORROR, false);
me->SetControlled(true, UNIT_STATE_ROOT);
events.DelayEventsToMax(5000, 0);
events.DelayEventsToMax(5s, 0);
events.ScheduleEvent(EVENT_UNROOT, 4s);
events.ScheduleEvent(EVENT_DEFILING_HORROR, 20s);
break;

View File

@@ -658,7 +658,7 @@ public:
pLichKing->SendMovementFlagUpdate();
pLichKing->CastSpell(pLichKing, SPELL_FROSTMOURNE_EQUIP, false);
pInstance->HandleGameObject(pInstance->GetGuidData(GO_FROSTMOURNE), false);
events.ScheduleEvent(EVENT_INTRO_LK_4_3, 1750);
events.ScheduleEvent(EVENT_INTRO_LK_4_3, 1750ms);
}
events.ScheduleEvent(EVENT_INTRO_LK_5, 6s);
break;
@@ -1732,7 +1732,7 @@ public:
{
++reqKillCount;
if (events.GetNextEventTime(EVENT_DECREASE_REQ_COUNT_BY_100))
if (events.HasTimeUntilEvent(EVENT_DECREASE_REQ_COUNT_BY_100))
events.RescheduleEvent(EVENT_DECREASE_REQ_COUNT_BY_100, 10s);
summons.Summon(s);
s->SetHomePosition(PathWaypoints[WP_STOP[currentWall + 1]]);

View File

@@ -112,7 +112,7 @@ public:
Talk(SAY_AGGRO);
DoZoneInCombat();
events.RescheduleEvent(EVENT_SPELL_THROW_SARONITE, 5000ms, 7500ms);
events.RescheduleEvent(EVENT_SPELL_THROW_SARONITE, 5s, 7500ms);
if (pInstance)
pInstance->SetData(DATA_GARFROST, IN_PROGRESS);
@@ -178,7 +178,7 @@ public:
}
if (spell->Id == uint32(SPELL_FORGE_BLADE))
{
events.RescheduleEvent(EVENT_SPELL_CHILLING_WAVE, 10000);
events.RescheduleEvent(EVENT_SPELL_CHILLING_WAVE, 10s);
SetEquipmentSlots(false, EQUIP_ID_SWORD);
me->SetReactState(REACT_AGGRESSIVE);
me->SetControlled(false, UNIT_STATE_ROOT);

View File

@@ -298,7 +298,7 @@ public:
if (a == 1)
{
me->setActive(true);
events.RescheduleEvent(20, 0);
events.RescheduleEvent(20, 0ms);
}
}
@@ -404,7 +404,7 @@ public:
case 8:
Talk(SAY_OUTRO_KRICK_4);
events.RescheduleEvent(9, 1500);
events.RescheduleEvent(9, 1500ms);
break;
case 9:
if (pInstance)
@@ -430,7 +430,7 @@ public:
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_TYRANNUS_EVENT_GUID)))
c->AI()->Talk(SAY_TYRANNUS_KRICK_2);
events.RescheduleEvent(11, 9000);
events.RescheduleEvent(11, 9s);
break;
case 11:
if (pInstance)

View File

@@ -161,7 +161,7 @@ public:
events.RescheduleEvent(EVENT_SPELL_UNHOLY_POWER, 1s);
break;
}
events.RepeatEvent(3000);
events.Repeat(3s);
break;
case EVENT_SPELL_UNHOLY_POWER:
Talk(SAY_DARK_MIGHT);

View File

@@ -1082,7 +1082,7 @@ public:
s->AddThreat(c, 0.0f);
}
}
events.RescheduleEvent(10, 3000);
events.RescheduleEvent(10, 3s);
break;
}