Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
instance_blackfathom_deeps.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
7
SDName: Instance_Blackfathom_Deeps
8
SD%Complete: 50
9
SDComment:
10
SDCategory: Blackfathom Deeps
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
InstanceScript.h
"
15
#include "
blackfathom_deeps.h
"
16
17
#define MAX_ENCOUNTER 4
18
19
/* Encounter 0 = Gelihast
20
Encounter 1 = Twilight Lord Kelris
21
Encounter 2 = Shrine event
22
Encounter 3 = Aku'Mai
23
*/
24
25
const
Position
LorgusPosition
[4] =
26
{
27
{ -458.500610f, -38.343079f, -33.474445f, 0.0f },
28
{ -469.423615f, -88.400513f, -39.265102f, 0.0f },
29
{ -622.354980f, -10.350100f, -22.777000f, 0.0f },
30
{ -759.640564f, 16.658913f, -29.159529f, 0.0f }
31
};
32
33
const
Position
SpawnsLocation
[] =
34
{
35
{-775.431f, -153.853f, -25.871f, 3.207f},
36
{-775.404f, -174.132f, -25.871f, 3.185f},
37
{-862.430f, -154.937f, -25.871f, 0.060f},
38
{-862.193f, -174.251f, -25.871f, 6.182f},
39
{-863.895f, -458.899f, -33.891f, 5.637f}
40
};
41
42
class
instance_blackfathom_deeps
:
public
InstanceMapScript
43
{
44
public
:
45
instance_blackfathom_deeps
() :
InstanceMapScript
(
"instance_blackfathom_deeps"
, 48) { }
46
47
InstanceScript
*
GetInstanceScript
(
InstanceMap
* map)
const
OVERRIDE
48
{
49
return
new
instance_blackfathom_deeps_InstanceMapScript
(map);
50
}
51
52
struct
instance_blackfathom_deeps_InstanceMapScript
:
public
InstanceScript
53
{
54
instance_blackfathom_deeps_InstanceMapScript
(
Map
* map) :
InstanceScript
(map) { }
55
56
uint64
twilightLordKelrisGUID
;
57
uint64
shrine1GUID
;
58
uint64
shrine2GUID
;
59
uint64
shrine3GUID
;
60
uint64
shrine4GUID
;
61
uint64
shrineOfGelihastGUID
;
62
uint64
altarOfTheDeepsGUID
;
63
uint64
mainDoorGUID
;
64
65
uint8
encounter
[
MAX_ENCOUNTER
];
66
uint8
countFires
;
67
uint8
deathTimes
;
68
69
void
Initialize
()
OVERRIDE
70
{
71
memset(&
encounter
, 0,
sizeof
(
encounter
));
72
73
twilightLordKelrisGUID
= 0;
74
shrine1GUID
= 0;
75
shrine2GUID
= 0;
76
shrine3GUID
= 0;
77
shrine4GUID
= 0;
78
shrineOfGelihastGUID
= 0;
79
altarOfTheDeepsGUID
= 0;
80
mainDoorGUID
= 0;
81
countFires
= 0;
82
deathTimes
= 0;
83
}
84
85
void
OnCreatureCreate
(
Creature
* creature)
OVERRIDE
86
{
87
switch
(creature->GetEntry())
88
{
89
case
NPC_TWILIGHT_LORD_KELRIS
:
90
twilightLordKelrisGUID
= creature->GetGUID();
91
break
;
92
case
NPC_LORGUS_JETT
:
93
creature->SetHomePosition(
LorgusPosition
[std::rand() % 3]);
94
break
;
95
}
96
}
97
98
void
OnGameObjectCreate
(
GameObject
* go)
OVERRIDE
99
{
100
switch
(go->GetEntry())
101
{
102
case
GO_FIRE_OF_AKU_MAI_1
:
103
shrine1GUID
= go->GetGUID();
104
break
;
105
case
GO_FIRE_OF_AKU_MAI_2
:
106
shrine2GUID
= go->GetGUID();
107
break
;
108
case
GO_FIRE_OF_AKU_MAI_3
:
109
shrine3GUID
= go->GetGUID();
110
break
;
111
case
GO_FIRE_OF_AKU_MAI_4
:
112
shrine4GUID
= go->GetGUID();
113
break
;
114
case
GO_SHRINE_OF_GELIHAST
:
115
shrineOfGelihastGUID
= go->GetGUID();
116
if
(
encounter
[0] !=
DONE
)
117
go->SetFlag(
GAMEOBJECT_FIELD_FLAGS
,
GO_FLAG_NOT_SELECTABLE
);
118
break
;
119
case
GO_ALTAR_OF_THE_DEEPS
:
120
altarOfTheDeepsGUID
= go->GetGUID();
121
if
(
encounter
[3] !=
DONE
)
122
go->SetFlag(
GAMEOBJECT_FIELD_FLAGS
,
GO_FLAG_NOT_SELECTABLE
);
123
break
;
124
case
GO_AKU_MAI_DOOR
:
125
if
(
encounter
[2] ==
DONE
)
126
HandleGameObject
(0,
true
, go);
127
mainDoorGUID
= go->GetGUID();
128
break
;
129
}
130
}
131
132
void
SetData
(
uint32
type,
uint32
data)
OVERRIDE
133
{
134
switch
(type)
135
{
136
case
TYPE_GELIHAST
:
137
encounter
[0] = data;
138
if
(data ==
DONE
)
139
if
(
GameObject
* go =
instance
->GetGameObject(
shrineOfGelihastGUID
))
140
go->RemoveFlag(
GAMEOBJECT_FIELD_FLAGS
,
GO_FLAG_NOT_SELECTABLE
);
141
break
;
142
case
TYPE_AKU_MAI
:
143
encounter
[3] = data;
144
if
(data ==
DONE
)
145
if
(
GameObject
* go =
instance
->GetGameObject(
altarOfTheDeepsGUID
))
146
{
147
go->RemoveFlag(
GAMEOBJECT_FIELD_FLAGS
,
GO_FLAG_NOT_SELECTABLE
);
148
go->SummonCreature(
NPC_MORRIDUNE
,
SpawnsLocation
[4],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
149
}
150
break
;
151
case
DATA_FIRE
:
152
countFires
= data;
153
switch
(
countFires
)
154
{
155
case
1:
156
if
(
GameObject
* go =
instance
->GetGameObject(
shrine1GUID
))
157
{
158
go->SummonCreature(
NPC_AKU_MAI_SNAPJAW
,
SpawnsLocation
[0],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
159
go->SummonCreature(
NPC_AKU_MAI_SNAPJAW
,
SpawnsLocation
[1],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
160
go->SummonCreature(
NPC_AKU_MAI_SNAPJAW
,
SpawnsLocation
[2],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
161
go->SummonCreature(
NPC_AKU_MAI_SNAPJAW
,
SpawnsLocation
[3],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
162
}
163
break
;
164
case
2:
165
if
(
GameObject
* go =
instance
->GetGameObject(
shrine1GUID
))
166
{
167
for
(
uint8
i = 0; i < 2; ++i)
168
{
169
go->SummonCreature(
NPC_MURKSHALLOW_SOFTSHELL
,
SpawnsLocation
[0],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
170
go->SummonCreature(
NPC_MURKSHALLOW_SOFTSHELL
,
SpawnsLocation
[1],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
171
go->SummonCreature(
NPC_MURKSHALLOW_SOFTSHELL
,
SpawnsLocation
[2],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
172
go->SummonCreature(
NPC_MURKSHALLOW_SOFTSHELL
,
SpawnsLocation
[3],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
173
}
174
}
175
break
;
176
case
3:
177
if
(
GameObject
* go =
instance
->GetGameObject(
shrine1GUID
))
178
{
179
go->SummonCreature(
NPC_AKU_MAI_SERVANT
,
SpawnsLocation
[1],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
180
go->SummonCreature(
NPC_AKU_MAI_SERVANT
,
SpawnsLocation
[2],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
181
}
182
break
;
183
case
4:
184
if
(
GameObject
* go =
instance
->GetGameObject(
shrine1GUID
))
185
{
186
go->SummonCreature(
NPC_BARBED_CRUSTACEAN
,
SpawnsLocation
[0],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
187
go->SummonCreature(
NPC_BARBED_CRUSTACEAN
,
SpawnsLocation
[1],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
188
go->SummonCreature(
NPC_BARBED_CRUSTACEAN
,
SpawnsLocation
[2],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
189
go->SummonCreature(
NPC_BARBED_CRUSTACEAN
,
SpawnsLocation
[3],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 300000);
190
}
191
break
;
192
}
193
break
;
194
case
DATA_EVENT
:
195
deathTimes
= data;
196
if
(
deathTimes
== 18)
197
HandleGameObject
(
mainDoorGUID
,
true
);
198
break
;
199
}
200
}
201
202
uint32
GetData
(
uint32
type)
const
OVERRIDE
203
{
204
switch
(type)
205
{
206
case
TYPE_GELIHAST
:
207
return
encounter
[0];
208
case
TYPE_KELRIS
:
209
return
encounter
[1];
210
case
TYPE_SHRINE
:
211
return
encounter
[2];
212
case
TYPE_AKU_MAI
:
213
return
encounter
[3];
214
case
DATA_FIRE
:
215
return
countFires
;
216
case
DATA_EVENT
:
217
return
deathTimes
;
218
}
219
220
return
0;
221
}
222
223
uint64
GetData64
(
uint32
data)
const
OVERRIDE
224
{
225
switch
(data)
226
{
227
case
DATA_TWILIGHT_LORD_KELRIS
:
228
return
twilightLordKelrisGUID
;
229
case
DATA_SHRINE1
:
230
return
shrine1GUID
;
231
case
DATA_SHRINE2
:
232
return
shrine2GUID
;
233
case
DATA_SHRINE3
:
234
return
shrine3GUID
;
235
case
DATA_SHRINE4
:
236
return
shrine4GUID
;
237
case
DATA_SHRINE_OF_GELIHAST
:
238
return
shrineOfGelihastGUID
;
239
case
DATA_MAINDOOR
:
240
return
mainDoorGUID
;
241
}
242
243
return
0;
244
}
245
};
246
};
247
248
void
AddSC_instance_blackfathom_deeps
()
249
{
250
new
instance_blackfathom_deeps
();
251
}
uint8
std::uint8_t uint8
Definition
Define.h:79
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
uint64
std::uint64_t uint64
Definition
Define.h:76
InstanceScript.h
DONE
@ DONE
Definition
InstanceScript.h:49
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition
Object.h:73
ScriptMgr.h
GO_FLAG_NOT_SELECTABLE
@ GO_FLAG_NOT_SELECTABLE
Definition
SharedDefines.h:1842
GAMEOBJECT_FIELD_FLAGS
@ GAMEOBJECT_FIELD_FLAGS
Definition
UpdateFields.h:250
blackfathom_deeps.h
DATA_SHRINE1
@ DATA_SHRINE1
Definition
blackfathom_deeps.h:11
DATA_TWILIGHT_LORD_KELRIS
@ DATA_TWILIGHT_LORD_KELRIS
Definition
blackfathom_deeps.h:15
DATA_SHRINE2
@ DATA_SHRINE2
Definition
blackfathom_deeps.h:12
DATA_SHRINE3
@ DATA_SHRINE3
Definition
blackfathom_deeps.h:13
DATA_SHRINE4
@ DATA_SHRINE4
Definition
blackfathom_deeps.h:14
DATA_SHRINE_OF_GELIHAST
@ DATA_SHRINE_OF_GELIHAST
Definition
blackfathom_deeps.h:16
DATA_MAINDOOR
@ DATA_MAINDOOR
Definition
blackfathom_deeps.h:18
GO_FIRE_OF_AKU_MAI_3
@ GO_FIRE_OF_AKU_MAI_3
Definition
blackfathom_deeps.h:49
GO_FIRE_OF_AKU_MAI_4
@ GO_FIRE_OF_AKU_MAI_4
Definition
blackfathom_deeps.h:50
GO_ALTAR_OF_THE_DEEPS
@ GO_ALTAR_OF_THE_DEEPS
Definition
blackfathom_deeps.h:52
GO_FIRE_OF_AKU_MAI_1
@ GO_FIRE_OF_AKU_MAI_1
Definition
blackfathom_deeps.h:47
GO_AKU_MAI_DOOR
@ GO_AKU_MAI_DOOR
Definition
blackfathom_deeps.h:51
GO_FIRE_OF_AKU_MAI_2
@ GO_FIRE_OF_AKU_MAI_2
Definition
blackfathom_deeps.h:48
GO_SHRINE_OF_GELIHAST
@ GO_SHRINE_OF_GELIHAST
Definition
blackfathom_deeps.h:46
NPC_LORGUS_JETT
@ NPC_LORGUS_JETT
Definition
blackfathom_deeps.h:34
NPC_BARBED_CRUSTACEAN
@ NPC_BARBED_CRUSTACEAN
Definition
blackfathom_deeps.h:39
NPC_AKU_MAI_SERVANT
@ NPC_AKU_MAI_SERVANT
Definition
blackfathom_deeps.h:38
NPC_MORRIDUNE
@ NPC_MORRIDUNE
Definition
blackfathom_deeps.h:41
NPC_MURKSHALLOW_SOFTSHELL
@ NPC_MURKSHALLOW_SOFTSHELL
Definition
blackfathom_deeps.h:37
NPC_AKU_MAI_SNAPJAW
@ NPC_AKU_MAI_SNAPJAW
Definition
blackfathom_deeps.h:36
NPC_TWILIGHT_LORD_KELRIS
@ NPC_TWILIGHT_LORD_KELRIS
Definition
blackfathom_deeps.h:33
TYPE_AKU_MAI
@ TYPE_AKU_MAI
Definition
blackfathom_deeps.h:26
TYPE_KELRIS
@ TYPE_KELRIS
Definition
blackfathom_deeps.h:24
DATA_EVENT
@ DATA_EVENT
Definition
blackfathom_deeps.h:28
TYPE_GELIHAST
@ TYPE_GELIHAST
Definition
blackfathom_deeps.h:23
DATA_FIRE
@ DATA_FIRE
Definition
blackfathom_deeps.h:27
TYPE_SHRINE
@ TYPE_SHRINE
Definition
blackfathom_deeps.h:25
Creature
Definition
Creature.h:427
GameObject
Definition
GameObject.h:629
InstanceMap
Definition
Map.h:637
InstanceMapScript::InstanceMapScript
InstanceMapScript(const char *name, uint32 mapId)
Definition
ScriptMgr.cpp:1412
InstanceScript
Definition
InstanceScript.h:123
InstanceScript::InstanceScript
InstanceScript(Map *map)
Definition
InstanceScript.h:125
InstanceScript::instance
Map * instance
Definition
InstanceScript.h:129
InstanceScript::HandleGameObject
void HandleGameObject(uint64 guid, bool open, GameObject *go=NULL)
Definition
InstanceScript.cpp:33
Map
Definition
Map.h:238
instance_blackfathom_deeps
Definition
instance_blackfathom_deeps.cpp:43
instance_blackfathom_deeps::GetInstanceScript
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
Definition
instance_blackfathom_deeps.cpp:47
instance_blackfathom_deeps::instance_blackfathom_deeps
instance_blackfathom_deeps()
Definition
instance_blackfathom_deeps.cpp:45
SpawnsLocation
const Position SpawnsLocation[]
Definition
instance_blackfathom_deeps.cpp:33
AddSC_instance_blackfathom_deeps
void AddSC_instance_blackfathom_deeps()
Definition
instance_blackfathom_deeps.cpp:248
LorgusPosition
const Position LorgusPosition[4]
Definition
instance_blackfathom_deeps.cpp:25
MAX_ENCOUNTER
#define MAX_ENCOUNTER
Definition
instance_blackfathom_deeps.cpp:17
Position
Definition
Object.h:274
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript
Definition
instance_blackfathom_deeps.cpp:53
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::GetData
uint32 GetData(uint32 type) const OVERRIDE
Definition
instance_blackfathom_deeps.cpp:202
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::twilightLordKelrisGUID
uint64 twilightLordKelrisGUID
Definition
instance_blackfathom_deeps.cpp:56
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::encounter
uint8 encounter[MAX_ENCOUNTER]
Definition
instance_blackfathom_deeps.cpp:65
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::OnGameObjectCreate
void OnGameObjectCreate(GameObject *go) OVERRIDE
Definition
instance_blackfathom_deeps.cpp:98
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::deathTimes
uint8 deathTimes
Definition
instance_blackfathom_deeps.cpp:67
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::Initialize
void Initialize() OVERRIDE
Definition
instance_blackfathom_deeps.cpp:69
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::shrine4GUID
uint64 shrine4GUID
Definition
instance_blackfathom_deeps.cpp:60
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::OnCreatureCreate
void OnCreatureCreate(Creature *creature) OVERRIDE
Definition
instance_blackfathom_deeps.cpp:85
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::countFires
uint8 countFires
Definition
instance_blackfathom_deeps.cpp:66
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::altarOfTheDeepsGUID
uint64 altarOfTheDeepsGUID
Definition
instance_blackfathom_deeps.cpp:62
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::shrine3GUID
uint64 shrine3GUID
Definition
instance_blackfathom_deeps.cpp:59
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::shrine1GUID
uint64 shrine1GUID
Definition
instance_blackfathom_deeps.cpp:57
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::GetData64
uint64 GetData64(uint32 data) const OVERRIDE
Definition
instance_blackfathom_deeps.cpp:223
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::SetData
void SetData(uint32 type, uint32 data) OVERRIDE
Definition
instance_blackfathom_deeps.cpp:132
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::shrineOfGelihastGUID
uint64 shrineOfGelihastGUID
Definition
instance_blackfathom_deeps.cpp:61
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::instance_blackfathom_deeps_InstanceMapScript
instance_blackfathom_deeps_InstanceMapScript(Map *map)
Definition
instance_blackfathom_deeps.cpp:54
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::shrine2GUID
uint64 shrine2GUID
Definition
instance_blackfathom_deeps.cpp:58
instance_blackfathom_deeps::instance_blackfathom_deeps_InstanceMapScript::mainDoorGUID
uint64 mainDoorGUID
Definition
instance_blackfathom_deeps.cpp:63
src
server
scripts
Kalimdor
BlackfathomDeeps
instance_blackfathom_deeps.cpp
Generated on
for Project SkyFire Core by
1.17.0