Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_anetheron.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 "
hyjal.h
"
9
#include "
hyjal_trash.h
"
10
11
enum
Spells
12
{
13
SPELL_CARRION_SWARM
= 31306,
14
SPELL_SLEEP
= 31298,
15
SPELL_VAMPIRIC_AURA
= 38196,
16
SPELL_INFERNO
= 31299,
17
SPELL_IMMOLATION
= 31303,
18
SPELL_INFERNO_EFFECT
= 31302,
19
};
20
21
enum
Texts
22
{
23
SAY_ONDEATH
= 0,
24
SAY_ONSLAY
= 1,
25
SAY_SWARM
= 2,
26
SAY_SLEEP
= 3,
27
SAY_INFERNO
= 4,
28
SAY_ONAGGRO
= 5,
29
};
30
31
class
boss_anetheron
:
public
CreatureScript
32
{
33
public
:
34
boss_anetheron
() :
CreatureScript
(
"boss_anetheron"
) { }
35
36
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
37
{
38
return
new
boss_anetheronAI
(creature);
39
}
40
41
struct
boss_anetheronAI
:
public
hyjal_trashAI
42
{
43
boss_anetheronAI
(
Creature
* creature) :
hyjal_trashAI
(creature)
44
{
45
instance
= creature->
GetInstanceScript
();
46
go
=
false
;
47
}
48
49
uint32
SwarmTimer
;
50
uint32
SleepTimer
;
51
uint32
AuraTimer
;
52
uint32
InfernoTimer
;
53
bool
go
;
54
55
void
Reset
()
OVERRIDE
56
{
57
damageTaken
= 0;
58
SwarmTimer
= 45000;
59
SleepTimer
= 60000;
60
AuraTimer
= 5000;
61
InfernoTimer
= 45000;
62
63
if
(
instance
&&
IsEvent
)
64
instance
->SetData(
DATA_ANETHERONEVENT
,
NOT_STARTED
);
65
}
66
67
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
68
{
69
if
(
instance
&&
IsEvent
)
70
instance
->SetData(
DATA_ANETHERONEVENT
,
IN_PROGRESS
);
71
Talk
(
SAY_ONAGGRO
);
72
}
73
74
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
75
{
76
Talk
(
SAY_ONSLAY
);
77
}
78
79
void
WaypointReached
(
uint32
waypointId)
OVERRIDE
80
{
81
if
(waypointId == 7 &&
instance
)
82
{
83
Unit
* target =
Unit::GetUnit
(*
me
,
instance
->GetData64(
DATA_JAINAPROUDMOORE
));
84
if
(target && target->
IsAlive
())
85
me
->AddThreat(target, 0.0f);
86
}
87
}
88
89
void
JustDied
(
Unit
* killer)
OVERRIDE
90
{
91
hyjal_trashAI::JustDied
(killer);
92
if
(
instance
&&
IsEvent
)
93
instance
->SetData(
DATA_ANETHERONEVENT
,
DONE
);
94
Talk
(
SAY_ONDEATH
);
95
}
96
97
void
UpdateAI
(
uint32
diff)
OVERRIDE
98
{
99
if
(
IsEvent
)
100
{
101
//Must update npc_escortAI
102
npc_escortAI::UpdateAI
(diff);
103
if
(!
go
)
104
{
105
go
=
true
;
106
if
(
instance
)
107
{
108
AddWaypoint
(0, 4896.08f, -1576.35f, 1333.65f);
109
AddWaypoint
(1, 4898.68f, -1615.02f, 1329.48f);
110
AddWaypoint
(2, 4907.12f, -1667.08f, 1321.00f);
111
AddWaypoint
(3, 4963.18f, -1699.35f, 1340.51f);
112
AddWaypoint
(4, 4989.16f, -1716.67f, 1335.74f);
113
AddWaypoint
(5, 5026.27f, -1736.89f, 1323.02f);
114
AddWaypoint
(6, 5037.77f, -1770.56f, 1324.36f);
115
AddWaypoint
(7, 5067.23f, -1789.95f, 1321.17f);
116
Start
(
false
,
true
);
117
SetDespawnAtEnd
(
false
);
118
}
119
}
120
}
121
122
//Return since we have no target
123
if
(!
UpdateVictim
())
124
return
;
125
126
if
(
SwarmTimer
<= diff)
127
{
128
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
129
DoCast
(target,
SPELL_CARRION_SWARM
);
130
131
SwarmTimer
= std::rand() % 60000 + 45000;
132
Talk
(
SAY_SWARM
);
133
}
else
SwarmTimer
-= diff;
134
135
if
(
SleepTimer
<= diff)
136
{
137
for
(
uint8
i = 0; i < 3; ++i)
138
{
139
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
140
target->CastSpell(target,
SPELL_SLEEP
,
true
);
141
}
142
SleepTimer
= 60000;
143
Talk
(
SAY_SLEEP
);
144
}
else
SleepTimer
-= diff;
145
if
(
AuraTimer
<= diff)
146
{
147
DoCast
(
me
,
SPELL_VAMPIRIC_AURA
,
true
);
148
AuraTimer
= std::rand() % 20000 + 10000;
149
}
else
AuraTimer
-= diff;
150
if
(
InfernoTimer
<= diff)
151
{
152
DoCast
(
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
),
SPELL_INFERNO
);
153
InfernoTimer
= 45000;
154
Talk
(
SAY_INFERNO
);
155
}
else
InfernoTimer
-= diff;
156
157
DoMeleeAttackIfReady
();
158
}
159
};
160
};
161
162
class
npc_towering_infernal
:
public
CreatureScript
163
{
164
public
:
165
npc_towering_infernal
() :
CreatureScript
(
"npc_towering_infernal"
) { }
166
167
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
168
{
169
return
new
npc_towering_infernalAI
(creature);
170
}
171
172
struct
npc_towering_infernalAI
:
public
ScriptedAI
173
{
174
npc_towering_infernalAI
(
Creature
* creature) :
ScriptedAI
(creature)
175
{
176
instance
= creature->
GetInstanceScript
();
177
if
(
instance
)
178
AnetheronGUID
=
instance
->GetData64(
DATA_ANETHERON
);
179
}
180
181
uint32
ImmolationTimer
;
182
uint32
CheckTimer
;
183
uint64
AnetheronGUID
;
184
InstanceScript
*
instance
;
185
186
void
Reset
()
OVERRIDE
187
{
188
DoCast
(
me
,
SPELL_INFERNO_EFFECT
);
189
ImmolationTimer
= 5000;
190
CheckTimer
= 5000;
191
}
192
193
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
194
{
195
}
196
197
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
198
{
199
}
200
201
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
202
{
203
}
204
205
void
MoveInLineOfSight
(
Unit
* who)
OVERRIDE
206
207
{
208
if
(
me
->IsWithinDist(who, 50) && !
me
->IsInCombat() &&
me
->IsValidAttackTarget(who))
209
AttackStart
(who);
210
}
211
212
void
UpdateAI
(
uint32
diff)
OVERRIDE
213
{
214
if
(
CheckTimer
<= diff)
215
{
216
if
(
AnetheronGUID
)
217
{
218
Creature
* boss =
Unit::GetCreature
((*
me
),
AnetheronGUID
);
219
if
(!boss || (boss && boss->
isDead
()))
220
{
221
me
->setDeathState(
DeathState::JUST_DIED
);
222
me
->RemoveCorpse();
223
return
;
224
}
225
}
226
CheckTimer
= 5000;
227
}
else
CheckTimer
-= diff;
228
229
//Return since we have no target
230
if
(!
UpdateVictim
())
231
return
;
232
233
if
(
ImmolationTimer
<= diff)
234
{
235
DoCast
(
me
,
SPELL_IMMOLATION
);
236
ImmolationTimer
= 5000;
237
}
else
ImmolationTimer
-= diff;
238
239
DoMeleeAttackIfReady
();
240
}
241
};
242
};
243
244
void
AddSC_boss_anetheron
()
245
{
246
new
boss_anetheron
();
247
new
npc_towering_infernal
();
248
}
Spells
Spells
Definition
BattlegroundIC.h:645
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
ScriptMgr.h
ScriptedCreature.h
DeathState::JUST_DIED
@ JUST_DIED
Definition
Unit.h:504
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Texts
Texts
Definition
boss_alizabal.cpp:13
SPELL_IMMOLATION
@ SPELL_IMMOLATION
Definition
boss_anetheron.cpp:17
SPELL_INFERNO_EFFECT
@ SPELL_INFERNO_EFFECT
Definition
boss_anetheron.cpp:18
SPELL_SLEEP
@ SPELL_SLEEP
Definition
boss_anetheron.cpp:14
SPELL_CARRION_SWARM
@ SPELL_CARRION_SWARM
Definition
boss_anetheron.cpp:13
SPELL_VAMPIRIC_AURA
@ SPELL_VAMPIRIC_AURA
Definition
boss_anetheron.cpp:15
SPELL_INFERNO
@ SPELL_INFERNO
Definition
boss_anetheron.cpp:16
SAY_INFERNO
@ SAY_INFERNO
Definition
boss_anetheron.cpp:27
SAY_ONAGGRO
@ SAY_ONAGGRO
Definition
boss_anetheron.cpp:28
SAY_SLEEP
@ SAY_SLEEP
Definition
boss_anetheron.cpp:26
SAY_SWARM
@ SAY_SWARM
Definition
boss_anetheron.cpp:25
SAY_ONSLAY
@ SAY_ONSLAY
Definition
boss_anetheron.cpp:24
SAY_ONDEATH
@ SAY_ONDEATH
Definition
boss_anetheron.cpp:23
AddSC_boss_anetheron
void AddSC_boss_anetheron()
Definition
boss_anetheron.cpp:244
SPELL_INFERNO
@ SPELL_INFERNO
Definition
boss_baron_geddon.cpp:25
SPELL_SLEEP
@ SPELL_SLEEP
Definition
boss_high_inquisitor_fairbanks.cpp:23
SAY_SLEEP
@ SAY_SLEEP
Definition
boss_kelris.cpp:16
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
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
Unit
Definition
Unit.h:1367
Unit::IsAlive
bool IsAlive() const
Definition
Unit.h:2032
Unit::GetCreature
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition
Unit.cpp:4905
Unit::GetUnit
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition
Unit.cpp:4895
Unit::isDead
bool isDead() const
Definition
Unit.h:2040
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_anetheron
Definition
boss_anetheron.cpp:32
boss_anetheron::boss_anetheron
boss_anetheron()
Definition
boss_anetheron.cpp:34
boss_anetheron::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_anetheron.cpp:36
npc_towering_infernal
Definition
boss_anetheron.cpp:163
npc_towering_infernal::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_anetheron.cpp:167
npc_towering_infernal::npc_towering_infernal
npc_towering_infernal()
Definition
boss_anetheron.cpp:165
hyjal.h
DATA_ANETHERONEVENT
@ DATA_ANETHERONEVENT
Definition
hyjal.h:16
DATA_JAINAPROUDMOORE
@ DATA_JAINAPROUDMOORE
Definition
hyjal.h:21
DATA_ANETHERON
@ DATA_ANETHERON
Definition
hyjal.h:15
hyjal_trash.h
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_anetheron::boss_anetheronAI
Definition
boss_anetheron.cpp:42
boss_anetheron::boss_anetheronAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_anetheron.cpp:74
boss_anetheron::boss_anetheronAI::InfernoTimer
uint32 InfernoTimer
Definition
boss_anetheron.cpp:52
boss_anetheron::boss_anetheronAI::go
bool go
Definition
boss_anetheron.cpp:53
boss_anetheron::boss_anetheronAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_anetheron.cpp:67
boss_anetheron::boss_anetheronAI::JustDied
void JustDied(Unit *killer) OVERRIDE
Definition
boss_anetheron.cpp:89
boss_anetheron::boss_anetheronAI::boss_anetheronAI
boss_anetheronAI(Creature *creature)
Definition
boss_anetheron.cpp:43
boss_anetheron::boss_anetheronAI::AuraTimer
uint32 AuraTimer
Definition
boss_anetheron.cpp:51
boss_anetheron::boss_anetheronAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_anetheron.cpp:97
boss_anetheron::boss_anetheronAI::SwarmTimer
uint32 SwarmTimer
Definition
boss_anetheron.cpp:49
boss_anetheron::boss_anetheronAI::WaypointReached
void WaypointReached(uint32 waypointId) OVERRIDE
Definition
boss_anetheron.cpp:79
boss_anetheron::boss_anetheronAI::Reset
void Reset() OVERRIDE
Definition
boss_anetheron.cpp:55
boss_anetheron::boss_anetheronAI::SleepTimer
uint32 SleepTimer
Definition
boss_anetheron.cpp:50
hyjal_trashAI::JustDied
void JustDied(Unit *)
Definition
hyjal_trash.cpp:386
hyjal_trashAI::damageTaken
uint32 damageTaken
Definition
hyjal_trash.h:34
hyjal_trashAI::instance
InstanceScript * instance
Definition
hyjal_trash.h:25
hyjal_trashAI::IsEvent
bool IsEvent
Definition
hyjal_trash.h:26
hyjal_trashAI::hyjal_trashAI
hyjal_trashAI(Creature *creature)
Definition
hyjal_trash.cpp:164
npc_escortAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
ScriptedEscortAI.cpp:209
npc_escortAI::SetDespawnAtEnd
void SetDespawnAtEnd(bool despawn)
Definition
ScriptedEscortAI.h:90
npc_escortAI::Start
void Start(bool isActiveAttacker=true, bool run=false, uint64 playerGUID=0, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition
ScriptedEscortAI.cpp:420
npc_escortAI::AddWaypoint
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)
Definition
ScriptedEscortAI.cpp:367
npc_towering_infernal::npc_towering_infernalAI
Definition
boss_anetheron.cpp:173
npc_towering_infernal::npc_towering_infernalAI::npc_towering_infernalAI
npc_towering_infernalAI(Creature *creature)
Definition
boss_anetheron.cpp:174
npc_towering_infernal::npc_towering_infernalAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_anetheron.cpp:197
npc_towering_infernal::npc_towering_infernalAI::ImmolationTimer
uint32 ImmolationTimer
Definition
boss_anetheron.cpp:181
npc_towering_infernal::npc_towering_infernalAI::instance
InstanceScript * instance
Definition
boss_anetheron.cpp:184
npc_towering_infernal::npc_towering_infernalAI::CheckTimer
uint32 CheckTimer
Definition
boss_anetheron.cpp:182
npc_towering_infernal::npc_towering_infernalAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_anetheron.cpp:212
npc_towering_infernal::npc_towering_infernalAI::AnetheronGUID
uint64 AnetheronGUID
Definition
boss_anetheron.cpp:183
npc_towering_infernal::npc_towering_infernalAI::Reset
void Reset() OVERRIDE
Definition
boss_anetheron.cpp:186
npc_towering_infernal::npc_towering_infernalAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_anetheron.cpp:193
npc_towering_infernal::npc_towering_infernalAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_anetheron.cpp:201
npc_towering_infernal::npc_towering_infernalAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *who) OVERRIDE
Definition
boss_anetheron.cpp:205
src
server
scripts
Kalimdor
CavernsOfTime
BattleForMountHyjal
boss_anetheron.cpp
Generated on
for Project SkyFire Core by
1.17.0