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:
Shauren committed 2011-05-25 18:50:44 +02:00
1 parent 5f5af1e95d
commit c8f71c00a1
2 files changed
+24 -2

No files matched your search

@@ -266,7 +266,13 @@ class BossAI : public ScriptedAI
void JustSummoned(Creature* summon);
void SummonedCreatureDespawn(Creature* summon);
void UpdateAI(uint32 const diff) = 0;
virtual void UpdateAI(uint32 const diff);
// Hook used to execute events scheduled into EventMap without the need
// to override UpdateAI
// note: You must re-schedule the event within this method if the event
// is supposed to run more than once
virtual void ExecuteEvent(uint32 const eventId) { }
void Reset() { _Reset(); }
void EnterCombat(Unit* /*who*/) { _EnterCombat(); }
@@ -296,7 +302,7 @@ class BossAI : public ScriptedAI
private:
BossBoundaryMap const* const _boundary;
const uint32 _bossId;
uint32 const _bossId;
};
// SD2 grid searchers.