mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 13:35:08 +00:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user