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 68b2146 commit 508a96d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
8 changes: 7 additions & 1 deletion sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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<JudgementOfLightIntermediate>("spell_judgement_of_light_intermediate");
Expand All @@ -160,4 +170,5 @@ void LoadPaladinScripts()
RegisterSpellScript<spell_judgement>("spell_judgement");
RegisterSpellScript<SealOfTheCrusader>("spell_seal_of_the_crusader");
RegisterSpellScript<BlessingOfLight>("spell_blessing_of_light");
RegisterSpellScript<JudgementOfCommand>("spell_judgement_of_command");
}
14 changes: 0 additions & 14 deletions src/game/Spells/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 508a96d

Please sign in to comment.