Core/Quests: Fix an exploit in Red Snapper - Very Tasty!

Also fix a silly codestyle typo in previous commit.

Closes #3887
This commit is contained in:
Discover- committed 2011-12-25 00:13:28 +01:00
1 parent 0d98ecc6c1
commit ef4608f07c
3 files changed
+56 -3

No files matched your search

+49
View File
@@ -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();
}