Core/Spells: Convert Avenging Wrath to spellscript

Closes #11896
Closes #3464
This commit is contained in:
Unholychick
2014-04-18 20:21:05 +02:00
committed by joschiwald
parent 89cc056a50
commit 574fa30ea6
3 changed files with 57 additions and 9 deletions

View File

@@ -66,6 +66,9 @@ enum PaladinSpells
SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790,
SPELL_PALADIN_SANCTIFIED_WRATH = 57318,
SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 = 53375,
SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742,
SPELL_PALADIN_CONCENTRACTION_AURA = 19746,
@@ -236,6 +239,52 @@ class spell_pal_aura_mastery_immune : public SpellScriptLoader
}
};
// 31884 - Avenging Wrath
class spell_pal_avenging_wrath : public SpellScriptLoader
{
public:
spell_pal_avenging_wrath() : SpellScriptLoader("spell_pal_avenging_wrath") { }
class spell_pal_avenging_wrath_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_avenging_wrath_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH)
|| !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1))
return false;
return true;
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1, EFFECT_2))
{
int32 basepoints = aurEff->GetAmount();
target->CastCustomSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, &basepoints, &basepoints, NULL, true, NULL, aurEff);
}
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_PALADIN_SANCTIFIED_WRATH);
}
void Register() OVERRIDE
{
OnEffectApply += AuraEffectApplyFn(spell_pal_avenging_wrath_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_pal_avenging_wrath_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_avenging_wrath_AuraScript();
}
};
// 37877 - Blessing of Faith
class spell_pal_blessing_of_faith : public SpellScriptLoader
{
@@ -1233,6 +1282,7 @@ void AddSC_paladin_spell_scripts()
new spell_pal_ardent_defender();
new spell_pal_aura_mastery();
new spell_pal_aura_mastery_immune();
new spell_pal_avenging_wrath();
new spell_pal_blessing_of_faith();
new spell_pal_blessing_of_sanctuary();
new spell_pal_divine_sacrifice();