diff options
author | Ovahlord <dreadkiller@gmx.de> | 2025-01-26 11:33:31 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-26 11:33:31 +0100 |
commit | ccf00f50d449ad2e3bd63c2d998e2d4c638f56e8 (patch) | |
tree | e9b69a840e1150235c0438e5c572846a42642338 /src | |
parent | 42740ba740735b242e4389228b3ee7addd493625 (diff) |
Scripts/Spells: fixed Seal of Justice
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 e8448e5de46..756df2e18d5 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -75,7 +75,7 @@ namespace Scripts::Spells::Paladin // 20271 - Judgement class spell_pal_judgement : public SpellScript { - bool Validate(SpellInfo const* /*spellInfo*/) + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_PAL_JUDGEMENT_DAMAGE }); } @@ -126,6 +126,47 @@ namespace Scripts::Spells::Paladin CalcDamage += SpellCalcDamageFn(spell_pal_judgement_of_righteousness::CalculateDamage); } }; + + // 20164 - Seal of Justice + class spell_pal_seal_of_justice: public AuraScript + { + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell }); + } + + bool CheckMeleeProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + if (!eventInfo.GetActionTarget() || !eventInfo.GetDamageInfo()) + 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; + + Unit* caster = eventInfo.GetActor(); + WeaponAttackType attType = eventInfo.GetDamageInfo()->GetAttackType(); + + // Damage formula according to tooltip: ${$MWS*(0.005*$AP+0.01*$SPH) + _procBasePoints = static_cast<float>(caster->GetBaseAttackTime(attType)) / 1000.0f * (0.005f * caster->GetTotalAttackPowerValue(attType) + 0.01f * caster->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY, true)); + + return _procBasePoints > 0; + } + + void HandleMeleeProc(AuraEffect* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), GetEffectInfo(aurEff->GetEffIndex()).TriggerSpell, CastSpellExtraArgs(aurEff).AddSpellMod(SPELLVALUE_BASE_POINT1, _procBasePoints)); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_seal_of_justice::CheckMeleeProc, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_pal_seal_of_justice::HandleMeleeProc, EFFECT_0, SPELL_AURA_DUMMY); + } + private: + int32 _procBasePoints = 0; + }; } void AddSC_paladin_spell_scripts() @@ -133,5 +174,6 @@ void AddSC_paladin_spell_scripts() using namespace Scripts::Spells::Paladin; RegisterSpellScript(spell_pal_judgement); RegisterSpellScript(spell_pal_judgement_of_righteousness); + RegisterSpellScript(spell_pal_seal_of_justice); RegisterSpellScript(spell_pal_seal_of_righteousness); } |