mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 12:12:34 -04:00
Core/Scripts: Added ExecuteEvent BossAI hook designed to contain event code which would otherwise be in while (uint32 eventId = events.ExecuteEvent()) switch blocks. This allows to define a base class sharing spells with other scripts
This commit is contained in:
@@ -624,6 +624,22 @@ void BossAI::SummonedCreatureDespawn(Creature* summon)
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void BossAI::UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
ExecuteEvent(eventId);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
// SD2 grid searchers.
|
||||
Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive /*= true*/)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user