Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
instance_shattered_halls.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Instance_Shattered_Halls
8SD%Complete: 50
9SDComment: instance not complete
10SDCategory: Hellfire Citadel, Shattered Halls
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "InstanceScript.h"
15#include "shattered_halls.h"
16
18{
19 public:
20 instance_shattered_halls() : InstanceMapScript("instance_shattered_halls", 540) { }
21
26
28 {
30
38
40 {
41 switch (go->GetEntry())
42 {
44 nethekurseDoor1GUID = go->GetGUID();
45 break;
47 nethekurseDoor2GUID = go->GetGUID();
48 break;
49 }
50 }
51
53 {
54 switch (creature->GetEntry())
55 {
57 nethekurseGUID = creature->GetGUID();
58 break;
59 }
60 }
61
63 {
64 if (!InstanceScript::SetBossState(type, state))
65 return false;
66
67 switch (type)
68 {
69 case DATA_NETHEKURSE:
70 if (state == IN_PROGRESS)
71 {
74 }
75 else
76 {
79 }
80 break;
81 case DATA_OMROGG:
82 break;
83 }
84 return true;
85 }
86
88 {
89 switch (data)
90 {
92 return nethekurseGUID;
93 break;
96 break;
99 break;
100 }
101 return 0;
102 }
103
104 std::string GetSaveData() OVERRIDE
105 {
107
108 std::ostringstream saveStream;
109 saveStream << "S H " << GetBossSaveData();
110
112 return saveStream.str();
113 }
114
115 void Load(const char* strIn) OVERRIDE
116 {
117 if (!strIn)
118 {
120 return;
121 }
122
123 OUT_LOAD_INST_DATA(strIn);
124
125 char dataHead1, dataHead2;
126
127 std::istringstream loadStream(strIn);
128 loadStream >> dataHead1 >> dataHead2;
129
130 if (dataHead1 == 'S' && dataHead2 == 'H')
131 {
132 for (uint8 i = 0; i < EncounterCount; ++i)
133 {
134 uint32 tmpState;
135 loadStream >> tmpState;
136 if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
137 tmpState = NOT_STARTED;
138 SetBossState(i, EncounterState(tmpState));
139 }
140 }
141 else
143
145 }
146
147 protected:
151 };
152};
153
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
#define OUT_LOAD_INST_DATA_FAIL
EncounterState
@ IN_PROGRESS
@ SPECIAL
@ NOT_STARTED
#define OUT_SAVE_INST_DATA_COMPLETE
#define OUT_LOAD_INST_DATA_COMPLETE
#define OUT_SAVE_INST_DATA
#define OUT_LOAD_INST_DATA(a)
uint32 const EncounterCount
InstanceMapScript(const char *name, uint32 mapId)
InstanceScript(Map *map)
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
std::string GetBossSaveData()
void HandleGameObject(uint64 guid, bool open, GameObject *go=NULL)
Definition Map.h:238
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
void AddSC_instance_shattered_halls()
@ NPC_GRAND_WARLOCK_NETHEKURSE
@ GO_GRAND_WARLOCK_CHAMBER_DOOR_1
@ GO_GRAND_WARLOCK_CHAMBER_DOOR_2
@ DATA_OMROGG
@ DATA_NETHEKURSE