mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/AI): Move TaskScheduler to BossAI class (#14757)
This commit is contained in:
@@ -561,6 +561,7 @@ void BossAI::_Reset()
|
||||
|
||||
me->ResetLootMode();
|
||||
events.Reset();
|
||||
scheduler.CancelAll();
|
||||
summons.DespawnAll();
|
||||
if (instance)
|
||||
instance->SetBossState(_bossId, NOT_STARTED);
|
||||
@@ -569,6 +570,7 @@ void BossAI::_Reset()
|
||||
void BossAI::_JustDied()
|
||||
{
|
||||
events.Reset();
|
||||
scheduler.CancelAll();
|
||||
summons.DespawnAll();
|
||||
if (instance)
|
||||
{
|
||||
@@ -581,6 +583,7 @@ void BossAI::_EnterCombat()
|
||||
{
|
||||
me->setActive(true);
|
||||
DoZoneInCombat();
|
||||
ScheduleTasks();
|
||||
if (instance)
|
||||
{
|
||||
// bosses do not respawn, check only on enter combat
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "EventMap.h"
|
||||
#include "TaskScheduler.h"
|
||||
|
||||
#define CAST_AI(a, b) (dynamic_cast<a*>(b))
|
||||
|
||||
@@ -449,6 +450,8 @@ public:
|
||||
// is supposed to run more than once
|
||||
virtual void ExecuteEvent(uint32 /*eventId*/) { }
|
||||
|
||||
virtual void ScheduleTasks() { }
|
||||
|
||||
void Reset() override { _Reset(); }
|
||||
void EnterCombat(Unit* /*who*/) override { _EnterCombat(); }
|
||||
void JustDied(Unit* /*killer*/) override { _JustDied(); }
|
||||
@@ -464,6 +467,7 @@ protected:
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
TaskScheduler scheduler;
|
||||
|
||||
private:
|
||||
uint32 const _bossId;
|
||||
|
||||
Reference in New Issue
Block a user