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

@@ -80,7 +80,7 @@ void CombatAI::JustEngagedWith(Unit* who)
if (AISpellInfo[*i].condition == AICOND_AGGRO)
me->CastSpell(who, *i, false);
else if (AISpellInfo[*i].condition == AICOND_COMBAT)
events.ScheduleEvent(*i, AISpellInfo[*i].cooldown + rand() % AISpellInfo[*i].cooldown);
events.ScheduleEvent(*i, Milliseconds(AISpellInfo[*i].cooldown + rand() % AISpellInfo[*i].cooldown));
}
}
@@ -97,7 +97,7 @@ void CombatAI::UpdateAI(uint32 diff)
if (uint32 spellId = events.ExecuteEvent())
{
DoCast(spellId);
events.ScheduleEvent(spellId, AISpellInfo[spellId].cooldown + rand() % AISpellInfo[spellId].cooldown);
events.ScheduleEvent(spellId, Milliseconds(AISpellInfo[spellId].cooldown + rand() % AISpellInfo[spellId].cooldown));
}
else
DoMeleeAttackIfReady();
@@ -143,7 +143,7 @@ void CasterAI::JustEngagedWith(Unit* who)
DoCast(spells[spell]);
cooldown += me->GetCurrentSpellCastTime(*itr);
}
events.ScheduleEvent(*itr, cooldown);
events.ScheduleEvent(*itr, Milliseconds(cooldown));
}
}
}
@@ -168,7 +168,7 @@ void CasterAI::UpdateAI(uint32 diff)
{
DoCast(spellId);
uint32 casttime = me->GetCurrentSpellCastTime(spellId);
events.ScheduleEvent(spellId, (casttime ? casttime : 500) + GetAISpellInfo(spellId)->realCooldown);
events.ScheduleEvent(spellId, Milliseconds((casttime ? casttime : 500) + GetAISpellInfo(spellId)->realCooldown));
}
}