diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index d21c9935da3878..0625cd3bd63015 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -909,40 +909,32 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader { PrepareAuraScript(spell_sindragosa_unchained_magic_AuraScript); - std::map _lastMSTimeForSpell; - bool Validate(SpellInfo const* /*spellInfo*/) override { - _lastMSTimeForSpell.clear(); return true; } - bool CheckProc(ProcEventInfo& eventInfo) + bool AfterCheckProc(ProcEventInfo& /*eventInfo*/, bool isTriggeredAtSpellProcEvent) { - SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); - if (!spellInfo) + if (!isTriggeredAtSpellProcEvent) + { return false; - + } uint32 currMSTime = GameTime::GetGameTimeMS().count(); - std::map::iterator itr = _lastMSTimeForSpell.find(spellInfo->Id); - if (itr != _lastMSTimeForSpell.end()) + if (_lastMSTime && getMSTimeDiff(_lastMSTime, currMSTime) < 600) { - uint32 lastMSTime = itr->second; - itr->second = currMSTime; - if (getMSTimeDiff(lastMSTime, currMSTime) < 600) - return false; - - return true; + return false; } - - _lastMSTimeForSpell[spellInfo->Id] = currMSTime; + _lastMSTime = currMSTime; return true; } void Register() override { - DoCheckProc += AuraCheckProcFn(spell_sindragosa_unchained_magic_AuraScript::CheckProc); + DoAfterCheckProc += AuraAfterCheckProcFn(spell_sindragosa_unchained_magic_AuraScript::AfterCheckProc); } + private: + uint32 _lastMSTime; }; AuraScript* GetAuraScript() const override