aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2013-07-20 21:47:52 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2013-07-20 21:47:52 +0200
commitc05633946e50238eb79d0b372ee3d9bcac4d5568 (patch)
treeb753bd1a57cb5985bcb6cd5d3361aa5d0d5fb7d8 /src/server/scripts
parent0597db950c9e516f05879a4e36caa1f871157bef (diff)
Core/Spells: Update/Convert mage "Permafrost" for 4.3.4
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp83
1 files changed, 64 insertions, 19 deletions
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();