mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Spells: fixed Sanctified Wrath talent and converted Avenging Wrath aurascript to new model
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user