diff options
-rw-r--r-- | sql/updates/world/master/2025_02_14_00_world.sql | 5 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 43 |
3 files changed, 54 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_02_14_00_world.sql b/sql/updates/world/master/2025_02_14_00_world.sql new file mode 100644 index 00000000000..4e6dd5f3b19 --- /dev/null +++ b/sql/updates/world/master/2025_02_14_00_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pal_blade_of_vengeance'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pal_blade_of_vengeance_aoe_target_selector'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(184575, 'spell_pal_blade_of_vengeance'), +(404358, 'spell_pal_blade_of_vengeance_aoe_target_selector'); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d9857d6ce82..92914cec369 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -5289,6 +5289,12 @@ void SpellMgr::LoadSpellInfoTargetCaps() spellInfo->_LoadSqrtTargetLimit(5, 0, {}, EFFECT_1, {}, {}); }); + // Blade of Justice + ApplySpellFix({ 404358 }, [](SpellInfo* spellInfo) + { + spellInfo->_LoadSqrtTargetLimit(5, 0, {}, {}, {}, {}); + }); + TC_LOG_INFO("server.loading", ">> Loaded SpellInfo target caps in {} ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 12c6dafe46e..f80067cb56f 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -46,6 +46,7 @@ enum PaladinSpells SPELL_PALADIN_BEACON_OF_LIGHT = 53563, SPELL_PALADIN_BEACON_OF_LIGHT_HEAL = 53652, SPELL_PALADIN_BLADE_OF_JUSTICE = 184575, + SPELL_PALADIN_BLADE_OF_VENGEANCE = 403826, SPELL_PALADIN_BLINDING_LIGHT_EFFECT = 105421, SPELL_PALADIN_CONCENTRACTION_AURA = 19746, SPELL_PALADIN_CONSECRATED_GROUND_PASSIVE = 204054, @@ -300,6 +301,46 @@ class spell_pal_awakening : public AuraScript } }; +// Called by 184575 - Blade of Justice +class spell_pal_blade_of_vengeance : public SpellScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ SPELL_PALADIN_BLADE_OF_VENGEANCE }) + && ValidateSpellEffect({ { spellInfo->Id, EFFECT_2 } }) + && spellInfo->GetEffect(EFFECT_2).IsEffect(SPELL_EFFECT_TRIGGER_SPELL); + } + + bool Load() override + { + return !GetCaster()->HasAura(SPELL_PALADIN_BLADE_OF_VENGEANCE); + } + + static void PreventProc(WorldObject*& target) + { + target = nullptr; + } + + void Register() override + { + OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_pal_blade_of_vengeance::PreventProc, EFFECT_2, TARGET_UNIT_TARGET_ENEMY); + } +}; + +// 404358 - Blade of Justice +class spell_pal_blade_of_vengeance_aoe_target_selector : public SpellScript +{ + void RemoveExplicitTarget(std::list<WorldObject*>& targets) const + { + targets.remove(GetExplTargetWorldObject()); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pal_blade_of_vengeance_aoe_target_selector::RemoveExplicitTarget, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + } +}; + // 1022 - Blessing of Protection // 204018 - Blessing of Spellwarding class spell_pal_blessing_of_protection : public SpellScript @@ -1686,6 +1727,8 @@ void AddSC_paladin_spell_scripts() RegisterSpellScript(spell_pal_art_of_war); RegisterAreaTriggerAI(areatrigger_pal_ashen_hallow); RegisterSpellScript(spell_pal_awakening); + RegisterSpellScript(spell_pal_blade_of_vengeance); + RegisterSpellScript(spell_pal_blade_of_vengeance_aoe_target_selector); RegisterSpellScript(spell_pal_blessing_of_protection); RegisterSpellScript(spell_pal_blinding_light); RegisterSpellScript(spell_pal_crusader_might); |