Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_brutallus.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: Boss_Brutallus
8
SD%Complete: 80
9
SDComment: Find a way to start the intro, best code for the intro
10
EndScriptData */
11
12
#include "
ScriptMgr.h
"
13
#include "
ScriptedCreature.h
"
14
#include "
sunwell_plateau.h
"
15
16
enum
Quotes
17
{
18
YELL_INTRO
= 0,
19
YELL_INTRO_BREAK_ICE
= 1,
20
YELL_INTRO_CHARGE
= 2,
21
YELL_INTRO_KILL_MADRIGOSA
= 3,
22
YELL_INTRO_TAUNT
= 4,
23
24
YELL_AGGRO
= 5,
25
YELL_KILL
= 6,
26
YELL_LOVE
= 7,
27
YELL_BERSERK
= 8,
28
YELL_DEATH
= 9,
29
30
YELL_MADR_ICE_BARRIER
= 0,
31
YELL_MADR_INTRO
= 1,
32
YELL_MADR_ICE_BLOCK
= 2,
33
YELL_MADR_TRAP
= 3,
34
YELL_MADR_DEATH
= 4,
35
};
36
37
enum
Spells
38
{
39
SPELL_METEOR_SLASH
= 45150,
40
SPELL_BURN
= 46394,
41
SPELL_STOMP
= 45185,
42
SPELL_BERSERK
= 26662,
43
SPELL_DUAL_WIELD
= 42459,
44
45
SPELL_INTRO_FROST_BLAST
= 45203,
46
SPELL_INTRO_FROSTBOLT
= 44843,
47
SPELL_INTRO_ENCAPSULATE
= 45665,
48
SPELL_INTRO_ENCAPSULATE_CHANELLING
= 45661
49
};
50
51
#define FELMYST 25038
52
53
class
boss_brutallus
:
public
CreatureScript
54
{
55
public
:
56
boss_brutallus
() :
CreatureScript
(
"boss_brutallus"
) { }
57
58
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
59
{
60
return
new
boss_brutallusAI
(creature);
61
}
62
63
struct
boss_brutallusAI
:
public
ScriptedAI
64
{
65
boss_brutallusAI
(
Creature
* creature) :
ScriptedAI
(creature)
66
{
67
instance
= creature->
GetInstanceScript
();
68
Intro
=
true
;
69
}
70
71
InstanceScript
*
instance
;
72
73
uint32
SlashTimer
;
74
uint32
BurnTimer
;
75
uint32
StompTimer
;
76
uint32
BerserkTimer
;
77
78
uint32
IntroPhase
;
79
uint32
IntroPhaseTimer
;
80
uint32
IntroFrostBoltTimer
;
81
82
bool
Intro
;
83
bool
IsIntro
;
84
bool
Enraged
;
85
86
void
Reset
()
OVERRIDE
87
{
88
SlashTimer
= 11000;
89
StompTimer
= 30000;
90
BurnTimer
= 60000;
91
BerserkTimer
= 360000;
92
93
IntroPhase
= 0;
94
IntroPhaseTimer
= 0;
95
IntroFrostBoltTimer
= 0;
96
97
IsIntro
=
false
;
98
Enraged
=
false
;
99
100
DoCast
(
me
,
SPELL_DUAL_WIELD
,
true
);
101
102
if
(
instance
)
103
instance
->SetData(
DATA_BRUTALLUS_EVENT
,
NOT_STARTED
);
104
}
105
106
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
107
{
108
Talk
(
YELL_AGGRO
);
109
110
if
(
instance
)
111
instance
->SetData(
DATA_BRUTALLUS_EVENT
,
IN_PROGRESS
);
112
}
113
114
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
115
{
116
Talk
(
YELL_KILL
);
117
}
118
119
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
120
{
121
Talk
(
YELL_DEATH
);
122
123
if
(
instance
)
124
{
125
instance
->SetData(
DATA_BRUTALLUS_EVENT
,
DONE
);
126
float
x, y, z;
127
me
->GetPosition(x, y, z);
128
me
->SummonCreature(
FELMYST
, x, y, z+30,
me
->GetOrientation(),
TempSummonType::TEMPSUMMON_MANUAL_DESPAWN
, 0);
129
}
130
}
131
132
void
EnterEvadeMode
()
OVERRIDE
133
{
134
if
(!
Intro
)
135
ScriptedAI::EnterEvadeMode
();
136
}
137
138
void
StartIntro
()
139
{
140
if
(!
Intro
||
IsIntro
)
141
return
;
142
Creature
* Madrigosa =
Unit::GetCreature
(*
me
,
instance
?
instance
->GetData64(
DATA_MADRIGOSA
) : 0);
143
if
(Madrigosa)
144
{
145
Madrigosa->
Respawn
();
146
Madrigosa->
setActive
(
true
);
147
IsIntro
=
true
;
148
Madrigosa->
SetMaxHealth
(
me
->GetMaxHealth());
149
Madrigosa->
SetHealth
(
me
->GetMaxHealth());
150
me
->SetFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NON_ATTACKABLE
);
151
me
->Attack(Madrigosa,
true
);
152
Madrigosa->
Attack
(
me
,
true
);
153
}
154
else
155
{
156
//Madrigosa not found, end intro
157
SF_LOG_ERROR
(
"scripts"
,
"Madrigosa was not found"
);
158
EndIntro
();
159
}
160
}
161
162
void
EndIntro
()
163
{
164
me
->RemoveFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NON_ATTACKABLE
);
165
Intro
=
false
;
166
IsIntro
=
false
;
167
}
168
169
void
AttackStart
(
Unit
* who)
OVERRIDE
170
{
171
if
(!who ||
Intro
||
IsIntro
)
172
return
;
173
ScriptedAI::AttackStart
(who);
174
}
175
176
void
DoIntro
()
177
{
178
Creature
* Madrigosa =
Unit::GetCreature
(*
me
,
instance
?
instance
->GetData64(
DATA_MADRIGOSA
) : 0);
179
if
(!Madrigosa)
180
return
;
181
182
switch
(
IntroPhase
)
183
{
184
case
0:
185
Madrigosa->
AI
()->
Talk
(
YELL_MADR_ICE_BARRIER
);
186
IntroPhaseTimer
= 7000;
187
++
IntroPhase
;
188
break
;
189
case
1:
190
me
->SetInFront(Madrigosa);
191
Madrigosa->
SetInFront
(
me
);
192
Madrigosa->
AI
()->
Talk
(
YELL_MADR_INTRO
,
me
);
193
IntroPhaseTimer
= 9000;
194
++
IntroPhase
;
195
break
;
196
case
2:
197
Talk
(
YELL_INTRO
, Madrigosa);
198
IntroPhaseTimer
= 13000;
199
++
IntroPhase
;
200
break
;
201
case
3:
202
DoCast
(
me
,
SPELL_INTRO_FROST_BLAST
);
203
Madrigosa->
SetDisableGravity
(
true
);
204
me
->AttackStop();
205
Madrigosa->
AttackStop
();
206
IntroFrostBoltTimer
= 3000;
207
IntroPhaseTimer
= 28000;
208
++
IntroPhase
;
209
break
;
210
case
4:
211
Talk
(
YELL_INTRO_BREAK_ICE
);
212
IntroPhaseTimer
= 6000;
213
++
IntroPhase
;
214
break
;
215
case
5:
216
Madrigosa->
CastSpell
(
me
,
SPELL_INTRO_ENCAPSULATE_CHANELLING
,
false
);
217
Madrigosa->
AI
()->
Talk
(
YELL_MADR_TRAP
);
218
DoCast
(
me
,
SPELL_INTRO_ENCAPSULATE
);
219
IntroPhaseTimer
= 11000;
220
++
IntroPhase
;
221
break
;
222
case
6:
223
Talk
(
YELL_INTRO_CHARGE
);
224
IntroPhaseTimer
= 5000;
225
++
IntroPhase
;
226
break
;
227
case
7:
228
me
->Kill(Madrigosa);
229
Madrigosa->
AI
()->
Talk
(
YELL_MADR_DEATH
);
230
me
->SetFullHealth();
231
me
->AttackStop();
232
IntroPhaseTimer
= 4000;
233
++
IntroPhase
;
234
break
;
235
case
8:
236
Talk
(
YELL_INTRO_KILL_MADRIGOSA
);
237
me
->SetOrientation(0.14f);
238
me
->StopMoving();
239
Madrigosa->
setDeathState
(
DeathState::CORPSE
);
240
IntroPhaseTimer
= 8000;
241
++
IntroPhase
;
242
break
;
243
case
9:
244
Talk
(
YELL_INTRO_TAUNT
);
245
IntroPhaseTimer
= 5000;
246
++
IntroPhase
;
247
break
;
248
case
10:
249
EndIntro
();
250
break
;
251
}
252
}
253
254
void
MoveInLineOfSight
(
Unit
* who)
OVERRIDE
255
256
{
257
if
(!
me
->IsValidAttackTarget(who))
258
return
;
259
if
(
instance
&&
Intro
)
260
instance
->SetData(
DATA_BRUTALLUS_EVENT
,
SPECIAL
);
261
262
if
(
Intro
&& !
IsIntro
)
263
StartIntro
();
264
if
(!
Intro
)
265
ScriptedAI::MoveInLineOfSight
(who);
266
}
267
268
void
UpdateAI
(
uint32
diff)
OVERRIDE
269
{
270
if
(
IsIntro
)
271
{
272
if
(
IntroPhaseTimer
<= diff)
273
DoIntro
();
274
else
IntroPhaseTimer
-= diff;
275
276
if
(
IntroPhase
== 3 + 1)
277
{
278
if
(
IntroFrostBoltTimer
<= diff)
279
{
280
if
(
Creature
* Madrigosa =
Unit::GetCreature
(*
me
,
instance
?
instance
->GetData64(
DATA_MADRIGOSA
) : 0))
281
{
282
Madrigosa->CastSpell(
me
,
SPELL_INTRO_FROSTBOLT
,
true
);
283
IntroFrostBoltTimer
= 2000;
284
}
285
}
else
IntroFrostBoltTimer
-= diff;
286
}
287
if
(!
UpdateVictim
())
288
return
;
289
DoMeleeAttackIfReady
();
290
}
291
292
if
(!
UpdateVictim
() ||
IsIntro
)
293
return
;
294
295
if
(
SlashTimer
<= diff)
296
{
297
DoCastVictim
(
SPELL_METEOR_SLASH
);
298
SlashTimer
= 11000;
299
}
else
SlashTimer
-= diff;
300
301
if
(
StompTimer
<= diff)
302
{
303
Talk
(
YELL_LOVE
);
304
DoCastVictim
(
SPELL_STOMP
);
305
StompTimer
= 30000;
306
}
else
StompTimer
-= diff;
307
308
if
(
BurnTimer
<= diff)
309
{
310
std::list<Unit*> targets;
311
SelectTargetList
(targets, 10,
SELECT_TARGET_RANDOM
, 100,
true
);
312
for
(std::list<Unit*>::const_iterator i = targets.begin(); i != targets.end(); ++i)
313
if
(!(*i)->HasAura(
SPELL_BURN
))
314
{
315
(*i)->CastSpell((*i),
SPELL_BURN
,
true
);
316
break
;
317
}
318
BurnTimer
= std::rand() % 180000 + 60000;
319
}
else
BurnTimer
-= diff;
320
321
if
(
BerserkTimer
< diff && !
Enraged
)
322
{
323
Talk
(
YELL_BERSERK
);
324
DoCast
(
me
,
SPELL_BERSERK
);
325
Enraged
=
true
;
326
}
else
BerserkTimer
-= diff;
327
328
DoMeleeAttackIfReady
();
329
}
330
};
331
};
332
333
void
AddSC_boss_brutallus
()
334
{
335
new
boss_brutallus
();
336
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
DONE
@ DONE
Definition
InstanceScript.h:49
SPECIAL
@ SPECIAL
Definition
InstanceScript.h:50
NOT_STARTED
@ NOT_STARTED
Definition
InstanceScript.h:46
SF_LOG_ERROR
#define SF_LOG_ERROR(filterType__,...)
Definition
Log.h:143
TempSummonType::TEMPSUMMON_MANUAL_DESPAWN
@ TEMPSUMMON_MANUAL_DESPAWN
Definition
Object.h:75
ScriptMgr.h
ScriptedCreature.h
DeathState::CORPSE
@ CORPSE
Definition
Unit.h:505
UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_NON_ATTACKABLE
Definition
Unit.h:626
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_balinda.cpp:19
Quotes
Quotes
Definition
boss_brutallus.cpp:17
YELL_INTRO
@ YELL_INTRO
Definition
boss_brutallus.cpp:18
YELL_MADR_DEATH
@ YELL_MADR_DEATH
Definition
boss_brutallus.cpp:34
YELL_INTRO_BREAK_ICE
@ YELL_INTRO_BREAK_ICE
Definition
boss_brutallus.cpp:19
YELL_MADR_INTRO
@ YELL_MADR_INTRO
Definition
boss_brutallus.cpp:31
YELL_AGGRO
@ YELL_AGGRO
Definition
boss_brutallus.cpp:24
YELL_MADR_ICE_BARRIER
@ YELL_MADR_ICE_BARRIER
Definition
boss_brutallus.cpp:30
YELL_MADR_ICE_BLOCK
@ YELL_MADR_ICE_BLOCK
Definition
boss_brutallus.cpp:32
YELL_KILL
@ YELL_KILL
Definition
boss_brutallus.cpp:25
YELL_DEATH
@ YELL_DEATH
Definition
boss_brutallus.cpp:28
YELL_BERSERK
@ YELL_BERSERK
Definition
boss_brutallus.cpp:27
YELL_INTRO_KILL_MADRIGOSA
@ YELL_INTRO_KILL_MADRIGOSA
Definition
boss_brutallus.cpp:21
YELL_INTRO_TAUNT
@ YELL_INTRO_TAUNT
Definition
boss_brutallus.cpp:22
YELL_LOVE
@ YELL_LOVE
Definition
boss_brutallus.cpp:26
YELL_INTRO_CHARGE
@ YELL_INTRO_CHARGE
Definition
boss_brutallus.cpp:20
YELL_MADR_TRAP
@ YELL_MADR_TRAP
Definition
boss_brutallus.cpp:33
SPELL_STOMP
@ SPELL_STOMP
Definition
boss_brutallus.cpp:41
SPELL_INTRO_FROST_BLAST
@ SPELL_INTRO_FROST_BLAST
Definition
boss_brutallus.cpp:45
SPELL_INTRO_ENCAPSULATE_CHANELLING
@ SPELL_INTRO_ENCAPSULATE_CHANELLING
Definition
boss_brutallus.cpp:48
SPELL_DUAL_WIELD
@ SPELL_DUAL_WIELD
Definition
boss_brutallus.cpp:43
SPELL_INTRO_ENCAPSULATE
@ SPELL_INTRO_ENCAPSULATE
Definition
boss_brutallus.cpp:47
SPELL_INTRO_FROSTBOLT
@ SPELL_INTRO_FROSTBOLT
Definition
boss_brutallus.cpp:46
SPELL_BURN
@ SPELL_BURN
Definition
boss_brutallus.cpp:40
SPELL_BERSERK
@ SPELL_BERSERK
Definition
boss_brutallus.cpp:42
SPELL_METEOR_SLASH
@ SPELL_METEOR_SLASH
Definition
boss_brutallus.cpp:39
AddSC_boss_brutallus
void AddSC_boss_brutallus()
Definition
boss_brutallus.cpp:333
FELMYST
#define FELMYST
Definition
boss_brutallus.cpp:51
SPELL_BERSERK
#define SPELL_BERSERK
Definition
boss_four_horsemen.cpp:62
SPELL_METEOR_SLASH
@ SPELL_METEOR_SLASH
Definition
boss_pit_lord_argaloth.cpp:18
SPELL_STOMP
@ SPELL_STOMP
Definition
chapter5.cpp:158
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::MoveInLineOfSight
virtual void MoveInLineOfSight(Unit *)
Definition
CreatureAI.cpp:114
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode()
Definition
CreatureAI.cpp:130
Creature
Definition
Creature.h:427
Creature::Respawn
void Respawn(bool force=false)
Definition
Creature.cpp:1513
Creature::setDeathState
void setDeathState(DeathState s) OVERRIDE
Definition
Creature.cpp:1453
Creature::AI
CreatureAI * AI() const
Definition
Creature.h:483
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
InstanceScript
Definition
InstanceScript.h:123
UnitAI::SelectTargetList
void SelectTargetList(std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition
UnitAI.cpp:71
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
Unit::CastSpell
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
Definition
UnitCombat.cpp:324
Unit::SetHealth
void SetHealth(uint32 val)
Definition
Unit.cpp:5162
Unit::GetCreature
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition
Unit.cpp:4905
Unit::Attack
bool Attack(Unit *victim, bool meleeAttack)
Definition
UnitCombatState.cpp:74
Unit::SetDisableGravity
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition
Unit.cpp:9156
Unit::SetMaxHealth
void SetMaxHealth(uint32 val)
Definition
Unit.cpp:5206
Unit::SetInFront
void SetInFront(WorldObject const *target)
Definition
Unit.cpp:9108
Unit::AttackStop
bool AttackStop()
Definition
UnitCombatState.cpp:183
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
WorldObject::setActive
void setActive(bool isActiveObject)
Definition
Object.cpp:1542
boss_brutallus
Definition
boss_brutallus.cpp:54
boss_brutallus::boss_brutallus
boss_brutallus()
Definition
boss_brutallus.cpp:56
boss_brutallus::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_brutallus.cpp:58
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
ScriptedAI::AttackStart
void AttackStart(Unit *) OVERRIDE
Definition
ScriptedCreature.cpp:118
boss_brutallus::boss_brutallusAI
Definition
boss_brutallus.cpp:64
boss_brutallus::boss_brutallusAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_brutallus.cpp:268
boss_brutallus::boss_brutallusAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_brutallus.cpp:119
boss_brutallus::boss_brutallusAI::SlashTimer
uint32 SlashTimer
Definition
boss_brutallus.cpp:73
boss_brutallus::boss_brutallusAI::Intro
bool Intro
Definition
boss_brutallus.cpp:82
boss_brutallus::boss_brutallusAI::IntroFrostBoltTimer
uint32 IntroFrostBoltTimer
Definition
boss_brutallus.cpp:80
boss_brutallus::boss_brutallusAI::IntroPhase
uint32 IntroPhase
Definition
boss_brutallus.cpp:78
boss_brutallus::boss_brutallusAI::AttackStart
void AttackStart(Unit *who) OVERRIDE
Definition
boss_brutallus.cpp:169
boss_brutallus::boss_brutallusAI::StartIntro
void StartIntro()
Definition
boss_brutallus.cpp:138
boss_brutallus::boss_brutallusAI::IsIntro
bool IsIntro
Definition
boss_brutallus.cpp:83
boss_brutallus::boss_brutallusAI::DoIntro
void DoIntro()
Definition
boss_brutallus.cpp:176
boss_brutallus::boss_brutallusAI::IntroPhaseTimer
uint32 IntroPhaseTimer
Definition
boss_brutallus.cpp:79
boss_brutallus::boss_brutallusAI::BurnTimer
uint32 BurnTimer
Definition
boss_brutallus.cpp:74
boss_brutallus::boss_brutallusAI::Enraged
bool Enraged
Definition
boss_brutallus.cpp:84
boss_brutallus::boss_brutallusAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_brutallus.cpp:114
boss_brutallus::boss_brutallusAI::EnterEvadeMode
void EnterEvadeMode() OVERRIDE
Definition
boss_brutallus.cpp:132
boss_brutallus::boss_brutallusAI::StompTimer
uint32 StompTimer
Definition
boss_brutallus.cpp:75
boss_brutallus::boss_brutallusAI::instance
InstanceScript * instance
Definition
boss_brutallus.cpp:71
boss_brutallus::boss_brutallusAI::Reset
void Reset() OVERRIDE
Definition
boss_brutallus.cpp:86
boss_brutallus::boss_brutallusAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_brutallus.cpp:106
boss_brutallus::boss_brutallusAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *who) OVERRIDE
Definition
boss_brutallus.cpp:254
boss_brutallus::boss_brutallusAI::BerserkTimer
uint32 BerserkTimer
Definition
boss_brutallus.cpp:76
boss_brutallus::boss_brutallusAI::EndIntro
void EndIntro()
Definition
boss_brutallus.cpp:162
boss_brutallus::boss_brutallusAI::boss_brutallusAI
boss_brutallusAI(Creature *creature)
Definition
boss_brutallus.cpp:65
sunwell_plateau.h
DATA_MADRIGOSA
@ DATA_MADRIGOSA
Definition
sunwell_plateau.h:27
DATA_BRUTALLUS_EVENT
@ DATA_BRUTALLUS_EVENT
Definition
sunwell_plateau.h:13
src
server
scripts
EasternKingdoms
SunwellPlateau
boss_brutallus.cpp
Generated on
for Project SkyFire Core by
1.17.0