Scripts/Spells: fixed Seal of Insight

This commit is contained in:
Ovahlord
2025-01-26 16:44:36 +01:00
parent 59c61f7c15
commit 977452c74b
2 changed files with 47 additions and 0 deletions

View File

@@ -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);