TrinityCore
Loading...
Searching...
No Matches
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#include "Random.h"
32
34{
35 { -458.500610f, -38.343079f, -33.474445f, 0.0f },
36 { -469.423615f, -88.400513f, -39.265102f, 0.0f },
37 { -622.354980f, -10.350100f, -22.777000f, 0.0f },
38 { -759.640564f, 16.658913f, -29.159529f, 0.0f }
39};
40
42{
43 { -768.949f, -174.413f, -25.87f, 3.09f }, // Left side
44 { -768.888f, -164.238f, -25.87f, 3.09f },
45 { -768.951f, -153.911f, -25.88f, 3.09f },
46 { -774.400f, -169.405f, -25.86f, 3.11f },
47 { -774.491f, -159.371f, -25.86f, 3.21f },
48 { -867.782f, -174.352f, -25.87f, 6.27f }, // Right side
49 { -867.875f, -164.089f, -25.87f, 6.27f },
50 { -867.859f, -153.927f, -25.88f, 6.27f },
51 { -861.823f, -159.018f, -25.87f, 0.00f },
52 { -861.524f, -169.387f, -25.87f, 0.18f },
53 { -859.827f, -468.425f, -33.88f, 5.63f } // Morridune
54};
55
57{
58public:
60
65
67 {
76
77 void OnCreatureCreate(Creature* creature) override
78 {
79 switch (creature->GetEntry())
80 {
82 twilightLordKelrisGUID = creature->GetGUID();
83 break;
84 case NPC_LORGUS_JETT:
85 creature->SetHomePosition(LorgusPosition[urand(0, 3)]);
86 break;
87 }
88 }
89
90 void OnGameObjectCreate(GameObject* go) override
91 {
92 switch (go->GetEntry())
93 {
95 shrine1GUID = go->GetGUID();
96 break;
98 shrine2GUID = go->GetGUID();
99 break;
101 shrine3GUID = go->GetGUID();
102 break;
104 shrine4GUID = go->GetGUID();
105 break;
110 break;
115 break;
116 case GO_AKU_MAI_DOOR:
119 mainDoorGUID = go->GetGUID();
120 break;
121 }
122 }
123
124 void SetData(uint32 type, uint32 data) override
125 {
126 switch (type)
127 {
128 case DATA_FIRE:
129 countFires = data;
130 switch (countFires)
131 {
132 case 1:
134 {
139 }
140 break;
141 case 2:
143 {
154 }
155 break;
156 case 3:
158 {
161 }
162 break;
163 case 4:
165 {
170 }
171 break;
172 }
173 break;
174 case DATA_EVENT:
175 deathTimes = data;
176 if (deathTimes == 18)
178 break;
179 }
180 }
181
182 bool SetBossState(uint32 type, EncounterState state) override
183 {
184 if (!InstanceScript::SetBossState(type, state))
185 return false;
186
187 switch (type)
188 {
189 case DATA_GELIHAST:
190 if (state == DONE)
192 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
193 break;
194 case DATA_AKU_MAI:
195 if (state == DONE)
197 {
198 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
199 go->SummonCreature(NPC_MORRIDUNE, SpawnsLocation[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5min);
200 }
201 break;
202 default:
203 break;
204 }
205
206 return true;
207 }
208
209 uint32 GetData(uint32 type) const override
210 {
211 switch (type)
212 {
213 case DATA_FIRE:
214 return countFires;
215 case DATA_EVENT:
216 return deathTimes;
217 }
218
219 return 0;
220 }
221
222 ObjectGuid GetGuidData(uint32 data) const override
223 {
224 switch (data)
225 {
228 case DATA_SHRINE1:
229 return shrine1GUID;
230 case DATA_SHRINE2:
231 return shrine2GUID;
232 case DATA_SHRINE3:
233 return shrine3GUID;
234 case DATA_SHRINE4:
235 return shrine4GUID;
238 case DATA_MAINDOOR:
239 return mainDoorGUID;
240 }
241
242 return ObjectGuid::Empty;
243 }
244
245 private:
256 };
257};
258
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
EncounterState
@ DONE
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
@ GO_FLAG_NOT_SELECTABLE
@ 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
#define DataHeader
uint32 const EncounterCount
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:293
void SetFlag(GameObjectFlags flags)
Definition GameObject.h:171
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:4430
static ObjectGuid const Empty
Definition ObjectGuid.h:140
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
InstanceScript * GetInstanceScript(InstanceMap *map) const override
Position const LorgusPosition[4]
void AddSC_instance_blackfathom_deeps()
Position const SpawnsLocation[]