From c05633946e50238eb79d0b372ee3d9bcac4d5568 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 20 Jul 2013 21:47:52 +0200 Subject: Core/Spells: Update/Convert mage "Permafrost" for 4.3.4 --- src/server/scripts/Spells/spell_mage.cpp | 83 ++++++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 19 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index ec1e5861599..8adac7be0e2 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -44,6 +44,7 @@ enum MageSpells SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, SPELL_MAGE_IGNITE = 12654, SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE = 29077, + SPELL_MAGE_PERMAFROST = 91394, SPELL_MAGE_SLOW = 31589, SPELL_MAGE_SQUIRREL_FORM = 32813, SPELL_MAGE_GIRAFFE_FORM = 32816, @@ -697,31 +698,31 @@ class spell_mage_glyph_of_ice_block : public SpellScriptLoader // 56374 - Glyph of Icy Veins class spell_mage_glyph_of_icy_veins : public SpellScriptLoader { -public: - spell_mage_glyph_of_icy_veins() : SpellScriptLoader("spell_mage_glyph_of_icy_veins") { } - - class spell_mage_glyph_of_icy_veins_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mage_glyph_of_icy_veins_AuraScript); + public: + spell_mage_glyph_of_icy_veins() : SpellScriptLoader("spell_mage_glyph_of_icy_veins") { } - void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + class spell_mage_glyph_of_icy_veins_AuraScript : public AuraScript { - PreventDefaultAction(); + PrepareAuraScript(spell_mage_glyph_of_icy_veins_AuraScript); - GetTarget()->RemoveAurasByType(SPELL_AURA_HASTE_SPELLS, 0, 0, true, false); - GetTarget()->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); - } + void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); - void Register() OVERRIDE + GetTarget()->RemoveAurasByType(SPELL_AURA_HASTE_SPELLS, 0, 0, true, false); + GetTarget()->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_icy_veins_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE { - OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_icy_veins_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + return new spell_mage_glyph_of_icy_veins_AuraScript(); } - }; - - AuraScript* GetAuraScript() const OVERRIDE - { - return new spell_mage_glyph_of_icy_veins_AuraScript(); - } }; // 56375 - Glyph of Polymorph @@ -1045,6 +1046,49 @@ class spell_mage_nether_vortex : public SpellScriptLoader } }; +// -11175 - Permafrost +class spell_mage_permafrost : public SpellScriptLoader +{ + public: + spell_mage_permafrost() : SpellScriptLoader("spell_mage_permafrost") { } + + class spell_mage_permafrost_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_permafrost_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_PERMAFROST)) + return false; + return true; + } + + bool DoCheck(ProcEventInfo& eventInfo) + { + return GetTarget()->GetGuardianPet() && eventInfo.GetDamageInfo()->GetDamage(); + } + + void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 heal = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount())); + GetTarget()->CastCustomSpell(SPELL_MAGE_PERMAFROST, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + DoCheckProc += AuraCheckProcFn(spell_mage_permafrost_AuraScript::DoCheck); + OnEffectProc += AuraEffectProcFn(spell_mage_permafrost_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_mage_permafrost_AuraScript(); + } +}; + enum SilvermoonPolymorph { NPC_AUROSALIA = 18744 @@ -1414,6 +1458,7 @@ void AddSC_mage_spell_scripts() new spell_mage_mana_shield(); new spell_mage_master_of_elements(); new spell_mage_nether_vortex(); + new spell_mage_permafrost(); new spell_mage_polymorph_cast_visual(); new spell_mage_replenish_mana(); new spell_mage_ring_of_frost(); -- cgit v1.2.3