From b4c961697aaf7ee0cc92e4a979ff2ff34c81a680 Mon Sep 17 00:00:00 2001 From: AnonXS Date: Sun, 8 Dec 2024 23:35:33 +0100 Subject: [PATCH] [Spell] Net Guard 11920 should reduce threat on target hit Might be different by entry that uses the parent spell Confirmed for: c.16912 145200 -> 72600 c.1034 19400 -> 9700 c.485 seemed to work different Based on https://github.com/vmangos/core/commit/619b0d7278dcf084b98876a4c597d8deb635ea4c --- sql/scriptdev2/spell.sql | 1 + .../AI/ScriptDevAI/scripts/world/spell_scripts.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 806b4157bec..7c73926a1f5 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -39,6 +39,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (26569,'spell_hate_to_zero'), (26637,'spell_hate_to_zero'), (10255,'spell_stoned'), +(11920,'spell_net_guard'), (12639,'spell_summon_hakkar'), (12948,'spell_hakkar_summoned'), (13278,'spell_gdr_channel'), diff --git a/src/game/AI/ScriptDevAI/scripts/world/spell_scripts.cpp b/src/game/AI/ScriptDevAI/scripts/world/spell_scripts.cpp index 0dfdf227d8c..5aeae7fee15 100644 --- a/src/game/AI/ScriptDevAI/scripts/world/spell_scripts.cpp +++ b/src/game/AI/ScriptDevAI/scripts/world/spell_scripts.cpp @@ -861,6 +861,17 @@ struct RetaliationCreature : public SpellScript } }; +struct NetGuard : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override + { + if (effIdx != EFFECT_INDEX_0) + return; + + spell->GetCaster()->getThreatManager().modifyThreatPercent(spell->GetUnitTarget(), -50); + } +}; + struct HateToHalf : public SpellScript { void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override @@ -1215,6 +1226,7 @@ void AddSC_spell_scripts() RegisterSpellScript("spell_prevent_spell_if_same_aura_on_caster"); RegisterSpellScript("spell_instill_lord_valthalaks_spirit"); RegisterSpellScript("spell_retaliation_creature"); + RegisterSpellScript("spell_net_guard"); RegisterSpellScript("spell_hate_to_half"); RegisterSpellScript("spell_hate_to_zero"); RegisterSpellScript("spell_stoned");