From 1543ebe8eccc9f86ba5e50546d9452e67ffe9613 Mon Sep 17 00:00:00 2001 From: killerwife Date: Sun, 17 Sep 2023 12:57:29 +0200 Subject: [PATCH] Paladin: Reimplement Judgement of Light and Wisdom using intermediate spells --- sql/base/dbc/cmangos_fixes/Spell.sql | 5 ++ sql/scriptdev2/spell.sql | 2 + .../Scripting/ClassScripts/Paladin.cpp | 59 ++++++++++++++----- src/game/Spells/UnitAuraProcHandler.cpp | 26 +------- 4 files changed, 53 insertions(+), 39 deletions(-) diff --git a/sql/base/dbc/cmangos_fixes/Spell.sql b/sql/base/dbc/cmangos_fixes/Spell.sql index eb67817fbe..ab69a4c6d1 100644 --- a/sql/base/dbc/cmangos_fixes/Spell.sql +++ b/sql/base/dbc/cmangos_fixes/Spell.sql @@ -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 -- ============================================================ diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index d5fce4da53..83aa5ec0da 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -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'), diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp index 0abb42effd..4a9edce9c3 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Paladin.cpp @@ -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 @@ -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 @@ -229,7 +259,8 @@ struct BlessingOfLight : public AuraScript void LoadPaladinScripts() { - RegisterSpellScript("spell_increased_holy_light_healing"); + RegisterSpellScript("spell_judgement_of_light_intermediate"); + RegisterSpellScript("spell_judgement_of_wisdom_intermediate"); RegisterSpellScript("spell_judgement"); RegisterSpellScript("spell_righteous_defense"); RegisterSpellScript("spell_seal_of_the_crusader"); diff --git a/src/game/Spells/UnitAuraProcHandler.cpp b/src/game/Spells/UnitAuraProcHandler.cpp index dbf8415f95..f36f336d33 100644 --- a/src/game/Spells/UnitAuraProcHandler.cpp +++ b/src/game/Spells/UnitAuraProcHandler.cpp @@ -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;