fix(Core/Magtheridon): Fix Manticron Cube mechanic (#16745)

This commit is contained in:
Angelo Venturini
2023-07-12 14:17:34 -03:00
committed by GitHub
parent 9b5933ac5f
commit a8964a6ed1
@@ -18,6 +18,7 @@
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "SpellInfo.h" #include "SpellInfo.h"
#include "TaskScheduler.h"
#include "magtheridons_lair.h" #include "magtheridons_lair.h"
enum Yells enum Yells
@@ -93,6 +94,7 @@ struct boss_magtheridon : public BossAI
BossAI::Reset(); BossAI::Reset();
_currentPhase = 0; _currentPhase = 0;
_recentlySpoken = false; _recentlySpoken = false;
_interruptScheduler.CancelAll();
scheduler.Schedule(90s, [this](TaskContext context) scheduler.Schedule(90s, [this](TaskContext context)
{ {
Talk(SAY_TAUNT); Talk(SAY_TAUNT);
@@ -186,7 +188,7 @@ struct boss_magtheridon : public BossAI
{ {
DoCastSelf(SPELL_BLAST_NOVA); DoCastSelf(SPELL_BLAST_NOVA);
scheduler.Schedule(50ms, GROUP_INTERRUPT_CHECK, [this](TaskContext context) _interruptScheduler.Schedule(50ms, GROUP_INTERRUPT_CHECK, [this](TaskContext context)
{ {
if (me->GetAuraCount(SPELL_SHADOW_GRASP_VISUAL) == 5) if (me->GetAuraCount(SPELL_SHADOW_GRASP_VISUAL) == 5)
{ {
@@ -197,7 +199,7 @@ struct boss_magtheridon : public BossAI
context.Repeat(50ms); context.Repeat(50ms);
}).Schedule(12s, GROUP_INTERRUPT_CHECK, [this](TaskContext /*context*/) }).Schedule(12s, GROUP_INTERRUPT_CHECK, [this](TaskContext /*context*/)
{ {
scheduler.CancelGroup(GROUP_INTERRUPT_CHECK); _interruptScheduler.CancelGroup(GROUP_INTERRUPT_CHECK);
}); });
}); });
context.Repeat(53s, 56s); context.Repeat(53s, 56s);
@@ -214,6 +216,7 @@ struct boss_magtheridon : public BossAI
return; return;
scheduler.Update(diff); scheduler.Update(diff);
_interruptScheduler.Update(diff);
if (_currentPhase != 1) if (_currentPhase != 1)
{ {
@@ -224,6 +227,7 @@ struct boss_magtheridon : public BossAI
private: private:
bool _recentlySpoken; bool _recentlySpoken;
uint8 _currentPhase; uint8 _currentPhase;
TaskScheduler _interruptScheduler;
}; };
class spell_magtheridon_blaze : public SpellScript class spell_magtheridon_blaze : public SpellScript