diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/scripts/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/scripts/northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp | 155 | ||||
| -rw-r--r-- | src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.h | 16 |
3 files changed, 173 insertions, 0 deletions
diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 63d33be734d..53c14944838 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/pit_of_saron/instance_pit_of_saron.cpp + northrend/frozen_halls/pit_of_saron/pit_of_saron.h northrend/gundrak/instance_gundrak.cpp northrend/gundrak/boss_slad_ran.cpp northrend/gundrak/boss_moorabi.cpp 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 new file mode 100644 index 00000000000..55ee4b6cc3f --- /dev/null +++ b/src/scripts/northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp @@ -0,0 +1,155 @@ +#include "ScriptedPch.h" +#include "pit_of_saron.h" + +#define MAX_ENCOUNTER 3 + +/* Pit of Saron encounters: +0- Forgemaster Garfrost +1- Krick and Ick +2- Scourgelord Tyrannus +*/ + +struct instance_pit_of_saron : public ScriptedInstance +{ + instance_pit_of_saron(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 uiForgemaster; + uint64 uiKrick; + uint64 uiIck; + uint64 uiTyrannus; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + uiForgemaster = 0; + uiKrick = 0; + uiIck = 0; + uiTyrannus = 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_FORGEMASTER: + uiForgemaster = pCreature->GetGUID(); + break; + case CREATURE_KRICK: + uiKrick = pCreature->GetGUID(); + break; + case CREATURE_ICK: + uiIck = pCreature->GetGUID(); + break; + case CREATURE_TYRANNUS: + uiTyrannus = pCreature->GetGUID(); + break; + } + } +/* + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + } + } +*/ + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_FORGEMASTER_EVENT: + m_auiEncounter[0] = data; + break; + case DATA_KRICKANDICK_EVENT: + m_auiEncounter[1] = data; + break; + case DATA_TYRANNUS_EVENT: + m_auiEncounter[2] = data; + break; + } + + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_FORGEMASTER_EVENT: return m_auiEncounter[0]; + case DATA_KRICKANDICK_EVENT: return m_auiEncounter[1]; + case DATA_TYRANNUS_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 << "P S " << 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 == 'P' && dataHead2 == 'S') + { + 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_pit_of_saron(Map* pMap) +{ + return new instance_pit_of_saron(pMap); +} + +void AddSC_pit_of_saron() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_pit_of_saron"; + newscript->GetInstanceData = &GetInstanceData_instance_pit_of_saron; + newscript->RegisterSelf(); +} 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 new file mode 100644 index 00000000000..efcc8ebca73 --- /dev/null +++ b/src/scripts/northrend/frozen_halls/pit_of_saron/pit_of_saron.h @@ -0,0 +1,16 @@ +#ifndef DEF_FORGE_OF_SOULS_H +#define DEF_FORGE_OF_SOULS_H +enum Data +{ + DATA_FORGEMASTER_EVENT, + DATA_KRICKANDICK_EVENT, + DATA_TYRANNUS_EVENT +}; +enum Creatures +{ + CREATURE_FORGEMASTER = 36494, + CREATURE_KRICK = 36477, + CREATURE_ICK = 36476, + CREATURE_TYRANNUS = 36658 +}; +#endif |
