mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
feat(Core/Scripting): Implement ScheduleEnrageTimer() helper (#21597)
This commit is contained in:
@@ -633,6 +633,7 @@ void BossAI::_Reset()
|
||||
me->ResetLootMode();
|
||||
events.Reset();
|
||||
scheduler.CancelAll();
|
||||
me->m_Events.KillAllEvents(false);
|
||||
summons.DespawnAll();
|
||||
ClearUniqueTimedEventsDone();
|
||||
_healthCheckEvents.clear();
|
||||
@@ -787,6 +788,20 @@ void BossAI::ScheduleHealthCheckEvent(std::initializer_list<uint8> healthPct, st
|
||||
_nextHealthCheck = _healthCheckEvents.front();
|
||||
}
|
||||
|
||||
void BossAI::ScheduleEnrageTimer(uint32 spellId, Milliseconds timer, uint8 textId /*= 0*/)
|
||||
{
|
||||
me->m_Events.AddEventAtOffset([this, spellId, textId]
|
||||
{
|
||||
if (!me->IsAlive())
|
||||
return;
|
||||
|
||||
if (textId)
|
||||
Talk(textId);
|
||||
|
||||
DoCastSelf(spellId, true);
|
||||
}, timer);
|
||||
}
|
||||
|
||||
// WorldBossAI - for non-instanced bosses
|
||||
|
||||
WorldBossAI::WorldBossAI(Creature* creature) :
|
||||
|
||||
Reference in New Issue
Block a user