diff --git a/sql/updates/world/custom/custom_2019_05_10_01_world.sql b/sql/updates/world/custom/custom_2019_05_10_01_world.sql new file mode 100644 index 0000000000..540c8919d9 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_05_10_01_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc` WHERE `SpellId`= -86181; +INSERT INTO `spell_proc` (`SpellId`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Chance`, `Cooldown`) VALUES +(-86181, 3, 0x20000000, 0, 0, 0, 1, 2, 0, 0, 0, 0); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 93a4e41c44..7837632b18 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -1043,54 +1043,36 @@ class spell_mage_master_of_elements : public SpellScriptLoader } }; -// 86181 - Nether Vortex -class spell_mage_nether_vortex : public SpellScriptLoader +// -86181 - Nether Vortex +class spell_mage_nether_vortex : public AuraScript { - public: - spell_mage_nether_vortex() : SpellScriptLoader("spell_mage_nether_vortex") { } + PrepareAuraScript(spell_mage_nether_vortex); - class spell_mage_nether_vortex_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mage_nether_vortex_AuraScript); + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGE_SLOW }); + } - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo( - { - SPELL_MAGE_SLOW, - SPELL_MAGE_ARCANE_BLAST - }); - } + bool DoCheck(ProcEventInfo& eventInfo) + { + if (Aura* aura = eventInfo.GetProcTarget()->GetAura(SPELL_MAGE_SLOW)) + if (aura->GetCasterGUID() != GetTarget()->GetGUID()) + return false; - bool DoCheck(ProcEventInfo& eventInfo) - { - if (eventInfo.GetProcSpell()->GetSpellInfo()->Id != SPELL_MAGE_ARCANE_BLAST) - return false; + return true; + } - if (Aura* aura = eventInfo.GetProcTarget()->GetAura(SPELL_MAGE_SLOW)) - if (aura->GetCasterGUID() != GetTarget()->GetGUID()) - return false; + void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_MAGE_SLOW, true, nullptr, aurEff); + } - return true; - } - - void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_MAGE_SLOW, true, nullptr, aurEff); - } - - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_mage_nether_vortex_AuraScript::DoCheck); - OnEffectProc += AuraEffectProcFn(spell_mage_nether_vortex_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_mage_nether_vortex_AuraScript(); - } + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_mage_nether_vortex::DoCheck); + OnEffectProc += AuraEffectProcFn(spell_mage_nether_vortex::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } }; // -11175 - Permafrost @@ -2176,7 +2158,7 @@ void AddSC_mage_spell_scripts() new spell_mage_mana_shield(); new spell_mage_master_of_elements(); RegisterSpellAndAuraScriptPair(spell_mage_mirror_image, spell_mage_mirror_image_AurasScript); - new spell_mage_nether_vortex(); + RegisterAuraScript(spell_mage_nether_vortex); RegisterAuraScript(spell_mage_offensive_state_dnd); new spell_mage_permafrost(); new spell_mage_polymorph();