aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scripts/CMakeLists.txt2
-rw-r--r--src/scripts/northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h15
-rw-r--r--src/scripts/northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp150
3 files changed, 167 insertions, 0 deletions
diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt
index 53c14944838..05007138ca7 100644
--- a/src/scripts/CMakeLists.txt
+++ b/src/scripts/CMakeLists.txt
@@ -328,6 +328,8 @@ SET(scripts_STAT_SRCS
northrend/draktharon_keep/drak_tharon_keep.h
northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.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
northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp
northrend/frozen_halls/pit_of_saron/pit_of_saron.h
northrend/gundrak/instance_gundrak.cpp
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
new file mode 100644
index 00000000000..8241c6bb608
--- /dev/null
+++ b/src/scripts/northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h
@@ -0,0 +1,15 @@
+#ifndef DEF_HALLS_OF_REFLECTION_H
+#define DEF_HALLS_OF_REFLECTION_H
+enum Data
+{
+ DATA_FALRIC_EVENT,
+ DATA_MARWYN_EVENT,
+ DATA_LICHKING_EVENT
+};
+enum Creatures
+{
+ CREATURE_FALRIC = 36494,
+ CREATURE_MARWYN = 36476,
+ CREATURE_LICHKING = 36658
+};
+#endif
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
new file mode 100644
index 00000000000..45bd4cb7514
--- /dev/null
+++ b/src/scripts/northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp
@@ -0,0 +1,150 @@
+#include "ScriptedPch.h"
+#include "halls_of_reflection.h"
+
+#define MAX_ENCOUNTER 3
+
+/* Halls of Reflection encounters:
+0- Falric
+1- Marwyn
+2- The Lich King
+*/
+
+struct instance_halls_of_reflection : public ScriptedInstance
+{
+ instance_halls_of_reflection(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+
+ uint64 uiFalric;
+ uint64 uiMarwyn;
+ uint64 uiLichKing;
+
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
+
+ void Initialize()
+ {
+ uiFalric = 0;
+ uiMarwyn = 0;
+ uiLichKing = 0;
+
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ m_auiEncounter[i] = NOT_STARTED;
+ }
+
+ void OnCreatureCreate(Creature* pCreature, bool add)
+ {
+ switch(pCreature->GetEntry())
+ {
+ case CREATURE_FALRIC:
+ uiFalric = pCreature->GetGUID();
+ break;
+ case CREATURE_MARWYN:
+ uiMarwyn = pCreature->GetGUID();
+ break;
+ case CREATURE_LICHKING:
+ uiLichKing = pCreature->GetGUID();
+ break;
+ }
+ }
+/*
+ void OnGameObjectCreate(GameObject* pGo, bool add)
+ {
+ switch(pGo->GetEntry())
+ {
+ }
+ }
+*/
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case DATA_FALRIC_EVENT:
+ m_auiEncounter[0] = data;
+ break;
+ case DATA_MARWYN_EVENT:
+ m_auiEncounter[1] = data;
+ break;
+ case DATA_LICHKING_EVENT:
+ m_auiEncounter[2] = data;
+ break;
+ }
+
+ if (data == DONE)
+ SaveToDB();
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case DATA_FALRIC_EVENT: return m_auiEncounter[0];
+ case DATA_MARWYN_EVENT: return m_auiEncounter[1];
+ case DATA_LICHKING_EVENT: return m_auiEncounter[2];
+ }
+
+ return 0;
+ }
+/*
+ uint64 GetData64(uint32 identifier)
+ {
+ switch(identifier)
+ {
+ }
+
+ return 0;
+ }
+*/
+ std::string GetSaveData()
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+ saveStream << "H R " << m_auiEncounter[0] << " " << m_auiEncounter[1] << m_auiEncounter[2];
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return saveStream.str();
+ }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+
+ char dataHead1, dataHead2;
+ uint16 data0, data1, data2;
+
+ std::istringstream loadStream(in);
+ loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2;
+
+ if (dataHead1 == 'H' && dataHead2 == 'R')
+ {
+ m_auiEncounter[0] = data0;
+ m_auiEncounter[1] = data1;
+ m_auiEncounter[2] = data2;
+
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ m_auiEncounter[i] = NOT_STARTED;
+
+ } else OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+};
+
+InstanceData* GetInstanceData_instance_halls_of_reflection(Map* pMap)
+{
+ return new instance_halls_of_reflection(pMap);
+}
+
+void AddSC_halls_of_reflection()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_halls_of_reflection";
+ newscript->GetInstanceData = &GetInstanceData_instance_halls_of_reflection;
+ newscript->RegisterSelf();
+}