From 81b86e5de065bfdef02df8f10c64fef4e9204478 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 27 Dec 2017 21:21:45 -0300 Subject: [PATCH] Core/Scripts: remove Quel'Delar from player inventory during "The Halls Of Reflection" quests (24480, 24561) --- .../world/3.3.5/2017_12_28_05_world.sql | 3 +++ .../HallsOfReflection/halls_of_reflection.cpp | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 sql/updates/world/3.3.5/2017_12_28_05_world.sql diff --git a/sql/updates/world/3.3.5/2017_12_28_05_world.sql b/sql/updates/world/3.3.5/2017_12_28_05_world.sql new file mode 100644 index 00000000000..a1d31371e46 --- /dev/null +++ b/sql/updates/world/3.3.5/2017_12_28_05_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hor_quel_delars_will'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(70698, 'spell_hor_quel_delars_will'); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index fca2cd10e2c..b5926cad157 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -2836,6 +2836,30 @@ class spell_hor_gunship_cannon_fire : public SpellScriptLoader } }; +// 70698 - Quel'Delar's Will +class spell_hor_quel_delars_will : public SpellScript +{ + PrepareSpellScript(spell_hor_quel_delars_will); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell }); + } + + void HandleReagent(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + // dummy spell consumes reagent, don't ignore it + GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_hor_quel_delars_will::HandleReagent, EFFECT_0, SPELL_EFFECT_FORCE_CAST); + } +}; + void AddSC_halls_of_reflection() { new at_hor_intro_start(); @@ -2862,4 +2886,5 @@ void AddSC_halls_of_reflection() new spell_hor_start_halls_of_reflection_quest_ae(); new spell_hor_evasion(); new spell_hor_gunship_cannon_fire(); + RegisterSpellScript(spell_hor_quel_delars_will); }