Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_drakos.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 "
oculus.h
"
9
10
enum
Spells
11
{
12
SPELL_MAGIC_PULL
= 51336,
13
SPELL_THUNDERING_STOMP
= 50774,
14
SPELL_UNSTABLE_SPHERE_PASSIVE
= 50756,
15
SPELL_UNSTABLE_SPHERE_PULSE
= 50757,
16
SPELL_UNSTABLE_SPHERE_TIMER
= 50758,
17
NPC_UNSTABLE_SPHERE
= 28166,
18
};
19
20
enum
Yells
21
{
22
SAY_AGGRO
= 0,
23
SAY_KILL
= 1,
24
SAY_DEATH
= 2,
25
SAY_PULL
= 3,
26
SAY_STOMP
= 4
27
};
28
29
enum
DrakosAchievement
30
{
31
ACHIEV_TIMED_START_EVENT
= 18153,
32
};
33
34
enum
DrakosEvents
35
{
36
EVENT_MAGIC_PULL
= 1,
37
EVENT_STOMP
,
38
EVENT_BOMB_SUMMON
39
};
40
41
class
boss_drakos
:
public
CreatureScript
42
{
43
public
:
44
boss_drakos
() :
CreatureScript
(
"boss_drakos"
) { }
45
46
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
47
{
48
return
new
boss_drakosAI
(creature);
49
}
50
51
struct
boss_drakosAI
:
public
BossAI
52
{
53
boss_drakosAI
(
Creature
* creature) :
BossAI
(creature,
DATA_DRAKOS_EVENT
) { }
54
55
void
Reset
()
OVERRIDE
56
{
57
_Reset
();
58
59
events
.ScheduleEvent(
EVENT_MAGIC_PULL
, 15000);
60
events
.ScheduleEvent(
EVENT_STOMP
, 17000);
61
events
.ScheduleEvent(
EVENT_BOMB_SUMMON
, 2000);
62
63
postPull
=
false
;
64
}
65
66
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
67
{
68
_EnterCombat
();
69
Talk
(
SAY_AGGRO
);
70
}
71
72
void
UpdateAI
(
uint32
diff)
OVERRIDE
73
{
74
//Return since we have no target
75
if
(!
UpdateVictim
())
76
return
;
77
78
events
.Update(diff);
79
80
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
81
return
;
82
83
while
(
uint32
eventId =
events
.ExecuteEvent())
84
{
85
switch
(eventId)
86
{
87
case
EVENT_BOMB_SUMMON
:
88
{
89
Position
pPosition;
90
me
->GetPosition(&pPosition);
91
92
for
(
uint8
i = 0; i <= (
postPull
? 3 : 0); i++)
93
{
94
me
->GetRandomNearPosition(pPosition,
float
(std::rand() % 10));
95
me
->SummonCreature(
NPC_UNSTABLE_SPHERE
, pPosition);
96
}
97
}
98
events
.ScheduleEvent(
EVENT_BOMB_SUMMON
, 2000);
99
break
;
100
case
EVENT_MAGIC_PULL
:
101
DoCast
(
SPELL_MAGIC_PULL
);
102
postPull
=
true
;
103
events
.ScheduleEvent(
EVENT_MAGIC_PULL
, 15000);
104
break
;
105
case
EVENT_STOMP
:
106
Talk
(
SAY_STOMP
);
107
DoCast
(
SPELL_THUNDERING_STOMP
);
108
events
.ScheduleEvent(
EVENT_STOMP
, 17000);
109
break
;
110
}
111
}
112
113
DoMeleeAttackIfReady
();
114
}
115
116
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
117
{
118
_JustDied
();
119
120
Talk
(
SAY_DEATH
);
121
122
// start achievement timer (kill Eregos within 20 min)
123
instance
->DoStartTimedAchievement(
ACHIEVEMENT_TIMED_TYPE_EVENT
,
ACHIEV_TIMED_START_EVENT
);
124
}
125
126
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
127
{
128
Talk
(
SAY_KILL
);
129
}
130
private
:
131
bool
postPull
;
132
};
133
};
134
135
class
npc_unstable_sphere
:
public
CreatureScript
136
{
137
public
:
138
npc_unstable_sphere
() :
CreatureScript
(
"npc_unstable_sphere"
) { }
139
140
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
141
{
142
return
new
npc_unstable_sphereAI
(creature);
143
}
144
145
struct
npc_unstable_sphereAI
:
public
ScriptedAI
146
{
147
npc_unstable_sphereAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
148
149
void
Reset
()
OVERRIDE
150
{
151
me
->SetReactState(
REACT_PASSIVE
);
152
me
->GetMotionMaster()->MoveRandom(40.0f);
153
154
me
->AddAura(
SPELL_UNSTABLE_SPHERE_PASSIVE
,
me
);
155
me
->AddAura(
SPELL_UNSTABLE_SPHERE_TIMER
,
me
);
156
157
pulseTimer
= 3000;
158
deathTimer
= 19000;
159
}
160
161
void
UpdateAI
(
uint32
diff)
OVERRIDE
162
{
163
if
(
pulseTimer
<= diff)
164
{
165
DoCast
(
SPELL_UNSTABLE_SPHERE_PULSE
);
166
pulseTimer
= 3*
IN_MILLISECONDS
;
167
}
else
pulseTimer
-= diff;
168
169
if
(
deathTimer
<= diff)
170
me
->DisappearAndDie();
171
else
deathTimer
-= diff;
172
}
173
private
:
174
uint32
pulseTimer
;
175
uint32
deathTimer
;
176
};
177
};
178
179
void
AddSC_boss_drakos
()
180
{
181
new
boss_drakos
();
182
new
npc_unstable_sphere
();
183
}
Spells
Spells
Definition
BattlegroundIC.h:645
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:125
ACHIEVEMENT_TIMED_TYPE_EVENT
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition
DBCEnums.h:158
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
ScriptMgr.h
ScriptedCreature.h
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
REACT_PASSIVE
@ REACT_PASSIVE
Definition
Unit.h:1156
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SAY_KILL
#define SAY_KILL
Definition
boss_commander_kolurg.cpp:29
SAY_DEATH
@ SAY_DEATH
Definition
boss_drakos.cpp:24
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_drakos.cpp:22
SAY_KILL
@ SAY_KILL
Definition
boss_drakos.cpp:23
SAY_STOMP
@ SAY_STOMP
Definition
boss_drakos.cpp:26
SAY_PULL
@ SAY_PULL
Definition
boss_drakos.cpp:25
SPELL_UNSTABLE_SPHERE_PULSE
@ SPELL_UNSTABLE_SPHERE_PULSE
Definition
boss_drakos.cpp:15
SPELL_THUNDERING_STOMP
@ SPELL_THUNDERING_STOMP
Definition
boss_drakos.cpp:13
NPC_UNSTABLE_SPHERE
@ NPC_UNSTABLE_SPHERE
Definition
boss_drakos.cpp:17
SPELL_UNSTABLE_SPHERE_PASSIVE
@ SPELL_UNSTABLE_SPHERE_PASSIVE
Definition
boss_drakos.cpp:14
SPELL_UNSTABLE_SPHERE_TIMER
@ SPELL_UNSTABLE_SPHERE_TIMER
Definition
boss_drakos.cpp:16
SPELL_MAGIC_PULL
@ SPELL_MAGIC_PULL
Definition
boss_drakos.cpp:12
AddSC_boss_drakos
void AddSC_boss_drakos()
Definition
boss_drakos.cpp:179
DrakosAchievement
DrakosAchievement
Definition
boss_drakos.cpp:30
ACHIEV_TIMED_START_EVENT
@ ACHIEV_TIMED_START_EVENT
Definition
boss_drakos.cpp:31
DrakosEvents
DrakosEvents
Definition
boss_drakos.cpp:35
EVENT_MAGIC_PULL
@ EVENT_MAGIC_PULL
Definition
boss_drakos.cpp:36
EVENT_BOMB_SUMMON
@ EVENT_BOMB_SUMMON
Definition
boss_drakos.cpp:38
EVENT_STOMP
@ EVENT_STOMP
Definition
boss_drakos.cpp:37
SPELL_THUNDERING_STOMP
@ SPELL_THUNDERING_STOMP
Definition
boss_forgemaster_garfrost.cpp:29
EVENT_STOMP
@ EVENT_STOMP
Definition
boss_razorgore.cpp:46
BossAI::instance
InstanceScript *const instance
Definition
ScriptedCreature.h:383
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
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
Unit
Definition
Unit.h:1367
boss_drakos
Definition
boss_drakos.cpp:42
boss_drakos::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_drakos.cpp:46
boss_drakos::boss_drakos
boss_drakos()
Definition
boss_drakos.cpp:44
npc_unstable_sphere
Definition
boss_drakos.cpp:136
npc_unstable_sphere::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_drakos.cpp:140
npc_unstable_sphere::npc_unstable_sphere
npc_unstable_sphere()
Definition
boss_drakos.cpp:138
oculus.h
DATA_DRAKOS_EVENT
@ DATA_DRAKOS_EVENT
Definition
oculus.h:11
ACHIEV_TIMED_START_EVENT
@ ACHIEV_TIMED_START_EVENT
Definition
onyxias_lair.h:55
Position
Definition
Object.h:274
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
Yells
Definition
boss_illidan.cpp:256
boss_drakos::boss_drakosAI
Definition
boss_drakos.cpp:52
boss_drakos::boss_drakosAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_drakos.cpp:126
boss_drakos::boss_drakosAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_drakos.cpp:116
boss_drakos::boss_drakosAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_drakos.cpp:72
boss_drakos::boss_drakosAI::boss_drakosAI
boss_drakosAI(Creature *creature)
Definition
boss_drakos.cpp:53
boss_drakos::boss_drakosAI::postPull
bool postPull
Definition
boss_drakos.cpp:131
boss_drakos::boss_drakosAI::Reset
void Reset() OVERRIDE
Definition
boss_drakos.cpp:55
boss_drakos::boss_drakosAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_drakos.cpp:66
npc_unstable_sphere::npc_unstable_sphereAI
Definition
boss_drakos.cpp:146
npc_unstable_sphere::npc_unstable_sphereAI::Reset
void Reset() OVERRIDE
Definition
boss_drakos.cpp:149
npc_unstable_sphere::npc_unstable_sphereAI::deathTimer
uint32 deathTimer
Definition
boss_drakos.cpp:175
npc_unstable_sphere::npc_unstable_sphereAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_drakos.cpp:161
npc_unstable_sphere::npc_unstable_sphereAI::pulseTimer
uint32 pulseTimer
Definition
boss_drakos.cpp:174
npc_unstable_sphere::npc_unstable_sphereAI::npc_unstable_sphereAI
npc_unstable_sphereAI(Creature *creature)
Definition
boss_drakos.cpp:147
src
server
scripts
Northrend
Nexus
Oculus
boss_drakos.cpp
Generated on
for Project SkyFire Core by
1.17.0