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-
2011-12-25 00:13:28 +01:00
parent 0d98ecc6c1
commit ef4608f07c
3 changed files with 56 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
UPDATE `item_template` SET `ScriptName`='' WHERE `entry`=23654;
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_q9452_cast_net';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(29866,'spell_q9452_cast_net');

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();
}

View File

@@ -1301,9 +1301,9 @@ class go_veil_skith_cage : public GameObjectScript
{
if (player->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE)
{
std::list<Creature*> ChildrenList;
GetCreatureListWithEntryInGrid(ChildrenList, go, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE);
for (std::list<Creature*>::const_iterator itr = ChildrenList.begin(); itr != ChildrenList.end(); ++itr)
std::list<Creature*> childrenList;
GetCreatureListWithEntryInGrid(childrenList, go, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE);
for (std::list<Creature*>::const_iterator itr = childrenList.begin(); itr != childrenList.end(); ++itr)
{
go->UseDoorOrButton();
player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID());