TrinityCore
instance_blackfathom_deeps.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_Blackfathom_Deeps
20SD%Complete: 50
21SDComment:
22SDCategory: Blackfathom Deeps
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "blackfathom_deeps.h"
27#include "Creature.h"
28#include "GameObject.h"
29#include "InstanceScript.h"
30#include "Map.h"
31
33{
34 { -458.500610f, -38.343079f, -33.474445f, 0.0f },
35 { -469.423615f, -88.400513f, -39.265102f, 0.0f },
36 { -622.354980f, -10.350100f, -22.777000f, 0.0f },
37 { -759.640564f, 16.658913f, -29.159529f, 0.0f }
38};
39
41{
42 { -768.949f, -174.413f, -25.87f, 3.09f }, // Left side
43 { -768.888f, -164.238f, -25.87f, 3.09f },
44 { -768.951f, -153.911f, -25.88f, 3.09f },
45 { -774.400f, -169.405f, -25.86f, 3.11f },
46 { -774.491f, -159.371f, -25.86f, 3.21f },
47 { -867.782f, -174.352f, -25.87f, 6.27f }, // Right side
48 { -867.875f, -164.089f, -25.87f, 6.27f },
49 { -867.859f, -153.927f, -25.88f, 6.27f },
50 { -861.823f, -159.018f, -25.87f, 0.00f },
51 { -861.524f, -169.387f, -25.87f, 0.18f },
52 { -859.827f, -468.425f, -33.88f, 5.63f } // Morridune
53};
54
56{
57public:
59
61 {
63 }
64
66 {
68 {
71
72 countFires = 0;
73 deathTimes = 0;
74 }
75
76 void OnCreatureCreate(Creature* creature) override
77 {
78 switch (creature->GetEntry())
79 {
81 twilightLordKelrisGUID = creature->GetGUID();
82 break;
83 case NPC_LORGUS_JETT:
84 creature->SetHomePosition(LorgusPosition[urand(0, 3)]);
85 break;
86 }
87 }
88
89 void OnGameObjectCreate(GameObject* go) override
90 {
91 switch (go->GetEntry())
92 {
94 shrine1GUID = go->GetGUID();
95 break;
97 shrine2GUID = go->GetGUID();
98 break;
100 shrine3GUID = go->GetGUID();
101 break;
103 shrine4GUID = go->GetGUID();
104 break;
109 break;
114 break;
115 case GO_AKU_MAI_DOOR:
118 mainDoorGUID = go->GetGUID();
119 break;
120 }
121 }
122
123 void SetData(uint32 type, uint32 data) override
124 {
125 switch (type)
126 {
127 case DATA_FIRE:
128 countFires = data;
129 switch (countFires)
130 {
131 case 1:
133 {
138 }
139 break;
140 case 2:
142 {
153 }
154 break;
155 case 3:
157 {
160 }
161 break;
162 case 4:
164 {
169 }
170 break;
171 }
172 break;
173 case DATA_EVENT:
174 deathTimes = data;
175 if (deathTimes == 18)
177 break;
178 }
179 }
180
181 bool SetBossState(uint32 type, EncounterState state) override
182 {
183 if (!InstanceScript::SetBossState(type, state))
184 return false;
185
186 switch (type)
187 {
188 case DATA_GELIHAST:
189 if (state == DONE)
191 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
192 break;
193 case DATA_AKU_MAI:
194 if (state == DONE)
196 {
197 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
198 go->SummonCreature(NPC_MORRIDUNE, SpawnsLocation[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5min);
199 }
200 break;
201 default:
202 break;
203 }
204
205 return true;
206 }
207
208 uint32 GetData(uint32 type) const override
209 {
210 switch (type)
211 {
212 case DATA_FIRE:
213 return countFires;
214 case DATA_EVENT:
215 return deathTimes;
216 }
217
218 return 0;
219 }
220
221 ObjectGuid GetGuidData(uint32 data) const override
222 {
223 switch (data)
224 {
227 case DATA_SHRINE1:
228 return shrine1GUID;
229 case DATA_SHRINE2:
230 return shrine2GUID;
231 case DATA_SHRINE3:
232 return shrine3GUID;
233 case DATA_SHRINE4:
234 return shrine4GUID;
237 case DATA_MAINDOOR:
238 return mainDoorGUID;
239 }
240
241 return ObjectGuid::Empty;
242 }
243
244 private:
255 };
256};
257
259{
261}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
EncounterState
@ DONE
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: ObjectDefines.h:68
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
@ DATA_SHRINE1
@ DATA_TWILIGHT_LORD_KELRIS
@ DATA_SHRINE2
@ DATA_SHRINE3
@ DATA_SHRINE4
@ DATA_SHRINE_OF_GELIHAST
@ DATA_MAINDOOR
@ NPC_LORGUS_JETT
@ NPC_BARBED_CRUSTACEAN
@ NPC_AKU_MAI_SERVANT
@ NPC_MORRIDUNE
@ NPC_MURKSHALLOW_SOFTSHELL
@ NPC_AKU_MAI_SNAPJAW
@ NPC_TWILIGHT_LORD_KELRIS
@ GO_FIRE_OF_AKU_MAI_3
@ GO_FIRE_OF_AKU_MAI_4
@ GO_ALTAR_OF_THE_DEEPS
@ GO_FIRE_OF_AKU_MAI_1
@ GO_AKU_MAI_DOOR
@ GO_FIRE_OF_AKU_MAI_2
@ GO_SHRINE_OF_GELIHAST
#define BFDScriptName
@ DATA_AKU_MAI
@ DATA_EVENT
@ DATA_GELIHAST
@ DATA_FIRE
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:274
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
InstanceMap * instance
EncounterState GetBossState(uint32 id) const
void SetHeaders(std::string const &dataHeaders)
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3489
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
InstanceScript * GetInstanceScript(InstanceMap *map) const override
Position const LorgusPosition[4]
void AddSC_instance_blackfathom_deeps()
Position const SpawnsLocation[]