Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_alizabal.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 "
Player.h
"
9
#include "
ObjectAccessor.h
"
10
#include "
baradin_hold.h
"
11
12
enum
Texts
13
{
14
SAY_INTRO
= 1,
15
SAY_AGGRO
= 2,
16
SAY_HATE
= 3,
17
SAY_SKEWER
= 4,
18
SAY_SKEWER_ANNOUNCE
= 5,
19
SAY_BLADE_STORM
= 6,
20
SAY_SLAY
= 10,
21
SAY_DEATH
= 12
22
};
23
24
enum
Spells
25
{
26
SPELL_BLADE_DANCE
= 105784,
27
SPELL_BLADE_DANCE_DUMMY
= 105828,
28
SPELL_SEETHING_HATE
= 105067,
29
SPELL_SKEWER
= 104936,
30
SPELL_BERSERK
= 47008
31
};
32
33
enum
Actions
34
{
35
ACTION_INTRO
= 1
36
};
37
38
enum
Points
39
{
40
POINT_STORM
= 1
41
};
42
43
enum
Events
44
{
45
EVENT_RANDOM_CAST
= 1,
46
EVENT_STOP_STORM
= 2,
47
EVENT_MOVE_STORM
= 3,
48
EVENT_CAST_STORM
= 4
49
};
50
51
class
at_alizabal_intro
:
public
AreaTriggerScript
52
{
53
public
:
54
at_alizabal_intro
() :
AreaTriggerScript
(
"at_alizabal_intro"
) { }
55
56
bool
OnTrigger
(
Player
* player,
AreaTriggerEntry
const
*
/*areaTrigger*/
)
57
{
58
if
(
InstanceScript
* instance = player->
GetInstanceScript
())
59
if
(
Creature
* alizabal =
ObjectAccessor::GetCreature
(*player, instance->GetData64(
DATA_ALIZABAL
)))
60
alizabal->AI()->DoAction(
ACTION_INTRO
);
61
return
true
;
62
}
63
};
64
65
class
boss_alizabal
:
public
CreatureScript
66
{
67
public
:
68
boss_alizabal
() :
CreatureScript
(
"boss_alizabal"
) { }
69
70
struct
boss_alizabalAI
:
public
BossAI
71
{
72
boss_alizabalAI
(
Creature
* creature) :
BossAI
(creature,
DATA_ALIZABAL
)
73
{
74
_intro
=
false
;
75
}
76
77
void
Reset
()
OVERRIDE
78
{
79
_Reset
();
80
_hate
=
false
;
81
_skewer
=
false
;
82
}
83
84
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
85
{
86
_EnterCombat
();
87
Talk
(
SAY_AGGRO
);
88
instance
->SendEncounterUnit(
ENCOUNTER_FRAME_ENGAGE
,
me
);
89
events
.ScheduleEvent(
EVENT_RANDOM_CAST
, 10000);
90
}
91
92
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
93
{
94
_JustDied
();
95
Talk
(
SAY_DEATH
);
96
instance
->SendEncounterUnit(
ENCOUNTER_FRAME_DISENGAGE
,
me
);
97
}
98
99
void
KilledUnit
(
Unit
* who)
OVERRIDE
100
{
101
if
(who->GetTypeId() ==
TypeID::TYPEID_PLAYER
)
102
Talk
(
SAY_SLAY
);
103
}
104
105
void
EnterEvadeMode
()
OVERRIDE
106
{
107
instance
->SendEncounterUnit(
ENCOUNTER_FRAME_DISENGAGE
,
me
);
108
me
->GetMotionMaster()->MoveTargetedHome();
109
_DespawnAtEvade
();
110
}
111
112
void
DoAction
(
int32
action)
OVERRIDE
113
{
114
switch
(action)
115
{
116
case
ACTION_INTRO
:
117
if
(!
_intro
)
118
{
119
Talk
(
SAY_INTRO
);
120
_intro
=
true
;
121
}
122
break
;
123
}
124
}
125
126
void
MovementInform
(
uint32
/*type*/
,
uint32
pointId)
OVERRIDE
127
{
128
switch
(pointId)
129
{
130
case
POINT_STORM
:
131
events
.ScheduleEvent(
EVENT_CAST_STORM
, 1);
132
break
;
133
}
134
}
135
136
void
UpdateAI
(
uint32
diff)
OVERRIDE
137
{
138
if
(!
UpdateVictim
())
139
return
;
140
141
events
.Update(diff);
142
143
while
(
uint32
eventId =
events
.ExecuteEvent())
144
{
145
switch
(eventId)
146
{
147
case
EVENT_RANDOM_CAST
:
148
switch
(std::rand() % 1)
149
{
150
case
0:
151
if
(!
_skewer
)
152
{
153
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_TOPAGGRO
, 0))
154
{
155
DoCast
(target,
SPELL_SKEWER
,
true
);
156
Talk
(
SAY_SKEWER
);
157
Talk
(
SAY_SKEWER_ANNOUNCE
, target);
158
}
159
_skewer
=
true
;
160
events
.ScheduleEvent(
EVENT_RANDOM_CAST
, std::rand() % 10000 + 7000);
161
}
162
else
if
(!
_hate
)
163
{
164
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0,
NonTankTargetSelector
(
me
)))
165
{
166
DoCast
(target,
SPELL_SEETHING_HATE
,
true
);
167
Talk
(
SAY_HATE
);
168
}
169
_hate
=
true
;
170
events
.ScheduleEvent(
EVENT_RANDOM_CAST
, std::rand() % 10000 + 7000);
171
}
172
else
if
(
_hate
&&
_skewer
)
173
{
174
Talk
(
SAY_BLADE_STORM
);
175
DoCastAOE
(
SPELL_BLADE_DANCE_DUMMY
);
176
DoCastAOE
(
SPELL_BLADE_DANCE
);
177
events
.ScheduleEvent(
EVENT_RANDOM_CAST
, 21000);
178
events
.ScheduleEvent(
EVENT_MOVE_STORM
, 4050);
179
events
.ScheduleEvent(
EVENT_STOP_STORM
, 13000);
180
}
181
break
;
182
case
1:
183
if
(!
_hate
)
184
{
185
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0,
NonTankTargetSelector
(
me
)))
186
{
187
DoCast
(target,
SPELL_SEETHING_HATE
,
true
);
188
Talk
(
SAY_HATE
);
189
}
190
_hate
=
true
;
191
events
.ScheduleEvent(
EVENT_RANDOM_CAST
, std::rand() % 10000 + 7000);
192
}
193
else
if
(!
_skewer
)
194
{
195
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_TOPAGGRO
, 0))
196
{
197
DoCast
(target,
SPELL_SKEWER
,
true
);
198
Talk
(
SAY_SKEWER
);
199
Talk
(
SAY_SKEWER_ANNOUNCE
, target);
200
}
201
_skewer
=
true
;
202
events
.ScheduleEvent(
EVENT_RANDOM_CAST
, std::rand() % 10000 + 7000);
203
}
204
else
if
(
_hate
&&
_skewer
)
205
{
206
Talk
(
SAY_BLADE_STORM
);
207
DoCastAOE
(
SPELL_BLADE_DANCE_DUMMY
);
208
DoCastAOE
(
SPELL_BLADE_DANCE
);
209
events
.ScheduleEvent(
EVENT_RANDOM_CAST
, 21000);
210
events
.ScheduleEvent(
EVENT_MOVE_STORM
, 4050);
211
events
.ScheduleEvent(
EVENT_STOP_STORM
, 13000);
212
}
213
break
;
214
}
215
break
;
216
case
EVENT_MOVE_STORM
:
217
me
->SetSpeed(
MOVE_RUN
, 4.0f);
218
me
->SetSpeed(
MOVE_WALK
, 4.0f);
219
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0,
NonTankTargetSelector
(
me
)))
220
me
->GetMotionMaster()->MovePoint(
POINT_STORM
, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
221
events
.ScheduleEvent(
EVENT_MOVE_STORM
, 4050);
222
break
;
223
case
EVENT_STOP_STORM
:
224
me
->RemoveAura(
SPELL_BLADE_DANCE
);
225
me
->RemoveAura(
SPELL_BLADE_DANCE_DUMMY
);
226
me
->SetSpeed(
MOVE_WALK
, 1.0f);
227
me
->SetSpeed(
MOVE_RUN
, 1.14f);
228
me
->GetMotionMaster()->MoveChase(
me
->GetVictim());
229
_hate
=
false
;
230
_skewer
=
false
;
231
break
;
232
case
EVENT_CAST_STORM
:
233
DoCastAOE
(
SPELL_BLADE_DANCE
);
234
break
;
235
}
236
}
237
238
DoMeleeAttackIfReady
();
239
}
240
241
private
:
242
bool
_intro
;
243
bool
_hate
;
244
bool
_skewer
;
245
};
246
247
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
248
{
249
return
GetBaradinHoldAI<boss_alizabalAI>
(creature);
250
}
251
};
252
253
void
AddSC_boss_alizabal
()
254
{
255
new
boss_alizabal
();
256
new
at_alizabal_intro
();
257
}
Actions
Actions
Definition
BattlegroundIC.h:186
Spells
Spells
Definition
BattlegroundIC.h:645
int32
std::int32_t int32
Definition
Define.h:73
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_DISENGAGE
Definition
InstanceScript.h:34
ENCOUNTER_FRAME_ENGAGE
@ ENCOUNTER_FRAME_ENGAGE
Definition
InstanceScript.h:33
TypeID::TYPEID_PLAYER
@ TYPEID_PLAYER
Definition
Object.h:55
ObjectAccessor.h
Player.h
ScriptMgr.h
ScriptedCreature.h
Points
Points
Definition
ScriptedEscortAI.cpp:19
MOVE_RUN
@ MOVE_RUN
Definition
Unit.h:556
MOVE_WALK
@ MOVE_WALK
Definition
Unit.h:555
SELECT_TARGET_TOPAGGRO
@ SELECT_TARGET_TOPAGGRO
Definition
UnitAI.h:24
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Events
Events
Definition
alterac_valley.cpp:40
baradin_hold.h
GetBaradinHoldAI
CreatureAI * GetBaradinHoldAI(Creature *creature)
Definition
baradin_hold.h:43
DATA_ALIZABAL
@ DATA_ALIZABAL
Definition
baradin_hold.h:21
AddSC_boss_alizabal
void AddSC_boss_alizabal()
Definition
boss_alizabal.cpp:253
ACTION_INTRO
@ ACTION_INTRO
Definition
boss_alizabal.cpp:35
POINT_STORM
@ POINT_STORM
Definition
boss_alizabal.cpp:40
SPELL_BLADE_DANCE
@ SPELL_BLADE_DANCE
Definition
boss_alizabal.cpp:26
SPELL_SKEWER
@ SPELL_SKEWER
Definition
boss_alizabal.cpp:29
SPELL_BLADE_DANCE_DUMMY
@ SPELL_BLADE_DANCE_DUMMY
Definition
boss_alizabal.cpp:27
SPELL_SEETHING_HATE
@ SPELL_SEETHING_HATE
Definition
boss_alizabal.cpp:28
Texts
Texts
Definition
boss_alizabal.cpp:13
SAY_DEATH
@ SAY_DEATH
Definition
boss_alizabal.cpp:21
SAY_HATE
@ SAY_HATE
Definition
boss_alizabal.cpp:16
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_alizabal.cpp:15
SAY_BLADE_STORM
@ SAY_BLADE_STORM
Definition
boss_alizabal.cpp:19
SAY_SKEWER_ANNOUNCE
@ SAY_SKEWER_ANNOUNCE
Definition
boss_alizabal.cpp:18
SAY_SLAY
@ SAY_SLAY
Definition
boss_alizabal.cpp:20
SAY_SKEWER
@ SAY_SKEWER
Definition
boss_alizabal.cpp:17
SAY_INTRO
@ SAY_INTRO
Definition
boss_alizabal.cpp:14
EVENT_MOVE_STORM
@ EVENT_MOVE_STORM
Definition
boss_alizabal.cpp:47
EVENT_CAST_STORM
@ EVENT_CAST_STORM
Definition
boss_alizabal.cpp:48
EVENT_RANDOM_CAST
@ EVENT_RANDOM_CAST
Definition
boss_alizabal.cpp:45
EVENT_STOP_STORM
@ EVENT_STOP_STORM
Definition
boss_alizabal.cpp:46
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SPELL_BERSERK
#define SPELL_BERSERK
Definition
boss_four_horsemen.cpp:62
AreaTriggerScript::AreaTriggerScript
AreaTriggerScript(const char *name)
Definition
ScriptMgr.cpp:1448
BossAI::instance
InstanceScript *const instance
Definition
ScriptedCreature.h:383
BossAI::_DespawnAtEvade
void _DespawnAtEvade()
Definition
ScriptedCreature.cpp:590
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::_JustDied
void _JustDied()
Definition
ScriptedCreature.cpp:474
BossAI::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:462
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
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
ObjectAccessor::GetCreature
static Creature * GetCreature(WorldObject const &u, uint64 guid)
Definition
ObjectAccessor.cpp:209
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::DoCastAOE
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:176
Unit
Definition
Unit.h:1367
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
at_alizabal_intro
Definition
boss_alizabal.cpp:52
at_alizabal_intro::at_alizabal_intro
at_alizabal_intro()
Definition
boss_alizabal.cpp:54
at_alizabal_intro::OnTrigger
bool OnTrigger(Player *player, AreaTriggerEntry const *)
Definition
boss_alizabal.cpp:56
boss_alizabal
Definition
boss_alizabal.cpp:66
boss_alizabal::boss_alizabal
boss_alizabal()
Definition
boss_alizabal.cpp:68
boss_alizabal::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_alizabal.cpp:247
AreaTriggerEntry
Definition
DBCStructure.h:716
NonTankTargetSelector
Definition
UnitAI.h:96
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
boss_alizabal::boss_alizabalAI::_skewer
bool _skewer
Definition
boss_alizabal.cpp:244
boss_alizabal::boss_alizabalAI::MovementInform
void MovementInform(uint32, uint32 pointId) OVERRIDE
Definition
boss_alizabal.cpp:126
boss_alizabal::boss_alizabalAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_alizabal.cpp:84
boss_alizabal::boss_alizabalAI::_intro
bool _intro
Definition
boss_alizabal.cpp:242
boss_alizabal::boss_alizabalAI::KilledUnit
void KilledUnit(Unit *who) OVERRIDE
Definition
boss_alizabal.cpp:99
boss_alizabal::boss_alizabalAI::EnterEvadeMode
void EnterEvadeMode() OVERRIDE
Definition
boss_alizabal.cpp:105
boss_alizabal::boss_alizabalAI::boss_alizabalAI
boss_alizabalAI(Creature *creature)
Definition
boss_alizabal.cpp:72
boss_alizabal::boss_alizabalAI::_hate
bool _hate
Definition
boss_alizabal.cpp:243
boss_alizabal::boss_alizabalAI::Reset
void Reset() OVERRIDE
Definition
boss_alizabal.cpp:77
boss_alizabal::boss_alizabalAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_alizabal.cpp:136
boss_alizabal::boss_alizabalAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_alizabal.cpp:92
boss_alizabal::boss_alizabalAI::DoAction
void DoAction(int32 action) OVERRIDE
Definition
boss_alizabal.cpp:112
src
server
scripts
EasternKingdoms
BaradinHold
boss_alizabal.cpp
Generated on
for Project SkyFire Core by
1.17.0