From 9b595dba72cbe4656c9b439d0af0d0c0a99c55eb Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 14 Jul 2018 15:56:32 +0200 Subject: [PATCH] Core/Spells: fixed Sanctified Wrath talent and converted Avenging Wrath aurascript to new model --- src/server/scripts/Spells/spell_paladin.cpp | 60 +++++++++------------ 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index fea257560f9..0748eb35175 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -258,46 +258,36 @@ class spell_pal_aura_mastery_immune : public SpellScriptLoader }; // 31884 - Avenging Wrath -class spell_pal_avenging_wrath : public SpellScriptLoader +class spell_pal_avenging_wrath : public AuraScript { - public: - spell_pal_avenging_wrath() : SpellScriptLoader("spell_pal_avenging_wrath") { } + PrepareAuraScript(spell_pal_avenging_wrath); - class spell_pal_avenging_wrath_AuraScript : public AuraScript - { - PrepareAuraScript(spell_pal_avenging_wrath_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( { - return ValidateSpellInfo({ SPELL_PALADIN_SANCTIFIED_WRATH, SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 }); - } + SPELL_PALADIN_SANCTIFIED_WRATH, + SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 + }); + } - 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, nullptr, true, nullptr, aurEff); - } - } + void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->GetAuraOfRankedSpell(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1)) + target->CastSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, true, nullptr, aurEff); + } - void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - GetTarget()->RemoveAurasDueToSpell(SPELL_PALADIN_SANCTIFIED_WRATH); - } + 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(); - } + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_pal_avenging_wrath::HandleApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_pal_avenging_wrath::HandleRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + } }; // 37877 - Blessing of Faith @@ -1604,7 +1594,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(); + RegisterAuraScript(spell_pal_avenging_wrath); new spell_pal_blessing_of_faith(); RegisterAuraScript(spell_pal_communion); new spell_pal_consecration();