aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-02-11 23:29:03 +0100
committerGitHub <noreply@github.com>2025-02-11 23:29:03 +0100
commitc54b37d59f5d2d06bf22f3eb5c4929922de92845 (patch)
tree4063c539bc92a3f7ca610112e14b18eb9843e65d /src
parent1f62d3caaac234bca14929ec2397befe69b85900 (diff)
Scripts/Spells: Implement paladin talent "Execution Sentence" (#30617)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 4d3076ba112..9e22069807e 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -66,6 +66,10 @@ enum PaladinSpells
SPELL_PALADIN_DIVINE_STORM_DAMAGE = 224239,
SPELL_PALADIN_ENDURING_LIGHT = 40471,
SPELL_PALADIN_ENDURING_JUDGEMENT = 40472,
+ SPELL_PALADIN_EXECUTION_SENTENCE_DAMAGE = 387113,
+ SPELL_PALADIN_EXECUTION_SENTENCE_11_SECONDS = 406919,
+ SPELL_PALADIN_EXECUTION_SENTENCE_8_SECONDS = 386579,
+ SPELL_PALADIN_EXECUTIONERS_WILL = 406940,
SPELL_PALADIN_EYE_FOR_AN_EYE_TRIGGERED = 205202,
SPELL_PALADIN_FINAL_STAND = 204077,
SPELL_PALADIN_FINAL_STAND_EFFECT = 204079,
@@ -612,6 +616,73 @@ class spell_pal_divine_storm : public SpellScript
}
};
+// 343527 - Execution Sentence
+class spell_pal_execution_sentence : public SpellScript
+{
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo(
+ {
+ SPELL_PALADIN_EXECUTION_SENTENCE_DAMAGE,
+ SPELL_PALADIN_EXECUTIONERS_WILL,
+ SPELL_PALADIN_EXECUTION_SENTENCE_11_SECONDS,
+ SPELL_PALADIN_EXECUTION_SENTENCE_8_SECONDS
+ });
+ }
+
+ void HandleVisual(SpellEffIndex /*effIndex*/) const
+ {
+ uint32 visualSpellId = GetCaster()->HasAura(SPELL_PALADIN_EXECUTIONERS_WILL)
+ ? SPELL_PALADIN_EXECUTION_SENTENCE_11_SECONDS
+ : SPELL_PALADIN_EXECUTION_SENTENCE_8_SECONDS;
+ GetCaster()->CastSpell(GetHitUnit(), visualSpellId,
+ CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .TriggeringSpell = GetSpell()
+ });
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_pal_execution_sentence::HandleVisual, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
+ }
+};
+
+class spell_pal_execution_sentence_aura : public AuraScript
+{
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } })
+ && spellInfo->GetEffect(EFFECT_1).IsAura();
+ }
+
+ void HandleProc(AuraEffect* aurEff, ProcEventInfo const& eventInfo) const
+ {
+ if (DamageInfo const* damageInfo = eventInfo.GetDamageInfo())
+ aurEff->ChangeAmount(aurEff->GetAmount() + CalculatePct(damageInfo->GetDamage(), GetEffect(EFFECT_1)->GetAmount()));
+ }
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
+ {
+ int32 amount = aurEff->GetAmount();
+ if (!amount || GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(GetTarget(), SPELL_PALADIN_EXECUTION_SENTENCE_DAMAGE, CastSpellExtraArgsInit{
+ .TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
+ .TriggeringAura = aurEff,
+ .SpellValueOverrides = { { SPELLVALUE_BASE_POINT0, amount } }
+ });
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_pal_execution_sentence_aura::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_pal_execution_sentence_aura::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
// 205191 - Eye for an Eye
class spell_pal_eye_for_an_eye : public AuraScript
{
@@ -1598,6 +1669,7 @@ void AddSC_paladin_spell_scripts()
RegisterSpellScript(spell_pal_divine_shield);
RegisterSpellScript(spell_pal_divine_steed);
RegisterSpellScript(spell_pal_divine_storm);
+ RegisterSpellAndAuraScriptPair(spell_pal_execution_sentence, spell_pal_execution_sentence_aura);
RegisterSpellScript(spell_pal_eye_for_an_eye);
RegisterSpellScript(spell_pal_fist_of_justice);
RegisterSpellScript(spell_pal_glyph_of_holy_light);