aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiscover- <amort11@hotmail.com>2011-12-25 00:13:28 +0100
committerDiscover- <amort11@hotmail.com>2011-12-25 00:13:28 +0100
commitef4608f07c8596c2436604e18d49ba8891af3191 (patch)
treec83db518366b559d6b5a9e705c52ed3e465cdec4 /src
parent0d98ecc6c17c5d9b9608c39ffff0d46dd2114690 (diff)
Core/Quests: Fix an exploit in Red Snapper - Very Tasty!
Also fix a silly codestyle typo in previous commit. Closes #3887
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp49
-rw-r--r--src/server/scripts/World/go_scripts.cpp6
2 files changed, 52 insertions, 3 deletions
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();
}
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 4799b893286..fad92ec1af5 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -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());