From ef4608f07c8596c2436604e18d49ba8891af3191 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 25 Dec 2011 00:13:28 +0100 Subject: Core/Quests: Fix an exploit in Red Snapper - Very Tasty! Also fix a silly codestyle typo in previous commit. Closes #3887 --- src/server/scripts/Spells/spell_quest.cpp | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 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 3b2cc5f5e00..ecdbd582b76 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1026,6 +1026,54 @@ public: } }; +// http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty! +enum RedSnapperVeryTasty +{ + SPELL_CAST_NET = 29866, + ITEM_RED_SNAPPER = 23614, + NPC_ANGRY_MURLOC = 17102, +}; + +class spell_q9452_cast_net: public SpellScriptLoader +{ + public: + spell_q9452_cast_net() : SpellScriptLoader("spell_q9452_cast_net") { } + + class spell_q9452_cast_net_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q9452_cast_net_SpellScript) + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + + if (!caster) + return; + + switch (urand(0, 2)) + { + case 0: case 1: + caster->AddItem(ITEM_RED_SNAPPER, 1); + break; + case 2: + if (Creature* murloc = caster->SummonCreature(NPC_ANGRY_MURLOC, caster->GetPositionX()+5, caster->GetPositionY(), caster->GetPositionZ(), 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 120000)) + murloc->AI()->AttackStart(caster); + break; + } + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q9452_cast_net_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1050,4 +1098,5 @@ void AddSC_quest_spell_scripts() new spell_q12805_lifeblood_dummy(); new spell_q13280_13283_plant_battle_standard(); new spell_q14112_14145_chum_the_water(); + new spell_q9452_cast_net(); } -- cgit v1.2.3