Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_gal_darah.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
#include "
ScriptMgr.h
"
7
#include "
ScriptedCreature.h
"
8
#include "
gundrak.h
"
9
10
//Spells
11
enum
Spells
12
{
13
SPELL_ENRAGE
= 55285,
14
H_SPELL_ENRAGE
= 59828,
15
SPELL_IMPALING_CHARGE
= 54956,
16
H_SPELL_IMPALING_CHARGE
= 59827,
17
SPELL_STOMP
= 55292,
18
H_SPELL_STOMP
= 59829,
19
SPELL_PUNCTURE
= 55276,
20
H_SPELL_PUNCTURE
= 59826,
21
SPELL_STAMPEDE
= 55218,
22
SPELL_WHIRLING_SLASH
= 55250,
23
H_SPELL_WHIRLING_SLASH
= 59824,
24
};
25
26
//Yells
27
enum
Yells
28
{
29
SAY_AGGRO
= 0,
30
SAY_SLAY
= 1,
31
SAY_DEATH
= 2,
32
SAY_SUMMON_RHINO
= 3,
33
SAY_TRANSFORM_1
= 4,
34
SAY_TRANSFORM_2
= 5
35
};
36
37
enum
Displays
38
{
39
DISPLAY_RHINO
= 26265,
40
DISPLAY_TROLL
= 27061
41
};
42
43
enum
CombatPhase
44
{
45
TROLL
,
46
RHINO
47
};
48
49
enum
Misc
50
{
51
DATA_SHARE_THE_LOVE
= 1
52
};
53
54
class
boss_gal_darah
:
public
CreatureScript
55
{
56
public
:
57
boss_gal_darah
() :
CreatureScript
(
"boss_gal_darah"
) { }
58
59
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
60
{
61
return
new
boss_gal_darahAI
(creature);
62
}
63
64
struct
boss_gal_darahAI
:
public
ScriptedAI
65
{
66
boss_gal_darahAI
(
Creature
* creature) :
ScriptedAI
(creature)
67
{
68
instance
= creature->
GetInstanceScript
();
69
}
70
71
uint32
uiStampedeTimer
;
72
uint32
uiWhirlingSlashTimer
;
73
uint32
uiPunctureTimer
;
74
uint32
uiEnrageTimer
;
75
uint32
uiImpalingChargeTimer
;
76
uint32
uiStompTimer
;
77
uint32
uiTransformationTimer
;
78
std::list<uint64>
impaledList
;
79
uint8
shareTheLove
;
80
81
CombatPhase
Phase
;
82
83
uint8
uiPhaseCounter
;
84
85
bool
bStartOfTransformation
;
86
87
InstanceScript
*
instance
;
88
89
void
Reset
()
OVERRIDE
90
{
91
uiStampedeTimer
= 10*
IN_MILLISECONDS
;
92
uiWhirlingSlashTimer
= 21*
IN_MILLISECONDS
;
93
uiPunctureTimer
= 10*
IN_MILLISECONDS
;
94
uiEnrageTimer
= 15*
IN_MILLISECONDS
;
95
uiImpalingChargeTimer
= 21*
IN_MILLISECONDS
;
96
uiStompTimer
= 25*
IN_MILLISECONDS
;
97
uiTransformationTimer
= 9*
IN_MILLISECONDS
;
98
uiPhaseCounter
= 0;
99
100
impaledList
.clear();
101
shareTheLove
= 0;
102
103
bStartOfTransformation
=
true
;
104
105
Phase
=
TROLL
;
106
107
me
->SetDisplayId(
DISPLAY_TROLL
);
108
109
if
(
instance
)
110
instance
->SetData(
DATA_GAL_DARAH_EVENT
,
NOT_STARTED
);
111
}
112
113
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
114
{
115
Talk
(
SAY_AGGRO
);
116
117
if
(
instance
)
118
instance
->SetData(
DATA_GAL_DARAH_EVENT
,
IN_PROGRESS
);
119
}
120
121
void
UpdateAI
(
uint32
diff)
OVERRIDE
122
{
123
if
(!
UpdateVictim
())
124
return
;
125
126
switch
(
Phase
)
127
{
128
case
TROLL
:
129
if
(
uiPhaseCounter
== 2)
130
{
131
if
(
uiTransformationTimer
<= diff)
132
{
133
me
->SetDisplayId(
DISPLAY_RHINO
);
134
Phase
=
RHINO
;
135
uiPhaseCounter
= 0;
136
Talk
(
SAY_TRANSFORM_1
);
137
uiTransformationTimer
= 5*
IN_MILLISECONDS
;
138
bStartOfTransformation
=
true
;
139
me
->ClearUnitState(
UNIT_STATE_STUNNED
|
UNIT_STATE_ROOT
);
140
me
->SetReactState(
REACT_AGGRESSIVE
);
141
}
142
else
143
{
144
uiTransformationTimer
-= diff;
145
146
if
(
bStartOfTransformation
)
147
{
148
bStartOfTransformation
=
false
;
149
me
->AddUnitState(
UNIT_STATE_STUNNED
|
UNIT_STATE_ROOT
);
150
me
->SetReactState(
REACT_PASSIVE
);
151
}
152
}
153
}
154
else
155
{
156
if
(
uiStampedeTimer
<= diff)
157
{
158
DoCast
(
me
,
SPELL_STAMPEDE
);
159
Talk
(
SAY_SUMMON_RHINO
);
160
uiStampedeTimer
= 15*
IN_MILLISECONDS
;
161
}
else
uiStampedeTimer
-= diff;
162
163
if
(
uiWhirlingSlashTimer
<= diff)
164
{
165
DoCastVictim
(
SPELL_WHIRLING_SLASH
);
166
uiWhirlingSlashTimer
= 21*
IN_MILLISECONDS
;
167
++
uiPhaseCounter
;
168
}
else
uiWhirlingSlashTimer
-= diff;
169
}
170
break
;
171
case
RHINO
:
172
if
(
uiPhaseCounter
== 2)
173
{
174
if
(
uiTransformationTimer
<= diff)
175
{
176
me
->SetDisplayId(
DISPLAY_TROLL
);
177
Phase
=
TROLL
;
178
uiPhaseCounter
= 0;
179
Talk
(
SAY_TRANSFORM_2
);
180
uiTransformationTimer
= 9*
IN_MILLISECONDS
;
181
bStartOfTransformation
=
true
;
182
me
->ClearUnitState(
UNIT_STATE_STUNNED
|
UNIT_STATE_ROOT
);
183
me
->SetReactState(
REACT_AGGRESSIVE
);
184
}
185
else
186
{
187
uiTransformationTimer
-= diff;
188
189
if
(
bStartOfTransformation
)
190
{
191
bStartOfTransformation
=
false
;
192
me
->AddUnitState(
UNIT_STATE_STUNNED
|
UNIT_STATE_ROOT
);
193
me
->SetReactState(
REACT_PASSIVE
);
194
}
195
}
196
}
197
else
198
{
199
if
(
uiPunctureTimer
<= diff)
200
{
201
DoCastVictim
(
SPELL_PUNCTURE
);
202
uiPunctureTimer
= 8*
IN_MILLISECONDS
;
203
}
else
uiPunctureTimer
-= diff;
204
205
if
(
uiEnrageTimer
<= diff)
206
{
207
DoCastVictim
(
SPELL_ENRAGE
);
208
uiEnrageTimer
= 20*
IN_MILLISECONDS
;
209
}
else
uiEnrageTimer
-= diff;
210
211
if
(
uiStompTimer
<= diff)
212
{
213
DoCastVictim
(
SPELL_STOMP
);
214
uiStompTimer
= 20*
IN_MILLISECONDS
;
215
}
else
uiStompTimer
-= diff;
216
217
if
(
uiImpalingChargeTimer
<= diff)
218
{
219
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
220
{
221
DoCast
(target,
SPELL_IMPALING_CHARGE
);
222
CheckAchievement
(target->GetGUID());
223
}
224
uiImpalingChargeTimer
= 31*
IN_MILLISECONDS
;
225
++
uiPhaseCounter
;
226
}
else
uiImpalingChargeTimer
-= diff;
227
}
228
break
;
229
}
230
231
DoMeleeAttackIfReady
();
232
}
233
234
// 5 UNIQUE party members
235
void
CheckAchievement
(
uint64
guid)
236
{
237
bool
playerExists =
false
;
238
for
(std::list<uint64>::iterator itr =
impaledList
.begin(); itr !=
impaledList
.end(); ++itr)
239
if
(guid != *itr)
240
playerExists =
true
;
241
242
if
(playerExists)
243
++
shareTheLove
;
244
245
impaledList
.push_back(guid);
246
}
247
248
uint32
GetData
(
uint32
type)
const
OVERRIDE
249
{
250
if
(type ==
DATA_SHARE_THE_LOVE
)
251
return
shareTheLove
;
252
253
return
0;
254
}
255
256
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
257
{
258
Talk
(
SAY_DEATH
);
259
260
if
(
instance
)
261
instance
->SetData(
DATA_GAL_DARAH_EVENT
,
DONE
);
262
}
263
264
void
KilledUnit
(
Unit
* victim)
OVERRIDE
265
{
266
if
(victim->GetTypeId() !=
TypeID::TYPEID_PLAYER
)
267
return
;
268
269
Talk
(
SAY_SLAY
);
270
}
271
};
272
};
273
274
class
achievement_share_the_love
:
public
AchievementCriteriaScript
275
{
276
public
:
277
achievement_share_the_love
() :
AchievementCriteriaScript
(
"achievement_share_the_love"
) { }
278
279
bool
OnCheck
(
Player
*
/*player*/
,
Unit
* target)
OVERRIDE
280
{
281
if
(!target)
282
return
false
;
283
284
if
(
Creature
* GalDarah = target->
ToCreature
())
285
if
(GalDarah->AI()->GetData(
DATA_SHARE_THE_LOVE
) >= 5)
286
return
true
;
287
288
return
false
;
289
}
290
};
291
292
void
AddSC_boss_gal_darah
()
293
{
294
new
boss_gal_darah
();
295
new
achievement_share_the_love
();
296
}
Spells
Spells
Definition
BattlegroundIC.h:645
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:125
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
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
DONE
@ DONE
Definition
InstanceScript.h:49
NOT_STARTED
@ NOT_STARTED
Definition
InstanceScript.h:46
TypeID::TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
Object.h:55
ScriptMgr.h
ScriptedCreature.h
UNIT_STATE_ROOT
@ UNIT_STATE_ROOT
Definition
Unit.h:522
UNIT_STATE_STUNNED
@ UNIT_STATE_STUNNED
Definition
Unit.h:515
REACT_PASSIVE
@ REACT_PASSIVE
Definition
Unit.h:1156
REACT_AGGRESSIVE
@ REACT_AGGRESSIVE
Definition
Unit.h:1158
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
alterac_valley.cpp:14
SAY_SLAY
@ SAY_SLAY
Definition
boss_alizabal.cpp:20
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
DATA_SHARE_THE_LOVE
@ DATA_SHARE_THE_LOVE
Definition
boss_gal_darah.cpp:51
SAY_DEATH
@ SAY_DEATH
Definition
boss_gal_darah.cpp:31
SAY_SUMMON_RHINO
@ SAY_SUMMON_RHINO
Definition
boss_gal_darah.cpp:32
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_gal_darah.cpp:29
SAY_TRANSFORM_1
@ SAY_TRANSFORM_1
Definition
boss_gal_darah.cpp:33
SAY_SLAY
@ SAY_SLAY
Definition
boss_gal_darah.cpp:30
SAY_TRANSFORM_2
@ SAY_TRANSFORM_2
Definition
boss_gal_darah.cpp:34
SPELL_STOMP
@ SPELL_STOMP
Definition
boss_gal_darah.cpp:17
H_SPELL_WHIRLING_SLASH
@ H_SPELL_WHIRLING_SLASH
Definition
boss_gal_darah.cpp:23
H_SPELL_PUNCTURE
@ H_SPELL_PUNCTURE
Definition
boss_gal_darah.cpp:20
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
boss_gal_darah.cpp:13
H_SPELL_ENRAGE
@ H_SPELL_ENRAGE
Definition
boss_gal_darah.cpp:14
SPELL_IMPALING_CHARGE
@ SPELL_IMPALING_CHARGE
Definition
boss_gal_darah.cpp:15
SPELL_STAMPEDE
@ SPELL_STAMPEDE
Definition
boss_gal_darah.cpp:21
H_SPELL_IMPALING_CHARGE
@ H_SPELL_IMPALING_CHARGE
Definition
boss_gal_darah.cpp:16
SPELL_PUNCTURE
@ SPELL_PUNCTURE
Definition
boss_gal_darah.cpp:19
SPELL_WHIRLING_SLASH
@ SPELL_WHIRLING_SLASH
Definition
boss_gal_darah.cpp:22
H_SPELL_STOMP
@ H_SPELL_STOMP
Definition
boss_gal_darah.cpp:18
AddSC_boss_gal_darah
void AddSC_boss_gal_darah()
Definition
boss_gal_darah.cpp:292
Displays
Displays
Definition
boss_gal_darah.cpp:38
DISPLAY_RHINO
@ DISPLAY_RHINO
Definition
boss_gal_darah.cpp:39
DISPLAY_TROLL
@ DISPLAY_TROLL
Definition
boss_gal_darah.cpp:40
CombatPhase
CombatPhase
Definition
boss_gal_darah.cpp:44
TROLL
@ TROLL
Definition
boss_gal_darah.cpp:45
RHINO
@ RHINO
Definition
boss_gal_darah.cpp:46
Misc
Misc
Definition
boss_occuthar.cpp:37
SPELL_STOMP
@ SPELL_STOMP
Definition
chapter5.cpp:158
AchievementCriteriaScript::AchievementCriteriaScript
AchievementCriteriaScript(const char *name)
Definition
ScriptMgr.cpp:1508
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
InstanceScript
Definition
InstanceScript.h:123
Object::ToCreature
Creature * ToCreature()
Definition
Object.h:207
Player
Definition
Player.h:1289
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::SelectTarget
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition
UnitAI.cpp:66
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
achievement_share_the_love
Definition
boss_gal_darah.cpp:275
achievement_share_the_love::achievement_share_the_love
achievement_share_the_love()
Definition
boss_gal_darah.cpp:277
achievement_share_the_love::OnCheck
bool OnCheck(Player *, Unit *target) OVERRIDE
Definition
boss_gal_darah.cpp:279
boss_gal_darah
Definition
boss_gal_darah.cpp:55
boss_gal_darah::boss_gal_darah
boss_gal_darah()
Definition
boss_gal_darah.cpp:57
boss_gal_darah::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_gal_darah.cpp:59
gundrak.h
DATA_GAL_DARAH_EVENT
@ DATA_GAL_DARAH_EVENT
Definition
gundrak.h:14
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
Yells
Definition
boss_illidan.cpp:256
boss_gal_darah::boss_gal_darahAI
Definition
boss_gal_darah.cpp:65
boss_gal_darah::boss_gal_darahAI::CheckAchievement
void CheckAchievement(uint64 guid)
Definition
boss_gal_darah.cpp:235
boss_gal_darah::boss_gal_darahAI::instance
InstanceScript * instance
Definition
boss_gal_darah.cpp:87
boss_gal_darah::boss_gal_darahAI::uiTransformationTimer
uint32 uiTransformationTimer
Definition
boss_gal_darah.cpp:77
boss_gal_darah::boss_gal_darahAI::boss_gal_darahAI
boss_gal_darahAI(Creature *creature)
Definition
boss_gal_darah.cpp:66
boss_gal_darah::boss_gal_darahAI::uiImpalingChargeTimer
uint32 uiImpalingChargeTimer
Definition
boss_gal_darah.cpp:75
boss_gal_darah::boss_gal_darahAI::uiStompTimer
uint32 uiStompTimer
Definition
boss_gal_darah.cpp:76
boss_gal_darah::boss_gal_darahAI::KilledUnit
void KilledUnit(Unit *victim) OVERRIDE
Definition
boss_gal_darah.cpp:264
boss_gal_darah::boss_gal_darahAI::GetData
uint32 GetData(uint32 type) const OVERRIDE
Definition
boss_gal_darah.cpp:248
boss_gal_darah::boss_gal_darahAI::uiWhirlingSlashTimer
uint32 uiWhirlingSlashTimer
Definition
boss_gal_darah.cpp:72
boss_gal_darah::boss_gal_darahAI::Phase
CombatPhase Phase
Definition
boss_gal_darah.cpp:81
boss_gal_darah::boss_gal_darahAI::uiPunctureTimer
uint32 uiPunctureTimer
Definition
boss_gal_darah.cpp:73
boss_gal_darah::boss_gal_darahAI::uiStampedeTimer
uint32 uiStampedeTimer
Definition
boss_gal_darah.cpp:71
boss_gal_darah::boss_gal_darahAI::uiEnrageTimer
uint32 uiEnrageTimer
Definition
boss_gal_darah.cpp:74
boss_gal_darah::boss_gal_darahAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_gal_darah.cpp:256
boss_gal_darah::boss_gal_darahAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_gal_darah.cpp:121
boss_gal_darah::boss_gal_darahAI::Reset
void Reset() OVERRIDE
Definition
boss_gal_darah.cpp:89
boss_gal_darah::boss_gal_darahAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_gal_darah.cpp:113
boss_gal_darah::boss_gal_darahAI::uiPhaseCounter
uint8 uiPhaseCounter
Definition
boss_gal_darah.cpp:83
boss_gal_darah::boss_gal_darahAI::shareTheLove
uint8 shareTheLove
Definition
boss_gal_darah.cpp:79
boss_gal_darah::boss_gal_darahAI::bStartOfTransformation
bool bStartOfTransformation
Definition
boss_gal_darah.cpp:85
boss_gal_darah::boss_gal_darahAI::impaledList
std::list< uint64 > impaledList
Definition
boss_gal_darah.cpp:78
src
server
scripts
Northrend
Gundrak
boss_gal_darah.cpp
Generated on
for Project SkyFire Core by
1.17.0