Scripts/Spells: Implement paladin talent "Justicar's Vengeance" damage bonus on stunned targets (#30614)

This commit is contained in:
Aqua Deus
2025-02-15 20:04:52 +01:00
committed by GitHub
parent 8f2bf26969
commit e423e5e04a
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pal_justicars_vengeance';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(215661, 'spell_pal_justicars_vengeance');

View File

@@ -994,6 +994,26 @@ class spell_pal_judgment : public SpellScript
}
};
// 215661 - Justicar's Vengeance
class spell_pal_justicars_vengeance : public SpellScript
{
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
}
void HandleDamage(SpellEffectInfo const& /*spellEffectInfo*/, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
{
if (victim->HasUnitState(UNIT_STATE_STUNNED))
AddPct(pctMod, GetEffectInfo(EFFECT_1).CalcValue(GetCaster()));
}
void Register() override
{
CalcDamage += SpellCalcDamageFn(spell_pal_justicars_vengeance::HandleDamage);
}
};
// 114165 - Holy Prism
class spell_pal_holy_prism : public SpellScript
{
@@ -1775,6 +1795,7 @@ void AddSC_paladin_spell_scripts()
RegisterSpellScript(spell_pal_infusion_of_light);
RegisterSpellScript(spell_pal_moment_of_glory);
RegisterSpellScript(spell_pal_judgment);
RegisterSpellScript(spell_pal_justicars_vengeance);
RegisterSpellScript(spell_pal_holy_prism);
RegisterSpellScript(spell_pal_holy_prism_selector);
RegisterSpellScript(spell_pal_holy_shock);