diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-02-14 13:26:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-14 13:26:23 +0100 |
commit | 3c9c0456c5a738ebdb6beb1bcf9d2d177ad03b97 (patch) | |
tree | 21c4c72a4855a4a212bdbda42e1e278f77ce3431 /src | |
parent | c8bd288166a2d541fbf4e4620e499e3b2466f29d (diff) |
Scripts/Spells: Implement paladin talent "Blade of Vengeance" (#30612)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 43 |
2 files changed, 49 insertions, 0 deletions
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); |