From c8bfb9cf4df450497263d94869880db6eb7f3c73 Mon Sep 17 00:00:00 2001 From: Kirkhammett Date: Tue, 6 Aug 2013 23:16:03 +0100 Subject: DB&Scripts/Icecrown: Fix quest The Last Line Of Defense and script Argent Cannons Closes #998 Closes #10460 --- src/server/scripts/Spells/spell_quest.cpp | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index d87278cefc0..10cc62a8a91 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1785,6 +1785,40 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader } }; +class spell_q13086_cannons_target : public SpellScriptLoader +{ + public: + spell_q13086_cannons_target() : SpellScriptLoader("spell_q13086_cannons_target") { } + + class spell_q13086_cannons_target_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q13086_cannons_target_SpellScript); + + bool Validate(SpellInfo const* spellInfo) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue())) + return false; + return true; + } + + void HandleEffectDummy(SpellEffIndex /*effIndex*/) + { + if (WorldLocation const* pos = GetExplTargetDest()) + GetCaster()->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), GetEffectValue(), true); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_q13086_cannons_target_SpellScript::HandleEffectDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q13086_cannons_target_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1829,4 +1863,5 @@ void AddSC_quest_spell_scripts() new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy(); new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon(); new spell_q12847_summon_soul_moveto_bunny(); + new spell_q13086_cannons_target(); } -- cgit v1.2.3