diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index a9ccc832622..036f9b4f1ad 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -224,6 +224,47 @@ namespace Scripts::Spells::Paladin CalcDamage += SpellCalcDamageFn(spell_pal_judgement_of_truth::CalculateDamage); } }; + + // 20165 - Seal of Insight + class spell_pal_seal_of_insight : public AuraScript + { + bool CheckMeleeProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + // 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; + + // The proc chance is defined in the aura effect's amount + return roll_chance_i(aurEff->GetAmount()); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_seal_of_insight::CheckMeleeProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + // 20167 - Judgement of Truth + class spell_pal_seal_of_insight_triggered : public SpellScript + { + void CalculateEnergizeAmount(SpellEffIndex /*effIndex*/) + { + // Restores 4% of the caster's base mana + SetEffectValue(CalculatePct(GetCaster()->GetCreateMana(), GetEffectValue())); + } + + void CalculateHeal(SpellEffectInfo const& /*spellEffectInfo*/, Unit* /*victim*/, int32& healing, int32& /*flatMod*/, float& /*pctMod*/) + { + // Healing formula according to tooltip: ${0.15*$AP+0.15*$SPH} + healing = std::round(0.15f * GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK) + 0.15f * GetCaster()->SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_HOLY, true)); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_pal_seal_of_insight_triggered::CalculateEnergizeAmount, EFFECT_1, SPELL_EFFECT_ENERGIZE); + CalcHealing += SpellCalcDamageFn(spell_pal_seal_of_insight_triggered::CalculateHeal); + } + }; } void AddSC_paladin_spell_scripts() @@ -232,6 +273,8 @@ void AddSC_paladin_spell_scripts() RegisterSpellScript(spell_pal_judgement); RegisterSpellScript(spell_pal_judgement_of_righteousness); RegisterSpellScript(spell_pal_judgement_of_truth); + RegisterSpellScript(spell_pal_seal_of_insight); + RegisterSpellScript(spell_pal_seal_of_insight_triggered); RegisterSpellScript(spell_pal_seal_of_justice); RegisterSpellScript(spell_pal_seal_of_righteousness); RegisterSpellScript(spell_pal_seal_of_truth); |