Core/Spells: Update/Convert mage "Permafrost" for 4.3.4

This commit is contained in:
Vincent-Michael
2013-07-20 21:47:52 +02:00
parent 0597db950c
commit c05633946e
3 changed files with 77 additions and 37 deletions

View File

@@ -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") { }
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);
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();