Skip to content

Commit

Permalink
Paladin: Reimplement Judgement of Light and Wisdom using intermediate…
Browse files Browse the repository at this point in the history
… spells
  • Loading branch information
killerwife committed Sep 17, 2023
1 parent 20468a8 commit 1543ebe
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 39 deletions.
5 changes: 5 additions & 0 deletions sql/base/dbc/cmangos_fixes/Spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,11 @@ INSERT INTO spell_template(Id, SchoolMask, Category, Dispel, Mechanic, Attribute
INSERT INTO spell_template(Id, SchoolMask, Category, Dispel, Mechanic, Attributes, AttributesEx, AttributesEx2, AttributesEx3, AttributesEx4, AttributesEx5, Stances, StancesNot, Targets, TargetCreatureType, RequiresSpellFocus, CasterAuraState, TargetAuraState, CasterAuraStateNot, TargetAuraStateNot, CastingTimeIndex, RecoveryTime, CategoryRecoveryTime, InterruptFlags, AuraInterruptFlags, ChannelInterruptFlags, procFlags, procChance, procCharges, maxLevel, baseLevel, spellLevel, DurationIndex, powerType, manaCost, manaCostPerLevel, manaPerSecond, manaPerSecondPerLevel, rangeIndex, speed, StackAmount, Totem1, Totem2, Reagent1, Reagent2, Reagent3, Reagent4, Reagent5, Reagent6, Reagent7, Reagent8, ReagentCount1, ReagentCount2, ReagentCount3, ReagentCount4, ReagentCount5, ReagentCount6, ReagentCount7, ReagentCount8, EquippedItemClass, EquippedItemSubClassMask, EquippedItemInventoryTypeMask, Effect1, Effect2, Effect3, EffectDieSides1, EffectDieSides2, EffectDieSides3, EffectBaseDice1, EffectBaseDice2, EffectBaseDice3, EffectDicePerLevel1, EffectDicePerLevel2, EffectDicePerLevel3, EffectRealPointsPerLevel1, EffectRealPointsPerLevel2, EffectRealPointsPerLevel3, EffectBasePoints1, EffectBasePoints2, EffectBasePoints3, EffectMechanic1, EffectMechanic2, EffectMechanic3, EffectImplicitTargetA1, EffectImplicitTargetA2, EffectImplicitTargetA3, EffectImplicitTargetB1, EffectImplicitTargetB2, EffectImplicitTargetB3, EffectRadiusIndex1, EffectRadiusIndex2, EffectRadiusIndex3, EffectApplyAuraName1, EffectApplyAuraName2, EffectApplyAuraName3, EffectAmplitude1, EffectAmplitude2, EffectAmplitude3, EffectMultipleValue1, EffectMultipleValue2, EffectMultipleValue3, EffectChainTarget1, EffectChainTarget2, EffectChainTarget3, EffectItemType1, EffectItemType2, EffectItemType3, EffectMiscValue1, EffectMiscValue2, EffectMiscValue3, EffectMiscValueB1, EffectMiscValueB2, EffectMiscValueB3, EffectTriggerSpell1, EffectTriggerSpell2, EffectTriggerSpell3, EffectPointsPerComboPoint1, EffectPointsPerComboPoint2, EffectPointsPerComboPoint3, SpellVisual, SpellIconID, activeIconID, spellPriority, SpellName, SpellName2, SpellName3, SpellName4, SpellName5, SpellName6, SpellName7, SpellName8, ManaCostPercentage, StartRecoveryCategory, StartRecoveryTime, MaxTargetLevel, SpellFamilyName, SpellFamilyFlags, MaxAffectedTargets, DmgClass, PreventionType, DmgMultiplier1, DmgMultiplier2, DmgMultiplier3, TotemCategory1, TotemCategory2, AreaId) VALUES
('5667', '1', '0', '0', '0', '67109072', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '101', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '0', '0', '6', '0', '0', '1', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '-9', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '13', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', 'Bogling Passive', '', '', '', '', '', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1', '0', '0', '0');

-- Judgement of Light and Judgement of Wisdom intermediate spells
INSERT INTO spell_template(Id, SchoolMask, Category, Dispel, Mechanic, Attributes, AttributesEx, AttributesEx2, AttributesEx3, AttributesEx4, AttributesEx5, Stances, StancesNot, Targets, TargetCreatureType, RequiresSpellFocus, CasterAuraState, TargetAuraState, CasterAuraStateNot, TargetAuraStateNot, CastingTimeIndex, RecoveryTime, CategoryRecoveryTime, InterruptFlags, AuraInterruptFlags, ChannelInterruptFlags, procFlags, procChance, procCharges, maxLevel, baseLevel, spellLevel, DurationIndex, powerType, manaCost, manaCostPerLevel, manaPerSecond, manaPerSecondPerLevel, rangeIndex, speed, StackAmount, Totem1, Totem2, Reagent1, Reagent2, Reagent3, Reagent4, Reagent5, Reagent6, Reagent7, Reagent8, ReagentCount1, ReagentCount2, ReagentCount3, ReagentCount4, ReagentCount5, ReagentCount6, ReagentCount7, ReagentCount8, EquippedItemClass, EquippedItemSubClassMask, EquippedItemInventoryTypeMask, Effect1, Effect2, Effect3, EffectDieSides1, EffectDieSides2, EffectDieSides3, EffectBaseDice1, EffectBaseDice2, EffectBaseDice3, EffectDicePerLevel1, EffectDicePerLevel2, EffectDicePerLevel3, EffectRealPointsPerLevel1, EffectRealPointsPerLevel2, EffectRealPointsPerLevel3, EffectBasePoints1, EffectBasePoints2, EffectBasePoints3, EffectMechanic1, EffectMechanic2, EffectMechanic3, EffectImplicitTargetA1, EffectImplicitTargetA2, EffectImplicitTargetA3, EffectImplicitTargetB1, EffectImplicitTargetB2, EffectImplicitTargetB3, EffectRadiusIndex1, EffectRadiusIndex2, EffectRadiusIndex3, EffectApplyAuraName1, EffectApplyAuraName2, EffectApplyAuraName3, EffectAmplitude1, EffectAmplitude2, EffectAmplitude3, EffectMultipleValue1, EffectMultipleValue2, EffectMultipleValue3, EffectChainTarget1, EffectChainTarget2, EffectChainTarget3, EffectItemType1, EffectItemType2, EffectItemType3, EffectMiscValue1, EffectMiscValue2, EffectMiscValue3, EffectMiscValueB1, EffectMiscValueB2, EffectMiscValueB3, EffectTriggerSpell1, EffectTriggerSpell2, EffectTriggerSpell3, EffectPointsPerComboPoint1, EffectPointsPerComboPoint2, EffectPointsPerComboPoint3, SpellVisual, SpellIconID, activeIconID, spellPriority, SpellName, SpellName2, SpellName3, SpellName4, SpellName5, SpellName6, SpellName7, SpellName8, ManaCostPercentage, StartRecoveryCategory, StartRecoveryTime, MaxTargetLevel, SpellFamilyName, SpellFamilyFlags, MaxAffectedTargets, DmgClass, PreventionType, DmgMultiplier1, DmgMultiplier2, DmgMultiplier3, TotemCategory1, TotemCategory2, AreaId) VALUES
('1826', '1', '0', '0', '0', '384', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '101', '0', '0', '0', '99', '0', '3', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '0', '0', '3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0', '12', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '262', '0', '0', 'Judgement of Wisdom Intermediate', '', '', '', '', '', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1', '0', '0', '0'),
('5373', '1', '0', '0', '0', '384', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '101', '0', '0', '0', '99', '0', '0', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '0', '0', '3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0', '12', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '237', '0', '0', 'Judgement of Light Intermediate', '', '', '', '', '', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '1', '1', '0', '0', '0');

-- ============================================================
-- TBC section
-- ============================================================
Expand Down
2 changes: 2 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(20307,'spell_seal_of_the_crusader'),
(20308,'spell_seal_of_the_crusader'),
(27158,'spell_seal_of_the_crusader'),
(5373,'spell_judgement_of_light_intermediate'),
(1826,'spell_judgement_of_wisdom_intermediate'),
(19977,'spell_blessing_of_light'),
(19978,'spell_blessing_of_light'),
(19979,'spell_blessing_of_light'),
Expand Down
59 changes: 45 additions & 14 deletions src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,49 @@ struct SealOfTheCrusader : public AuraScript
}
};

