mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 20:37:45 +00:00
feat(Core/Instance): Add TaskScheduler to the InstanceScript class (#17284)
feat(Core/Instance): Add TaskScheduler to the instancescript class
This commit is contained in:
@@ -154,8 +154,8 @@ public:
|
||||
switch (type)
|
||||
{
|
||||
case DATA_RAJAXX_WAVE_ENGAGED:
|
||||
_scheduler.CancelGroup(GROUP_RAJAXX_WAVE_TIMER);
|
||||
_scheduler.Schedule(2min, [this](TaskContext context)
|
||||
scheduler.CancelGroup(GROUP_RAJAXX_WAVE_TIMER);
|
||||
scheduler.Schedule(2min, [this](TaskContext context)
|
||||
{
|
||||
CallNextRajaxxLeader();
|
||||
context.SetGroup(GROUP_RAJAXX_WAVE_TIMER);
|
||||
@@ -195,8 +195,8 @@ public:
|
||||
case NPC_YEGGETH:
|
||||
case NPC_PAKKON:
|
||||
case NPC_ZERRAN:
|
||||
_scheduler.CancelAll();
|
||||
_scheduler.Schedule(1s, [this, formation](TaskContext /*context*/)
|
||||
scheduler.CancelAll();
|
||||
scheduler.Schedule(1s, [this, formation](TaskContext /*context*/)
|
||||
{
|
||||
if (!formation->IsAnyMemberAlive())
|
||||
{
|
||||
@@ -212,11 +212,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void Update(uint32 diff) override
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
void SetGuidData(uint32 type, ObjectGuid data) override
|
||||
{
|
||||
if (type == DATA_PARALYZED)
|
||||
@@ -285,7 +280,7 @@ public:
|
||||
void ResetRajaxxWaves()
|
||||
{
|
||||
_rajaxWaveCounter = 0;
|
||||
_scheduler.CancelAll();
|
||||
scheduler.CancelAll();
|
||||
for (auto const& data : RajaxxWavesData)
|
||||
{
|
||||
if (Creature* creature = GetCreature(data.at(0)))
|
||||
@@ -308,7 +303,6 @@ public:
|
||||
ObjectGuid _andorovGUID;
|
||||
uint32 _rajaxWaveCounter;
|
||||
uint8 _buruPhase;
|
||||
TaskScheduler _scheduler;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -210,15 +210,9 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void Update(uint32 diff) override
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
}
|
||||
|
||||
private:
|
||||
GuidVector CThunGraspGUIDs;
|
||||
uint32 BugTrioDeathCount;
|
||||
TaskScheduler scheduler;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user