diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-06-18 20:19:30 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-06-18 20:19:30 +0200 |
commit | 99c256600a293d9e69b6f66cd8668ff686d38f5c (patch) | |
tree | 6f9737fd39c13d813a9f8caf91b098ef9f6025d4 | |
parent | 3367dd5be93b8e63dce41fe6e303aa8ec41a43db (diff) |
Core/Spells: Fix mage talent "Nether Vortex"
thx to @Souler for base script
-rw-r--r-- | sql/updates/world/2013_06_18_00_world_spell_script_names_434.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 47 |
2 files changed, 51 insertions, 0 deletions
diff --git a/sql/updates/world/2013_06_18_00_world_spell_script_names_434.sql b/sql/updates/world/2013_06_18_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..7bb30c6b4b7 --- /dev/null +++ b/sql/updates/world/2013_06_18_00_world_spell_script_names_434.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (86181,86209); +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(86181, 'spell_mage_nether_vortex'), +(86209, 'spell_mage_nether_vortex'); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 5f3d17b0056..caa40235ca7 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -38,6 +38,7 @@ enum MageSpells SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, SPELL_MAGE_IGNITE = 12654, SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE = 29077, + SPELL_MAGE_SLOW = 31589, SPELL_MAGE_SQUIRREL_FORM = 32813, SPELL_MAGE_GIRAFFE_FORM = 32816, SPELL_MAGE_SERPENT_FORM = 32817, @@ -794,6 +795,51 @@ class spell_mage_master_of_elements : public SpellScriptLoader } }; +// 86181 - Nether Vortex +class spell_mage_nether_vortex : public SpellScriptLoader +{ + public: + spell_mage_nether_vortex() : SpellScriptLoader("spell_mage_nether_vortex") { } + + class spell_mage_nether_vortex_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_nether_vortex_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_SLOW)) + return false; + return true; + } + + bool DoCheck(ProcEventInfo& eventInfo) + { + if (Aura* aura = eventInfo.GetProcTarget()->GetAura(SPELL_MAGE_SLOW)) + if (aura->GetCasterGUID() != GetTarget()->GetGUID()) + return false; + + return true; + } + + void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_MAGE_SLOW, true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_mage_nether_vortex_AuraScript::DoCheck); + OnEffectProc += AuraEffectProcFn(spell_mage_nether_vortex_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_nether_vortex_AuraScript(); + } +}; + enum SilvermoonPolymorph { NPC_AUROSALIA = 18744 @@ -1157,6 +1203,7 @@ void AddSC_mage_spell_scripts() new spell_mage_mage_ward(); new spell_mage_mana_shield(); new spell_mage_master_of_elements(); + new spell_mage_nether_vortex(); new spell_mage_polymorph_cast_visual(); new spell_mage_replenish_mana(); new spell_mage_ring_of_frost(); |