mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
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:
@@ -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');
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user