aboutsummaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/CMakeLists.txt3
-rw-r--r--src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp215
-rw-r--r--src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp80
-rw-r--r--src/scripts/kalimdor/razorfen_downs/razorfen_downs.h45
-rw-r--r--src/scripts/northrend/borean_tundra.cpp134
-rw-r--r--src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp6
-rw-r--r--src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp186
-rw-r--r--src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.h20
-rw-r--r--src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp21
-rw-r--r--src/scripts/northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h16
-rw-r--r--src/scripts/northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp16
-rw-r--r--src/scripts/northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp16
-rw-r--r--src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.h16
-rw-r--r--src/scripts/northrend/grizzly_hills.cpp252
-rw-r--r--src/scripts/world/go_scripts.cpp29
-rw-r--r--src/scripts/world/item_scripts.cpp75
16 files changed, 1128 insertions, 2 deletions
diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt
index 05007138ca7..a94f6daafa2 100644
--- a/src/scripts/CMakeLists.txt
+++ b/src/scripts/CMakeLists.txt
@@ -253,6 +253,8 @@ SET(scripts_STAT_SRCS
kalimdor/onyxias_lair/boss_onyxia.cpp
kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp
kalimdor/razorfen_downs/razorfen_downs.cpp
+ kalimdor/razorfen_downs/instance_razorfen_downs.cpp
+ kalimdor/razorfen_downs/razorfen_downs.h
kalimdor/razorfen_kraul/razorfen_kraul.h
kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp
kalimdor/razorfen_kraul/razorfen_kraul.cpp
@@ -327,6 +329,7 @@ SET(scripts_STAT_SRCS
northrend/draktharon_keep/boss_tharon_ja.cpp
northrend/draktharon_keep/drak_tharon_keep.h
northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp
+ northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp
northrend/frozen_halls/forge_of_souls/forge_of_souls.h
northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp
northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h
diff --git a/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp b/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp
new file mode 100644
index 00000000000..8ac8073e1f1
--- /dev/null
+++ b/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "ScriptedPch.h"
+#include "razorfen_downs.h"
+
+#define MAX_ENCOUNTER 1
+
+struct instance_razorfen_downs : public ScriptedInstance
+{
+ instance_razorfen_downs(Map* pMap) : ScriptedInstance(pMap)
+ {
+ Initialize();
+ };
+
+ uint64 uiGongGUID;
+
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
+
+ uint8 uiGongWaves;
+
+ std::string str_data;
+
+ void Initialize()
+ {
+ uiGongGUID = 0;
+
+ uiGongWaves = 0;
+
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ }
+
+ std::string GetSaveData()
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+
+ saveStream << "T C " << m_auiEncounter[0]
+ << " " << uiGongWaves;
+
+ str_data = saveStream.str();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return str_data;
+ }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+
+ char dataHead1, dataHead2;
+ uint16 data0, data1;
+
+ std::istringstream loadStream(in);
+ loadStream >> dataHead1 >> dataHead2 >> data0 >> data1;
+
+ if (dataHead1 == 'T' && dataHead2 == 'C')
+ {
+ m_auiEncounter[0] = data0;
+
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ m_auiEncounter[i] = NOT_STARTED;
+
+ uiGongWaves = data1;
+ } else OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+
+ void OnGameObjectCreate(GameObject* pGo, bool bAdd)
+ {
+ switch(pGo->GetEntry())
+ {
+ case GO_GONG:
+ uiGongGUID = pGo->GetGUID();
+ if (m_auiEncounter[0] == DONE)
+ pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void SetData(uint32 uiType, uint32 uiData)
+ {
+ if (uiType == DATA_GONG_WAVES)
+ {
+ uiGongWaves = uiData;
+
+ switch(uiGongWaves)
+ {
+ case 9:
+ case 14:
+ if (GameObject* pGo = instance->GetGameObject(uiGongGUID))
+ pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
+ break;
+ case 1:
+ case 10:
+ case 16:
+ {
+ GameObject* pGo = instance->GetGameObject(uiGongGUID);
+
+ if (!pGo)
+ return;
+
+ pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
+
+ uint32 uiCreature = 0;
+ uint8 uiSummonTimes = 0;
+
+ switch(uiGongWaves)
+ {
+ case 1:
+ uiCreature = CREATURE_TOMB_FIEND;
+ uiSummonTimes = 7;
+ break;
+ case 10:
+ uiCreature = CREATURE_TOMB_REAVER;
+ uiSummonTimes = 3;
+ break;
+ case 16:
+ uiCreature = CREATURE_TUTEN_KASH;
+ break;
+ default:
+ break;
+ }
+
+
+ if (Creature* pCreature = pGo->SummonCreature(uiCreature,2502.635,844.140,46.896,0.633))
+ {
+ if (uiGongWaves == 10 || uiGongWaves == 1)
+ {
+ for (uint8 i = 0; i < uiSummonTimes; ++i)
+ {
+ if (Creature* pSummon = pGo->SummonCreature(uiCreature,2502.635 + float(irand(-5,5)),844.140 + float(irand(-5,5)),46.896,0.633))
+ pSummon->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678);
+ }
+ }
+ pCreature->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ if (uiType == BOSS_TUTEN_KASH)
+ {
+ m_auiEncounter[0] = uiData;
+
+ if (uiData == DONE)
+ SaveToDB();
+ }
+ }
+
+ uint32 GetData(uint32 uiType)
+ {
+ switch(uiType)
+ {
+ case DATA_GONG_WAVES:
+ return uiGongWaves;
+ }
+
+ return 0;
+ }
+
+ uint64 GetData64(uint32 uiType)
+ {
+ switch(uiType)
+ {
+ case DATA_GONG: return uiGongGUID;
+ }
+
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_razorfen_downs(Map* pMap)
+{
+ return new instance_razorfen_downs(pMap);
+}
+
+void AddSC_instance_razorfen_downs()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->Name = "instance_razorfen_downs";
+ newscript->GetInstanceData = &GetInstanceData_instance_razorfen_downs;
+ newscript->RegisterSelf();
+}
diff --git a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
index 7160524ff65..d8ffb63a3a7 100644
--- a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
+++ b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
@@ -26,6 +26,7 @@ npc_henry_stern
EndContentData */
#include "ScriptedPch.h"
+#include "razorfen_downs.h"
/*###
# npc_henry_stern
@@ -73,6 +74,75 @@ bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32
return true;
}
+/*######
+## go_gong
+######*/
+
+bool GOHello_go_gong(Player* pPlayer, GameObject* pGO)
+{
+ //basic support, not blizzlike data is missing...
+ ScriptedInstance* pInstance = pGO->GetInstanceData();
+
+ if (pInstance)
+ {
+ pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1);
+ return true;
+ }
+
+ return false;
+}
+
+enum eTombCreature
+{
+ SPELL_WEB = 745
+};
+
+struct npc_tomb_creatureAI : public ScriptedAI
+{
+ npc_tomb_creatureAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ pInstance = pCreature->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 uiWebTimer;
+
+ void Reset()
+ {
+ uiWebTimer = urand(5000,8000);
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ //from acid
+ if (m_creature->GetEntry() == CREATURE_TOMB_REAVER)
+ {
+ if (uiWebTimer <= uiDiff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WEB);
+ uiWebTimer = urand(7000,16000);
+ } else uiWebTimer -= uiDiff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1);
+ }
+};
+
+CreatureAI* GetAI_npc_tomb_creature(Creature* pCreature)
+{
+ return new npc_tomb_creatureAI (pCreature);
+}
+
void AddSC_razorfen_downs()
{
Script* newscript;
@@ -82,4 +152,14 @@ void AddSC_razorfen_downs()
newscript->pGossipHello = &GossipHello_npc_henry_stern;
newscript->pGossipSelect = &GossipSelect_npc_henry_stern;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "go_gong";
+ newscript->pGOHello = &GOHello_go_gong;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_tomb_creature";
+ newscript->GetAI = &GetAI_npc_tomb_creature;
+ newscript->RegisterSelf();
}
diff --git a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h
new file mode 100644
index 00000000000..d1c95d3f305
--- /dev/null
+++ b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DEF_RAZORFEN_DOWNS_H
+#define DEF_RAZORFEN_DOWNS_H
+
+enum eData
+{
+ BOSS_TUTEN_KASH,
+ DATA_GONG_WAVES
+};
+
+enum eData64
+{
+ DATA_GONG
+};
+
+enum eGameObject
+{
+ GO_GONG = 148917
+};
+
+enum eCreature
+{
+ CREATURE_TOMB_FIEND = 7349,
+ CREATURE_TOMB_REAVER = 7351,
+ CREATURE_TUTEN_KASH = 7355
+};
+
+#endif
diff --git a/src/scripts/northrend/borean_tundra.cpp b/src/scripts/northrend/borean_tundra.cpp
index 0fb147d9d0b..6396b58c1ac 100644
--- a/src/scripts/northrend/borean_tundra.cpp
+++ b/src/scripts/northrend/borean_tundra.cpp
@@ -1987,6 +1987,135 @@ CreatureAI* GetAI_npc_bonker_togglevolt(Creature* pCreature)
return new npc_bonker_togglevoltAI(pCreature);
}
+/*######
+## Help Those That Cannot Help Themselves, Quest 11876
+######*/
+
+enum eHelpThemselves
+{
+ QUEST_CANNOT_HELP_THEMSELVES = 11876,
+ GO_MAMMOTH_TRAP_1 = 188022,
+ GO_MAMMOTH_TRAP_2 = 188024,
+ GO_MAMMOTH_TRAP_3 = 188025,
+ GO_MAMMOTH_TRAP_4 = 188026,
+ GO_MAMMOTH_TRAP_5 = 188027,
+ GO_MAMMOTH_TRAP_6 = 188028,
+ GO_MAMMOTH_TRAP_7 = 188029,
+ GO_MAMMOTH_TRAP_8 = 188030,
+ GO_MAMMOTH_TRAP_9 = 188031,
+ GO_MAMMOTH_TRAP_10 = 188032,
+ GO_MAMMOTH_TRAP_11 = 188033,
+ GO_MAMMOTH_TRAP_12 = 188034,
+ GO_MAMMOTH_TRAP_13 = 188035,
+ GO_MAMMOTH_TRAP_14 = 188036,
+ GO_MAMMOTH_TRAP_15 = 188037,
+ GO_MAMMOTH_TRAP_16 = 188038,
+ GO_MAMMOTH_TRAP_17 = 188039,
+ GO_MAMMOTH_TRAP_18 = 188040,
+ GO_MAMMOTH_TRAP_19 = 188041,
+ GO_MAMMOTH_TRAP_20 = 188042,
+ GO_MAMMOTH_TRAP_21 = 188043,
+ GO_MAMMOTH_TRAP_22 = 188044,
+};
+
+struct npc_trapped_mammoth_calfAI : public ScriptedAI
+{
+ npc_trapped_mammoth_calfAI(Creature* c) : ScriptedAI(c) {}
+
+ uint32 uiTimer;
+ bool bStarted;
+
+ void Reset()
+ {
+ GameObject *pTrap;
+
+ uiTimer = 1500;
+ bStarted = false;
+
+ if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,1.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,1.0f)))
+ pTrap->SetGoState(GO_STATE_ACTIVE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (bStarted)
+ {
+ if (uiTimer <= diff)
+ {
+ Position pos;
+ m_creature->GetRandomNearPosition(pos, 10.0f);
+ m_creature->GetMotionMaster()->MovePoint(0,pos);
+ bStarted = false;
+ }
+ else uiTimer -= diff;
+ }
+ }
+
+ void DoAction(const int32 param)
+ {
+ if (param == 1)
+ bStarted = true;
+ }
+
+ void MovementInform(uint32 uiType, uint32 uiId)
+ {
+ GameObject* pTrap;
+ if (uiType != POINT_MOTION_TYPE)
+ return;
+ m_creature->DisappearAndDie();
+
+ if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,11.0f)) ||
+ (pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,11.0f)))
+ pTrap->SetLootState(GO_JUST_DEACTIVATED);
+ }
+};
+
+CreatureAI* GetAI_npc_trapped_mammoth_calf(Creature* pCreature)
+{
+ return new npc_trapped_mammoth_calfAI(pCreature);
+}
+
void AddSC_borean_tundra()
{
Script *newscript;
@@ -2122,4 +2251,9 @@ void AddSC_borean_tundra()
newscript->GetAI = &GetAI_npc_bonker_togglevolt;
newscript->pQuestAccept=&QuestAccept_npc_bonker_togglevolt;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_trapped_mammoth_calf";
+ newscript->GetAI = &GetAI_npc_trapped_mammoth_calf;
+ newscript->RegisterSelf();
}
diff --git a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp
index 9d745c8775a..6fc53263ed1 100644
--- a/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp
+++ b/src/scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp
@@ -261,6 +261,12 @@ struct generic_vehicleAI_toc5AI : public npc_escortAI
//dosen't work at all
if (uiShieldBreakerTimer <= uiDiff)
{
+ if (!pVehicle)
+ {
+ pVehicle = m_creature->GetVehicleKit();
+ return;
+ }
+
if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0))
{
Map::PlayerList const& players = m_creature->GetMap()->GetPlayers();
diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp
new file mode 100644
index 00000000000..fe515516a68
--- /dev/null
+++ b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp
@@ -0,0 +1,186 @@
+/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "ScriptedPch.h"
+#include "forge_of_souls.h"
+
+enum Spells
+{
+ SPELL_MAGIC_S_BANE = 68793,
+ SPELL_MAGIC_S_BANE_H = 69050,
+ SPELL_CORRUPT_SOUL = 68839,
+ SPELL_CONSUME_SOUL = 68858,
+ SPELL_CONSUME_SOUL_H = 69047,
+ SPELL_TELEPORT = 68988,
+ SPELL_FEAR = 68950,
+ SPELL_SOULSTORM = 68872,
+ SPELL_SOULSTORM_H = 69049,
+ SPELL_SHADOW_BOLT = 70043
+};
+enum CombatPhases
+{
+ PHASE_1,
+ PHASE_2
+};
+/*enum Adds
+{
+ CREATURE_CORRUPTED_SOUL_FRAGMENT = 36535
+};*/
+struct boss_bronjahmAI : public ScriptedAI
+{
+ boss_bronjahmAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = m_creature->GetInstanceData();
+ }
+
+ uint32 uiFearTimer;
+ uint32 uiShadowBoltTimer;
+ uint32 uiMagicsBaneTimer;
+ uint32 uiCorruptSoulTimer;
+
+ CombatPhases Phase;
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ Phase = PHASE_1;
+
+ uiFearTimer = urand(8000,12000);
+ uiShadowBoltTimer = 2000;
+ uiMagicsBaneTimer = urand(8000,15000);
+ uiCorruptSoulTimer = urand(15000,25000);
+
+ if (pInstance)
+ pInstance->SetData(DATA_BRONJAHM_EVENT, NOT_STARTED);
+ }
+
+ void EnterCombat(Unit* who)
+ {
+ //DoScriptText(SAY_AGGRO, m_creature);
+
+ if (pInstance)
+ pInstance->SetData(DATA_BRONJAHM_EVENT, IN_PROGRESS);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ //DoScriptText(SAY_DEATH, m_creature);
+
+ if (pInstance)
+ pInstance->SetData(DATA_BRONJAHM_EVENT, DONE);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //Return since we have no target
+ if (!UpdateVictim())
+ return;
+
+ switch (Phase)
+ {
+ case PHASE_1:
+ if (uiCorruptSoulTimer <= diff)
+ {
+ if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
+ DoCast(pTarget,SPELL_CORRUPT_SOUL);
+ uiCorruptSoulTimer = urand(15000,25000);
+ } else uiCorruptSoulTimer -= diff;
+ break;
+ case PHASE_2:
+ if (!me->HasAura(SPELL_SOULSTORM) || !me->HasAura(SPELL_SOULSTORM_H))
+ DoCast(m_creature, DUNGEON_MODE(SPELL_SOULSTORM,SPELL_SOULSTORM_H));
+ if (uiFearTimer <= diff)
+ {
+ if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
+ DoCast(m_creature->getVictim(),SPELL_FEAR);
+ uiFearTimer = urand(8000,12000);
+ } else uiFearTimer -= diff;
+ break;
+ }
+
+ if (HealthBelowPct(30))
+ DoCast(m_creature,SPELL_TELEPORT);
+
+ if (uiShadowBoltTimer <= diff)
+ {
+ if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
+ DoCastVictim(SPELL_SHADOW_BOLT);
+ uiShadowBoltTimer = 2000;
+ } else uiShadowBoltTimer -= diff;
+
+ if (uiMagicsBaneTimer <= diff)
+ {
+ DoCastVictim(DUNGEON_MODE(SPELL_MAGIC_S_BANE,SPELL_MAGIC_S_BANE_H));
+ uiMagicsBaneTimer = urand(8000,15000);
+ } else uiMagicsBaneTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_boss_bronjahm(Creature* pCreature)
+{
+ return new boss_bronjahmAI(pCreature);
+}
+
+struct mob_corrupted_soul_fragmentAI : public ScriptedAI
+{
+ mob_corrupted_soul_fragmentAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = m_creature->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
+
+ void Reset()
+ {
+ SetCombatMovement(false);
+ if (pInstance)
+ if (Creature* pBronjham = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_BRONJAHM)))
+ m_creature->GetMotionMaster()->MoveChase(pBronjham);
+
+ }
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if (pInstance)
+ if (Creature* pBronjham = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_BRONJAHM)))
+ DoCast(pBronjham,DUNGEON_MODE(SPELL_CONSUME_SOUL,SPELL_CONSUME_SOUL_H));
+ }
+
+ void UpdateAI(const uint32 diff) {}
+};
+
+CreatureAI* GetAI_mob_corrupted_soul_fragment(Creature* pCreature)
+{
+ return new mob_corrupted_soul_fragmentAI(pCreature);
+}
+
+void AddSC_boss_bronjahm()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "mob_corruptel_soul_fragment";
+ newscript->GetAI = &GetAI_mob_corrupted_soul_fragment;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "boss_bronjahm";
+ newscript->GetAI = &GetAI_boss_bronjahm;
+ newscript->RegisterSelf();
+} \ No newline at end of file
diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.h b/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.h
index d50716c9e39..6f7a3987cee 100644
--- a/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.h
+++ b/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.h
@@ -1,3 +1,19 @@
+/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#ifndef DEF_FORGE_OF_SOULS_H
#define DEF_FORGE_OF_SOULS_H
enum Data
@@ -5,6 +21,10 @@ enum Data
DATA_BRONJAHM_EVENT,
DATA_DEVOURER_EVENT
};
+enum Data64
+{
+ DATA_BRONJAHM
+};
enum Creatures
{
CREATURE_BRONJAHM = 36497,
diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp
index 2ac41f59c8f..2f038e178ca 100644
--- a/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp
+++ b/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp
@@ -1,3 +1,19 @@
+/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include "ScriptedPch.h"
#include "forge_of_souls.h"
@@ -72,16 +88,17 @@ struct instance_forge_of_souls : public ScriptedInstance
return 0;
}
-/*
+
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
+ case DATA_BRONJAHM: return uiBronjahm;
}
return 0;
}
-*/
+
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
diff --git a/src/scripts/northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h b/src/scripts/northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h
index 8241c6bb608..ac7ddc09b6d 100644
--- a/src/scripts/northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h
+++ b/src/scripts/northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h
@@ -1,3 +1,19 @@
+/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#ifndef DEF_HALLS_OF_REFLECTION_H
#define DEF_HALLS_OF_REFLECTION_H
enum Data
diff --git a/src/scripts/northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp b/src/scripts/northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp
index 45bd4cb7514..5caf2351843 100644
--- a/src/scripts/northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp
+++ b/src/scripts/northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp
@@ -1,3 +1,19 @@
+/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include "ScriptedPch.h"
#include "halls_of_reflection.h"
diff --git a/src/scripts/northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp b/src/scripts/northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp
index 55ee4b6cc3f..908eaf8f669 100644
--- a/src/scripts/northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp
+++ b/src/scripts/northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp
@@ -1,3 +1,19 @@
+/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#include "ScriptedPch.h"
#include "pit_of_saron.h"
diff --git a/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.h b/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.h
index 7d61b30ac07..97a9ff7d8f0 100644
--- a/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.h
+++ b/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.h
@@ -1,3 +1,19 @@
+/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
#ifndef DEF_PIT_OF_SARON_H
#define DEF_PIT_OF_SARON_H
enum Data
diff --git a/src/scripts/northrend/grizzly_hills.cpp b/src/scripts/northrend/grizzly_hills.cpp
index ca1301fe287..b057faf7e5f 100644
--- a/src/scripts/northrend/grizzly_hills.cpp
+++ b/src/scripts/northrend/grizzly_hills.cpp
@@ -26,6 +26,7 @@ npc_orsonn_and_kodian
EndContentData */
#include "ScriptedPch.h"
+#include "ScriptedEscortAI.h"
#define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg."
#define GOSSIP_ITEM2 "What happened then?"
@@ -115,6 +116,246 @@ bool GossipSelect_npc_orsonn_and_kodian(Player* pPlayer, Creature* pCreature, ui
return true;
}
+/*######
+## Quest 12027: Mr. Floppy's Perilous Adventure
+######*/
+
+enum eFloppy
+{
+ NPC_MRFLOPPY = 26589,
+ NPC_HUNGRY_WORG = 26586,
+ NPC_RAVENOUS_WORG = 26590, //RWORG
+ NPC_EMILY = 26588,
+
+ QUEST_PERILOUS_ADVENTURE = 12027,
+
+ SPELL_MRFLOPPY = 47184, //vehicle aura
+
+ SAY_WORGHAGGRO1 = -1800001, //Um... I think one of those wolves is back...
+ SAY_WORGHAGGRO2 = -1800002, //He's going for Mr. Floppy!
+ SAY_WORGRAGGRO3 = -1800003, //Oh, no! Look, it's another wolf, and it's a biiiiiig one!
+ SAY_WORGRAGGRO4 = -1800004, //He's gonna eat Mr. Floppy! You gotta help Mr. Floppy! You just gotta!
+ SAY_RANDOMAGGRO = -1800005, //There's a big meanie attacking Mr. Floppy! Help!
+ SAY_VICTORY1 = -1800006, //Let's get out of here before more wolves find us!
+ SAY_VICTORY2 = -1800007, //Don't go toward the light, Mr. Floppy!
+ SAY_VICTORY3 = -1800008, //Mr. Floppy, you're ok! Thank you so much for saving Mr. Floppy!
+ SAY_VICTORY4 = -1800009, //I think I see the camp! We're almost home, Mr. Floppy! Let's go!
+ TEXT_EMOTE_WP1 = -1800010, //Mr. Floppy revives
+ TEXT_EMOTE_AGGRO = -1800011, //The Ravenous Worg chomps down on Mr. Floppy
+ SAY_QUEST_ACCEPT = -1800012, //Are you ready, Mr. Floppy? Stay close to me and watch out for those wolves!
+ SAY_QUEST_COMPLETE = -1800013 //Thank you for helping me get back to the camp. Go tell Walter that I'm safe now!
+};
+
+//emily
+struct npc_emilyAI : public npc_escortAI
+{
+ npc_emilyAI(Creature* pCreature) : npc_escortAI(pCreature) { }
+
+ uint32 m_uiChatTimer;
+
+ uint64 RWORGGUID;
+ uint64 MrfloppyGUID;
+
+ Creature* Mrfloppy;
+ Creature* RWORG;
+ bool Completed;
+
+
+ void JustSummoned(Creature* pSummoned)
+ {
+ if (Creature* Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 50.0f))
+ pSummoned->AI()->AttackStart(Mrfloppy);
+ else
+ pSummoned->AI()->AttackStart(m_creature->getVictim());
+ }
+
+ void WaypointReached(uint32 i)
+ {
+ Player* pPlayer = GetPlayerForEscort();
+ if (!pPlayer)
+ return;
+ switch (i)
+ {
+ case 9:
+ Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 100.0f);
+ break;
+ case 10:
+ if (Mrfloppy)
+ {
+ DoScriptText(SAY_WORGHAGGRO1, m_creature);
+ m_creature->SummonCreature(NPC_HUNGRY_WORG,m_creature->GetPositionX()+5,m_creature->GetPositionY()+2,m_creature->GetPositionZ()+1,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
+ }
+ break;
+ case 11:
+ Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ break;
+ case 17:
+ Mrfloppy->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
+ DoScriptText(SAY_WORGRAGGRO3, m_creature);
+ RWORG = m_creature->SummonCreature(NPC_RAVENOUS_WORG,m_creature->GetPositionX()+10,m_creature->GetPositionY()+8,m_creature->GetPositionZ()+2,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
+ RWORG->setFaction(35);
+ break;
+ case 18:
+ if (Mrfloppy)
+ {
+ RWORG->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
+ DoCast(Mrfloppy,SPELL_MRFLOPPY);
+ }
+ break;
+ case 19:
+ if (Mrfloppy->HasAura(SPELL_MRFLOPPY, 0))
+ Mrfloppy->EnterVehicle(RWORG);
+ break;
+ case 20:
+ if (Mrfloppy)
+ RWORG->HandleEmoteCommand(34);
+ break;
+ case 21:
+ if (Mrfloppy)
+ {
+ RWORG->Kill(Mrfloppy);
+ Mrfloppy->ExitVehicle();
+ RWORG->setFaction(14);
+ RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10,RWORG->GetPositionY()+80,RWORG->GetPositionZ());
+ DoScriptText(SAY_VICTORY2, m_creature);
+ }
+ break;
+ case 22:
+ if (Mrfloppy && Mrfloppy->isDead())
+ {
+ RWORG->DisappearAndDie();
+ m_creature->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
+ Mrfloppy->setDeathState(ALIVE);
+ Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ DoScriptText(SAY_VICTORY3, m_creature);
+ }
+ break;
+ case 24:
+ if (pPlayer)
+ {
+ Completed = true;
+ pPlayer->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, m_creature);
+ DoScriptText(SAY_QUEST_COMPLETE, m_creature, pPlayer);
+ }
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ break;
+ case 25:
+ DoScriptText(SAY_VICTORY4, m_creature);
+ break;
+ case 27:
+ m_creature->DisappearAndDie();
+ if (Mrfloppy)
+ Mrfloppy->DisappearAndDie();
+ break;
+ }
+ }
+
+ void EnterCombat(Unit* Who)
+ {
+ DoScriptText(SAY_RANDOMAGGRO, m_creature);
+ }
+
+ void Reset()
+ {
+ m_uiChatTimer = 4000;
+ Mrfloppy = NULL;
+ RWORG = NULL;
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ npc_escortAI::UpdateAI(uiDiff);
+
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ {
+ if (m_uiChatTimer <= uiDiff)
+ {
+ m_uiChatTimer = 12000;
+ }
+ else
+ m_uiChatTimer -= uiDiff;
+ }
+ }
+};
+
+
+bool QuestAccept_npc_emily(Player* pPlayer, Creature* pCreature, Quest const* quest)
+{
+ if (quest->GetQuestId() == QUEST_PERILOUS_ADVENTURE)
+ {
+ DoScriptText(SAY_QUEST_ACCEPT, pCreature);
+ if (Creature* Mrfloppy = GetClosestCreatureWithEntry(pCreature, NPC_MRFLOPPY, 180.0f))
+ {
+ Mrfloppy->GetMotionMaster()->MoveFollow(pCreature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ }
+
+ if (npc_escortAI* pEscortAI = CAST_AI(npc_emilyAI, (pCreature->AI())))
+ pEscortAI->Start(true, false, pPlayer->GetGUID());
+ }
+ return true;
+}
+
+CreatureAI* GetAI_npc_emily(Creature* pCreature)
+{
+ return new npc_emilyAI(pCreature);
+}
+
+//mrfloppy
+
+struct npc_mrfloppyAI : public ScriptedAI
+{
+ npc_mrfloppyAI(Creature *c) : ScriptedAI(c) {}
+
+ uint64 EmilyGUID;
+ uint64 RWORGGUID;
+ uint64 HWORGGUID;
+
+ Creature* HWORG;
+ Creature* RWORG;
+
+ Creature* Emily;
+
+ void Reset()
+ {
+ HWORG = NULL;
+ RWORG = NULL;
+ Emily = NULL;
+ }
+
+ void EnterCombat(Unit* Who)
+ {
+ if (Creature* Emily = GetClosestCreatureWithEntry(m_creature, NPC_EMILY, 50.0f))
+ {
+ switch(Who->GetEntry())
+ {
+ case NPC_HUNGRY_WORG:
+ DoScriptText(SAY_WORGHAGGRO2, Emily);
+ break;
+ case NPC_RAVENOUS_WORG:
+ DoScriptText(SAY_WORGRAGGRO4, Emily);
+ break;
+ default:
+ DoScriptText(SAY_RANDOMAGGRO, Emily);
+ }
+ }
+ }
+
+ void EnterEvadeMode() {}
+
+ void MoveInLineOfSight(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+ }
+};
+
+CreatureAI* GetAI_npc_mrfloppy(Creature* pCreature)
+{
+ return new npc_mrfloppyAI(pCreature);
+}
+
void AddSC_grizzly_hills()
{
Script* newscript;
@@ -124,4 +365,15 @@ void AddSC_grizzly_hills()
newscript->pGossipHello = &GossipHello_npc_orsonn_and_kodian;
newscript->pGossipSelect = &GossipSelect_npc_orsonn_and_kodian;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_emily";
+ newscript->GetAI = &GetAI_npc_emily;
+ newscript->pQuestAccept = &QuestAccept_npc_emily;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_mrfloppy";
+ newscript->GetAI = &GetAI_npc_mrfloppy;
+ newscript->RegisterSelf();
}
diff --git a/src/scripts/world/go_scripts.cpp b/src/scripts/world/go_scripts.cpp
index cd71124c4f5..ee75698ddf6 100644
--- a/src/scripts/world/go_scripts.cpp
+++ b/src/scripts/world/go_scripts.cpp
@@ -736,6 +736,30 @@ bool GOHello_go_soulwell(Player *pPlayer, GameObject* pGO)
return true;
}
+/*######
+## Quest 11560: Oh Noes, the Tadpoles!
+## go_tadpole_cage
+######*/
+
+enum eTadpoles
+{
+ QUEST_OH_NOES_THE_TADPOLES = 11560,
+ NPC_WINTERFIN_TADPOLE = 25201
+};
+
+bool GOHello_go_tadpole_cage(Player *pPlayer, GameObject *pGO)
+{
+ Creature *pTadpole;
+ if (pPlayer->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE &&
+ (pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE,1.0f)))
+ {
+ pGO->UseDoorOrButton();
+ pTadpole->DisappearAndDie();
+ pPlayer->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE,0);
+ //FIX: Summon minion tadpole
+ }
+ return true;
+}
void AddSC_go_scripts()
{
@@ -891,4 +915,9 @@ void AddSC_go_scripts()
newscript->Name = "go_soulwell";
newscript->pGOHello = &GOHello_go_soulwell;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "go_tadpole_cage";
+ newscript->pGOHello = &GOHello_go_tadpole_cage;
+ newscript->RegisterSelf();
}
diff --git a/src/scripts/world/item_scripts.cpp b/src/scripts/world/item_scripts.cpp
index 658ee379fdf..6787e8df303 100644
--- a/src/scripts/world/item_scripts.cpp
+++ b/src/scripts/world/item_scripts.cpp
@@ -316,6 +316,76 @@ bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const Spell
return false;
}
+/*######
+# item_dehta_trap_smasher
+# For quest 11876, Help Those That Cannot Help Themselves
+######*/
+enum eHelpThemselves
+{
+ QUEST_CANNOT_HELP_THEMSELVES = 11876,
+ NPC_TRAPPED_MAMMOTH_CALF = 25850,
+ GO_MAMMOTH_TRAP_1 = 188022,
+ GO_MAMMOTH_TRAP_2 = 188024,
+ GO_MAMMOTH_TRAP_3 = 188025,
+ GO_MAMMOTH_TRAP_4 = 188026,
+ GO_MAMMOTH_TRAP_5 = 188027,
+ GO_MAMMOTH_TRAP_6 = 188028,
+ GO_MAMMOTH_TRAP_7 = 188029,
+ GO_MAMMOTH_TRAP_8 = 188030,
+ GO_MAMMOTH_TRAP_9 = 188031,
+ GO_MAMMOTH_TRAP_10 = 188032,
+ GO_MAMMOTH_TRAP_11 = 188033,
+ GO_MAMMOTH_TRAP_12 = 188034,
+ GO_MAMMOTH_TRAP_13 = 188035,
+ GO_MAMMOTH_TRAP_14 = 188036,
+ GO_MAMMOTH_TRAP_15 = 188037,
+ GO_MAMMOTH_TRAP_16 = 188038,
+ GO_MAMMOTH_TRAP_17 = 188039,
+ GO_MAMMOTH_TRAP_18 = 188040,
+ GO_MAMMOTH_TRAP_19 = 188041,
+ GO_MAMMOTH_TRAP_20 = 188042,
+ GO_MAMMOTH_TRAP_21 = 188043,
+ GO_MAMMOTH_TRAP_22 = 188044,
+};
+
+bool ItemUse_item_dehta_trap_smasher(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets)
+{
+ Creature* pMammoth;
+ GameObject* pTrap;
+
+ if (pPlayer->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) == QUEST_STATUS_INCOMPLETE &&
+ (pMammoth = pPlayer->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF,5.0f)) &&
+ ((pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_1,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_2,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_3,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_4,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_5,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_6,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_7,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_8,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_9,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_10,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_11,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_12,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_13,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_14,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_15,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_16,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_17,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_18,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_19,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_20,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_21,5.0f)) ||
+ (pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_22,5.0f))))
+ {
+ pMammoth->AI()->DoAction(1);
+ pTrap->SetGoState(GO_STATE_READY);
+ pPlayer->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF,0);
+ }
+
+ return false;
+}
+
void AddSC_item_scripts()
{
Script *newscript;
@@ -374,4 +444,9 @@ void AddSC_item_scripts()
newscript->Name = "item_petrov_cluster_bombs";
newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "item_dehta_trap_smasher";
+ newscript->pItemUse = &ItemUse_item_dehta_trap_smasher;
+ newscript->RegisterSelf();
}