Skip to content

Commit

Permalink
Paladin: Port Judgement of Command to spellscript
Browse files Browse the repository at this point in the history
  • Loading branch information
MantisLord committed Feb 3, 2024
1 parent ab0a925 commit 976614c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
8 changes: 7 additions & 1 deletion sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,13 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(40470,'spell_paladin_tier_6_trinket'),
(31789,'spell_righteous_defense'),
(31893,'spell_seal_of_blood_self_damage'),
(31898,'spell_seal_of_blood_self_damage');
(31898,'spell_seal_of_blood_self_damage'),
(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
Expand Down
11 changes: 11 additions & 0 deletions src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,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<JudgementOfLightIntermediate>("spell_judgement_of_light_intermediate");
Expand All @@ -286,4 +296,5 @@ void LoadPaladinScripts()
RegisterSpellScript<SealOfBloodSelfDamage>("spell_seal_of_blood_self_damage");
RegisterSpellScript<PaladinTier6Trinket>("spell_paladin_tier_6_trinket");
RegisterSpellScript<BlessingOfLight>("spell_blessing_of_light");
RegisterSpellScript<JudgementOfCommand>("spell_judgement_of_command");
}
12 changes: 0 additions & 12 deletions src/game/Spells/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,18 +557,6 @@ void Spell::EffectSchoolDMG(SpellEffectIndex eff_idx)
else
damage *= stacks;
}
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;
}
}
Expand Down

0 comments on commit 976614c

Please sign in to comment.