// 5373 - Judgement of Light Intermediate
struct JudgementOfLightIntermediate : public SpellScript
{
void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override
{
if (spell->GetTriggeredByAuraSpellInfo() == nullptr)
return;

uint32 triggerSpell = 0;
switch (spell->GetTriggeredByAuraSpellInfo()->Id)
{
case 20185: triggerSpell = 20267; break; // Rank 1
case 20344: triggerSpell = 20341; break; // Rank 2
case 20345: triggerSpell = 20342; break; // Rank 3
case 20346: triggerSpell = 20343; break; // Rank 4
case 27162: triggerSpell = 27163; break; // Rank 5
}
if (triggerSpell)
spell->GetUnitTarget()->CastSpell(nullptr, triggerSpell, TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CURRENT_CASTED_SPELL | TRIGGERED_HIDE_CAST_IN_COMBAT_LOG);
}
};

// 1826 - Judgement of Wisdom Intermediate
struct JudgementOfWisdomIntermediate : public SpellScript
{
void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override
{
if (spell->GetTriggeredByAuraSpellInfo() == nullptr)
return;

uint32 triggerSpell = 0;
switch (spell->GetTriggeredByAuraSpellInfo()->Id)
{
case 20186: triggerSpell = 20268; break; // Rank 1
case 20354: triggerSpell = 20352; break; // Rank 2
case 20355: triggerSpell = 20353; break; // Rank 3
case 27164: triggerSpell = 27165; break; // Rank 4
}
if (triggerSpell)
spell->GetUnitTarget()->CastSpell(nullptr, triggerSpell, TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CURRENT_CASTED_SPELL | TRIGGERED_HIDE_CAST_IN_COMBAT_LOG);
}
};

