diff options
author | Ovahlord <dreadkiller@gmx.de> | 2025-01-26 12:15:14 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-26 12:15:14 +0100 |
commit | e9105be6d872a7625d10c031a2e55062bd6c2832 (patch) | |
tree | 5b12624abd371a760e71a9c44f3a532735238373 /src | |
parent | a777f6768e75abf13aa85c8413a50c85158bd14d (diff) |
Scripts/Spells: fixed Seal of Truth
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 8d26e7dd4f4..47c66d47573 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -32,8 +32,10 @@ namespace Scripts::Spells::Paladin { enum PaladinSpells { + SPELL_PAL_CENSURE = 31803, + SPELL_PAL_JUDGEMENT_DAMAGE = 54158, SPELL_PAL_SEAL_OF_RIGHTEOUSNESS_DAMAGE = 25742, - SPELL_PAL_JUDGEMENT_DAMAGE = 54158 + SPELL_PAL_SEAL_OF_TRUTH_DAMAGE = 42463 }; // 20154 - Seal of Righteousness @@ -167,6 +169,45 @@ namespace Scripts::Spells::Paladin private: int32 _procBasePoints = 0; }; + + // 31801 - Seal of Truth + class spell_pal_seal_of_truth: public AuraScript + { + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_PAL_CENSURE, SPELL_PAL_SEAL_OF_TRUTH_DAMAGE }); + } + + bool CheckMeleeProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + if (!eventInfo.GetActionTarget()) + return false; + + // Only single target spells are allowed to trigger the proc + if (eventInfo.GetSpellInfo() && (eventInfo.GetSpellInfo()->IsAffectingArea() || eventInfo.GetSpellInfo()->HasAttribute(SPELL_ATTR5_TREAT_AS_AREA_EFFECT))) + return false; + + return true; + } + + void HandleMeleeProc(AuraEffect* aurEff, ProcEventInfo& eventInfo) + { + Unit* caster = eventInfo.GetActor(); + + // When Censure has reached its max stack amount, trigger an additional spell which will deal extra weapon damage + if (AuraEffect const* censureEffect = eventInfo.GetActionTarget()->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PALADIN, flag128(0x20000000), caster->GetGUID())) + if (censureEffect->GetBase()->GetStackAmount() >= censureEffect->GetBase()->CalcMaxStackAmount()) + caster->CastSpell(eventInfo.GetActionTarget(), SPELL_PAL_SEAL_OF_TRUTH_DAMAGE, aurEff); + + caster->CastSpell(eventInfo.GetActionTarget(), SPELL_PAL_CENSURE, aurEff); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_seal_of_truth::CheckMeleeProc, EFFECT_0, SPELL_AURA_DUMMY); + AfterEffectProc += AuraEffectProcFn(spell_pal_seal_of_truth::HandleMeleeProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; } void AddSC_paladin_spell_scripts() @@ -176,4 +217,5 @@ void AddSC_paladin_spell_scripts() RegisterSpellScript(spell_pal_judgement_of_righteousness); RegisterSpellScript(spell_pal_seal_of_justice); RegisterSpellScript(spell_pal_seal_of_righteousness); + RegisterSpellScript(spell_pal_seal_of_truth); } |