TrinityCore
instance_sunken_temple.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: Instance_Sunken_Temple
20SD%Complete: 100
21SDComment:Place Holder
22SDCategory: Sunken Temple
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "GameObject.h"
27#include "InstanceScript.h"
28#include "Map.h"
29#include "Unit.h"
30#include "sunken_temple.h"
31
33{
42 GO_ATALAI_LIGHT2 = 148937
43
44};
45
47{
49};
50
52{
53 { BOSS_AVATAR_OF_HAKKAR, { { 492 } } },
54 { BOSS_JAMMALAN_THE_PROPHET, { { 488 } } },
55 { BOSS_DREAMSCYTHE, { { 486 } } },
56 { BOSS_WEAVER, { { 487 } } },
57 { BOSS_MORPHAZ, { { 490 } } },
58 { BOSS_HAZZAS, { { 491 } } },
59 { BOSS_SHADE_OF_ERANIKUS, { { 493 } } },
60};
61
63{
64public:
66
68 {
70 }
71
73 {
75 {
79 State = 0;
80
81 s1 = false;
82 s2 = false;
83 s3 = false;
84 s4 = false;
85 s5 = false;
86 s6 = false;
87 }
88
96
98
99 bool s1;
100 bool s2;
101 bool s3;
102 bool s4;
103 bool s5;
104 bool s6;
105
106 void OnUnitDeath(Unit* unit) override
107 {
108 switch (unit->GetEntry())
109 {
117 default: break;
118 }
119 }
120
122 {
123 switch (go->GetEntry())
124 {
125 case GO_ATALAI_STATUE1: GOAtalaiStatue1 = go->GetGUID(); break;
126 case GO_ATALAI_STATUE2: GOAtalaiStatue2 = go->GetGUID(); break;
127 case GO_ATALAI_STATUE3: GOAtalaiStatue3 = go->GetGUID(); break;
128 case GO_ATALAI_STATUE4: GOAtalaiStatue4 = go->GetGUID(); break;
129 case GO_ATALAI_STATUE5: GOAtalaiStatue5 = go->GetGUID(); break;
130 case GO_ATALAI_STATUE6: GOAtalaiStatue6 = go->GetGUID(); break;
131 case GO_ATALAI_IDOL: GOAtalaiIdol = go->GetGUID(); break;
132 }
133 }
134
135 virtual void Update(uint32 /*diff*/) override // correct order goes form 1-6
136 {
137 switch (State)
138 {
140 if (!s1 && !s2 && !s3 && !s4 && !s5 && !s6)
141 {
142 if (GameObject* pAtalaiStatue1 = instance->GetGameObject(GOAtalaiStatue1))
143 UseStatue(pAtalaiStatue1);
144 s1 = true;
145 State = 0;
146 };
147 break;
149 if (s1 && !s2 && !s3 && !s4 && !s5 && !s6)
150 {
151 if (GameObject* pAtalaiStatue2 = instance->GetGameObject(GOAtalaiStatue2))
152 UseStatue(pAtalaiStatue2);
153 s2 = true;
154 State = 0;
155 };
156 break;
158 if (s1 && s2 && !s3 && !s4 && !s5 && !s6)
159 {
160 if (GameObject* pAtalaiStatue3 = instance->GetGameObject(GOAtalaiStatue3))
161 UseStatue(pAtalaiStatue3);
162 s3 = true;
163 State = 0;
164 };
165 break;
167 if (s1 && s2 && s3 && !s4 && !s5 && !s6)
168 {
169 if (GameObject* pAtalaiStatue4 = instance->GetGameObject(GOAtalaiStatue4))
170 UseStatue(pAtalaiStatue4);
171 s4 = true;
172 State = 0;
173 }
174 break;
176 if (s1 && s2 && s3 && s4 && !s5 && !s6)
177 {
178 if (GameObject* pAtalaiStatue5 = instance->GetGameObject(GOAtalaiStatue5))
179 UseStatue(pAtalaiStatue5);
180 s5 = true;
181 State = 0;
182 }
183 break;
185 if (s1 && s2 && s3 && s4 && s5 && !s6)
186 {
187 if (GameObject* pAtalaiStatue6 = instance->GetGameObject(GOAtalaiStatue6))
188 UseStatue(pAtalaiStatue6);
189 s6 = true;
190 State = 0;
191 }
192 break;
193 }
194 };
195
197 {
200 }
201
202 /*
203 void UseLastStatue(GameObject* go)
204 {
205 for (uint8 i = 0; i < nStatues; ++i)
206 go->SummonGameObject(GO_ATALAI_LIGHT2, statuePositions[i], QuaternionData(), 0s);
207
208 go->SummonCreature(NPC_ATALALARION, atalalarianPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10min);
209 }
210 */
211
212 void SetData(uint32 type, uint32 data) override
213 {
214 if (type == EVENT_STATE)
215 State = data;
216 }
217
218 uint32 GetData(uint32 type) const override
219 {
220 if (type == EVENT_STATE)
221 return State;
222 return 0;
223 }
224 };
225
226};
227
229{
231}
uint32_t uint32
Definition: Define.h:142
@ DONE
@ GO_FLAG_INTERACT_COND
#define DataHeader
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:274
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
void SetHeaders(std::string const &dataHeaders)
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3489
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
Definition: Unit.h:627
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2065
InstanceScript * GetInstanceScript(InstanceMap *map) const override
#define MAX_ENCOUNTER
@ GO_ATALAI_STATUE6
@ GO_ATALAI_LIGHT1
@ GO_ATALAI_STATUE5
@ GO_ATALAI_STATUE4
@ GO_ATALAI_STATUE2
@ GO_ATALAI_STATUE3
@ GO_ATALAI_LIGHT2
@ GO_ATALAI_STATUE1
static constexpr DungeonEncounterData Encounters[]
@ NPC_MALFURION_STORMRAGE
void AddSC_instance_sunken_temple()
constexpr float GetOrientation() const
Definition: Position.h:79
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
Definition: GameObject.cpp:118
#define STScriptName
Definition: sunken_temple.h:23
@ NPC_DREAMSCYTHE
Definition: sunken_temple.h:43
@ NPC_JAMMALAN_THE_PROPHET
Definition: sunken_temple.h:42
@ NPC_SHADE_OF_ERANIKUS
Definition: sunken_temple.h:47
@ NPC_AVATAR_OF_HAKKAR
Definition: sunken_temple.h:41
@ NPC_HAZZAS
Definition: sunken_temple.h:46
@ NPC_MORPHAZ
Definition: sunken_temple.h:45
@ NPC_WEAVER
Definition: sunken_temple.h:44
@ EVENT_STATE
Definition: sunken_temple.h:52
@ BOSS_MORPHAZ
Definition: sunken_temple.h:32
@ BOSS_JAMMALAN_THE_PROPHET
Definition: sunken_temple.h:29
@ BOSS_HAZZAS
Definition: sunken_temple.h:33
@ BOSS_WEAVER
Definition: sunken_temple.h:31
@ BOSS_DREAMSCYTHE
Definition: sunken_temple.h:30
@ BOSS_AVATAR_OF_HAKKAR
Definition: sunken_temple.h:28
@ BOSS_SHADE_OF_ERANIKUS
Definition: sunken_temple.h:34