struct spell_judgement : public SpellScript
{
void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override
Expand Down Expand Up @@ -133,19 +176,6 @@ struct spell_paladin_tier_6_trinket : public AuraScript
}
};

struct IncreasedHolyLightHealing : public AuraScript
{
void OnApply(Aura* aura, bool apply) const
{
aura->GetTarget()->RegisterScriptedLocationAura(aura, SCRIPT_LOCATION_SPELL_HEALING_DONE, apply);
}

void OnDamageCalculate(Aura* aura, Unit* /*attacker*/, Unit* /*victim*/, int32& advertisedBenefit, float& /*totalMod*/) const override
{
advertisedBenefit += aura->GetModifier()->m_amount;
}
};

struct RighteousDefense : public SpellScript
{
bool OnCheckTarget(const Spell* spell, Unit* target, SpellEffectIndex /*eff*/) const override
Expand Down Expand Up @@ -229,7 +259,8 @@ struct BlessingOfLight : public AuraScript

void LoadPaladinScripts()
{
RegisterSpellScript<IncreasedHolyLightHealing>("spell_increased_holy_light_healing");
RegisterSpellScript<JudgementOfLightIntermediate>("spell_judgement_of_light_intermediate");
RegisterSpellScript<JudgementOfWisdomIntermediate>("spell_judgement_of_wisdom_intermediate");
RegisterSpellScript<spell_judgement>("spell_judgement");
RegisterSpellScript<RighteousDefense>("spell_righteous_defense");
RegisterSpellScript<SealOfTheCrusader>("spell_seal_of_the_crusader");
Expand Down
26 changes: 1 addition & 25 deletions src/game/Spells/UnitAuraProcHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2324,31 +2324,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(ProcExecutionData& data
}
}
*/
// Judgement of Light and Judgement of Wisdom
if (auraSpellInfo->SpellFamilyFlags & uint64(0x0000000000080000))
{
switch (auraSpellInfo->Id)
{
// Judgement of Light
case 20185: trigger_spell_id = 20267; break; // Rank 1
case 20344: trigger_spell_id = 20341; break; // Rank 2
case 20345: trigger_spell_id = 20342; break; // Rank 3
case 20346: trigger_spell_id = 20343; break; // Rank 4
case 27162: trigger_spell_id = 27163; break; // Rank 5
// Judgement of Wisdom
case 20186: trigger_spell_id = 20268; break; // Rank 1
case 20354: trigger_spell_id = 20352; break; // Rank 2
case 20355: trigger_spell_id = 20353; break; // Rank 3
case 27164: trigger_spell_id = 27165; break; // Rank 4
default:
sLog.outError("Unit::HandleProcTriggerSpellAuraProc: Spell %u miss posibly Judgement of Light/Wisdom", auraSpellInfo->Id);
return SPELL_AURA_PROC_FAILED;
}
pVictim->CastSpell(nullptr, trigger_spell_id, TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CURRENT_CASTED_SPELL | TRIGGERED_HIDE_CAST_IN_COMBAT_LOG);
return SPELL_AURA_PROC_OK; // no hidden cooldown
}
// Illumination
else if (auraSpellInfo->SpellIconID == 241)
if (auraSpellInfo->SpellIconID == 241)
{
if (!spellInfo)
return SPELL_AURA_PROC_FAILED;
Expand Down

3 comments on commit 1543ebe

@aleigood
Copy link
Contributor

@aleigood aleigood commented on 1543ebe Sep 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> Trying to apply ScriptDev2 data
  - Applying scriptdev2.sql ... SUCCESS
  - Applying spell.sql ... FAILED!
>>> ERROR 1062 (23000) at line 194: Duplicate entry '28851' for key 'spell_scripts.PRIMARY'

@cpevors
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue, and it has made it impossible to boot up my server.

@killerwife
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will push in a bit a fix.

Please sign in to comment.