From 508a96d744b071fcffcace790b48fc22fb438c0e Mon Sep 17 00:00:00 2001 From: MantisLord Date: Sat, 3 Feb 2024 14:49:57 -0500 Subject: [PATCH] Paladin: Port Judgement of Command to spellscript https://github.com/cmangos/issues/issues/3596 --- sql/scriptdev2/spell.sql | 8 +++++++- .../Scripts/Scripting/ClassScripts/Paladin.cpp | 11 +++++++++++ src/game/Spells/SpellEffects.cpp | 14 -------------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index e26b1a8564..f6aad8d9f4 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -226,7 +226,13 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (19977,'spell_blessing_of_light'), (19978,'spell_blessing_of_light'), (19979,'spell_blessing_of_light'), -(20271,'spell_judgement'); +(20271,'spell_judgement'), +(20467,'spell_judgement_of_command'), +(20963,'spell_judgement_of_command'), +(20964,'spell_judgement_of_command'), +(20965,'spell_judgement_of_command'), +(20966,'spell_judgement_of_command'), +(27171,'spell_judgement_of_command'); -- Warlock INSERT INTO spell_scripts(Id, ScriptName) VALUES diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp index 18a8589ab3..c3efc8a88b 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp @@ -152,6 +152,16 @@ struct DivineIntervention : public SpellScript } }; +// 20467, 20963, 20964, 20965, 20966, 27171 - Judgement of Command +struct JudgementOfCommand : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override + { + if (!spell->GetUnitTarget()->IsStunned()) + spell->SetDamage(uint32(spell->GetDamage() / 2)); + } +}; + void LoadPaladinScripts() { RegisterSpellScript("spell_judgement_of_light_intermediate"); @@ -160,4 +170,5 @@ void LoadPaladinScripts() RegisterSpellScript("spell_judgement"); RegisterSpellScript("spell_seal_of_the_crusader"); RegisterSpellScript("spell_blessing_of_light"); + RegisterSpellScript("spell_judgement_of_command"); } \ No newline at end of file diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index d1c51d9cb8..afa665d260 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -350,21 +350,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex eff_idx) case SPELLFAMILY_HUNTER: break; case SPELLFAMILY_PALADIN: - { - switch (m_spellInfo->Id) - { - case 20467: // Judgement of Command - case 20963: - case 20964: - case 20965: - case 20966: - case 27171: - if (!unitTarget->IsStunned()) - damage /= 2; - break; - } break; - } } if (damage >= 0)