Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_toravon.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 "
vault_of_archavon.h
"
9
10
enum
Spells
11
{
12
// Toravon
13
SPELL_FREEZING_GROUND
= 72090,
// don't know cd... using 20 secs.
14
SPELL_FROZEN_ORB
= 72091,
15
SPELL_WHITEOUT
= 72034,
// Every 38 sec. cast. (after SPELL_FROZEN_ORB)
16
SPELL_FROZEN_MALLET
= 71993,
17
18
// Frost Warder
19
SPELL_FROST_BLAST
= 72123,
// don't know cd... using 20 secs.
20
SPELL_FROZEN_MALLET_2
= 72122,
21
22
// Frozen Orb
23
SPELL_FROZEN_ORB_DMG
= 72081,
// priodic dmg aura
24
SPELL_FROZEN_ORB_AURA
= 72067,
// make visible
25
26
// Frozen Orb Stalker
27
SPELL_FROZEN_ORB_SUMMON
= 72093,
// summon orb
28
};
29
30
enum
Events
31
{
32
EVENT_FREEZING_GROUND
= 1,
33
EVENT_FROZEN_ORB
= 2,
34
EVENT_WHITEOUT
= 3,
35
36
EVENT_FROST_BLAST
= 4,
37
};
38
39
enum
Creatures
40
{
41
NPC_FROZEN_ORB
= 38456
// 1 in 10 mode and 3 in 25 mode
42
};
43
44
class
boss_toravon
:
public
CreatureScript
45
{
46
public
:
47
boss_toravon
() :
CreatureScript
(
"boss_toravon"
) { }
48
49
struct
boss_toravonAI
:
public
BossAI
50
{
51
boss_toravonAI
(
Creature
* creature) :
BossAI
(creature,
DATA_TORAVON
)
52
{
53
}
54
55
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
56
{
57
DoCast
(
me
,
SPELL_FROZEN_MALLET
);
58
59
events
.ScheduleEvent(
EVENT_FROZEN_ORB
, 11000);
60
events
.ScheduleEvent(
EVENT_WHITEOUT
, 13000);
61
events
.ScheduleEvent(
EVENT_FREEZING_GROUND
, 15000);
62
63
_EnterCombat
();
64
}
65
66
void
UpdateAI
(
uint32
diff)
OVERRIDE
67
{
68
if
(!
UpdateVictim
())
69
return
;
70
71
events
.Update(diff);
72
73
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
74
return
;
75
76
while
(
uint32
eventId =
events
.ExecuteEvent())
77
{
78
switch
(eventId)
79
{
80
case
EVENT_FROZEN_ORB
:
81
me
->CastCustomSpell(
SPELL_FROZEN_ORB
,
SPELLVALUE_MAX_TARGETS
, 1,
me
);
82
events
.ScheduleEvent(
EVENT_FROZEN_ORB
, 38000);
83
break
;
84
case
EVENT_WHITEOUT
:
85
DoCast
(
me
,
SPELL_WHITEOUT
);
86
events
.ScheduleEvent(
EVENT_WHITEOUT
, 38000);
87
break
;
88
case
EVENT_FREEZING_GROUND
:
89
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 1))
90
DoCast
(target,
SPELL_FREEZING_GROUND
);
91
events
.ScheduleEvent(
EVENT_FREEZING_GROUND
, 20000);
92
break
;
93
default
:
94
break
;
95
}
96
}
97
98
DoMeleeAttackIfReady
();
99
}
100
};
101
102
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
103
{
104
return
new
boss_toravonAI
(creature);
105
}
106
};
107
108
/*######
109
## Mob Frost Warder
110
######*/
111
class
npc_frost_warder
:
public
CreatureScript
112
{
113
public
:
114
npc_frost_warder
() :
CreatureScript
(
"npc_frost_warder"
) { }
115
116
struct
npc_frost_warderAI
:
public
ScriptedAI
117
{
118
npc_frost_warderAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
119
120
void
Reset
()
OVERRIDE
121
{
122
events
.Reset();
123
}
124
125
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
126
{
127
DoZoneInCombat
();
128
129
DoCast
(
me
,
SPELL_FROZEN_MALLET_2
);
130
131
events
.ScheduleEvent(
EVENT_FROST_BLAST
, 5000);
132
}
133
134
void
UpdateAI
(
uint32
diff)
OVERRIDE
135
{
136
if
(!
UpdateVictim
())
137
return
;
138
139
events
.Update(diff);
140
141
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
142
return
;
143
144
if
(
events
.ExecuteEvent() ==
EVENT_FROST_BLAST
)
145
{
146
DoCastVictim
(
SPELL_FROST_BLAST
);
147
events
.ScheduleEvent(
EVENT_FROST_BLAST
, 20000);
148
}
149
150
DoMeleeAttackIfReady
();
151
}
152
153
private
:
154
EventMap
events
;
155
};
156
157
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
158
{
159
return
new
npc_frost_warderAI
(creature);
160
}
161
};
162
163
/*######
164
## Mob Frozen Orb
165
######*/
166
class
npc_frozen_orb
:
public
CreatureScript
167
{
168
public
:
169
npc_frozen_orb
() :
CreatureScript
(
"npc_frozen_orb"
) { }
170
171
struct
npc_frozen_orbAI
:
public
ScriptedAI
172
{
173
npc_frozen_orbAI
(
Creature
* creature) :
ScriptedAI
(creature)
174
{
175
}
176
177
void
Reset
()
OVERRIDE
178
{
179
done
=
false
;
180
killTimer
= 60000;
// if after this time there is no victim -> destroy!
181
}
182
183
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
184
{
185
DoZoneInCombat
();
186
}
187
188
void
UpdateAI
(
uint32
diff)
OVERRIDE
189
{
190
if
(!
done
)
191
{
192
DoCast
(
me
,
SPELL_FROZEN_ORB_AURA
,
true
);
193
DoCast
(
me
,
SPELL_FROZEN_ORB_DMG
,
true
);
194
done
=
true
;
195
}
196
197
if
(
killTimer
<= diff)
198
{
199
if
(!
UpdateVictim
())
200
me
->DespawnOrUnsummon();
201
killTimer
= 10000;
202
}
203
else
204
killTimer
-= diff;
205
}
206
207
private
:
208
uint32
killTimer
;
209
bool
done
;
210
};
211
212
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
213
{
214
return
new
npc_frozen_orbAI
(creature);
215
}
216
};
217
218
/*######
219
## Mob Frozen Orb Stalker
220
######*/
221
class
npc_frozen_orb_stalker
:
public
CreatureScript
222
{
223
public
:
224
npc_frozen_orb_stalker
() :
CreatureScript
(
"npc_frozen_orb_stalker"
) { }
225
226
struct
npc_frozen_orb_stalkerAI
:
public
ScriptedAI
227
{
228
npc_frozen_orb_stalkerAI
(
Creature
* creature) :
ScriptedAI
(creature)
229
{
230
creature->
SetVisible
(
false
);
231
creature->
SetFlag
(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
|
UNIT_FLAG_NON_ATTACKABLE
|
UNIT_FLAG_DISABLE_MOVE
);
232
creature->
SetReactState
(
REACT_PASSIVE
);
233
234
instance
= creature->
GetInstanceScript
();
235
spawned
=
false
;
236
237
SetCombatMovement
(
false
);
238
}
239
240
void
UpdateAI
(
uint32
/*diff*/
)
OVERRIDE
241
{
242
if
(
spawned
)
243
return
;
244
245
spawned
=
true
;
246
Unit
* toravon =
me
->GetCreature(*
me
,
instance
?
instance
->GetData64(
DATA_TORAVON
) : 0);
247
if
(!toravon)
248
return
;
249
250
uint8
num_orbs =
RAID_MODE
(1, 3);
251
for
(
uint8
i = 0; i < num_orbs; ++i)
252
{
253
Position
pos;
254
me
->GetNearPoint(toravon, pos.
m_positionX
, pos.
m_positionY
, pos.
m_positionZ
, 0.0f, 10.0f, 0.0f);
255
me
->SetPosition(pos);
256
DoCast
(
me
,
SPELL_FROZEN_ORB_SUMMON
);
257
}
258
}
259
260
private
:
261
InstanceScript
*
instance
;
262
bool
spawned
;
263
};
264
265
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
266
{
267
return
new
npc_frozen_orb_stalkerAI
(creature);
268
}
269
};
270
271
void
AddSC_boss_toravon
()
272
{
273
new
boss_toravon
();
274
new
npc_frost_warder
();
275
new
npc_frozen_orb
();
276
new
npc_frozen_orb_stalker
();
277
}
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
ScriptMgr.h
ScriptedCreature.h
SPELLVALUE_MAX_TARGETS
@ SPELLVALUE_MAX_TARGETS
Definition
Unit.h:118
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
REACT_PASSIVE
@ REACT_PASSIVE
Definition
Unit.h:1156
UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_NON_ATTACKABLE
Definition
Unit.h:626
UNIT_FLAG_DISABLE_MOVE
@ UNIT_FLAG_DISABLE_MOVE
Definition
Unit.h:627
UNIT_FLAG_NOT_SELECTABLE
@ UNIT_FLAG_NOT_SELECTABLE
Definition
Unit.h:650
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
Creatures
Creatures
Definition
alterac_valley.cpp:28
Events
Events
Definition
alterac_valley.cpp:40
SPELL_FROST_BLAST
@ SPELL_FROST_BLAST
Definition
boss_kelthuzad.cpp:73
NPC_FROZEN_ORB
@ NPC_FROZEN_ORB
Definition
boss_toravon.cpp:41
SPELL_FROZEN_MALLET_2
@ SPELL_FROZEN_MALLET_2
Definition
boss_toravon.cpp:20
SPELL_FROZEN_MALLET
@ SPELL_FROZEN_MALLET
Definition
boss_toravon.cpp:16
SPELL_WHITEOUT
@ SPELL_WHITEOUT
Definition
boss_toravon.cpp:15
SPELL_FROZEN_ORB
@ SPELL_FROZEN_ORB
Definition
boss_toravon.cpp:14
SPELL_FROZEN_ORB_DMG
@ SPELL_FROZEN_ORB_DMG
Definition
boss_toravon.cpp:23
SPELL_FREEZING_GROUND
@ SPELL_FREEZING_GROUND
Definition
boss_toravon.cpp:13
SPELL_FROST_BLAST
@ SPELL_FROST_BLAST
Definition
boss_toravon.cpp:19
SPELL_FROZEN_ORB_SUMMON
@ SPELL_FROZEN_ORB_SUMMON
Definition
boss_toravon.cpp:27
SPELL_FROZEN_ORB_AURA
@ SPELL_FROZEN_ORB_AURA
Definition
boss_toravon.cpp:24
EVENT_FROST_BLAST
@ EVENT_FROST_BLAST
Definition
boss_toravon.cpp:36
EVENT_FROZEN_ORB
@ EVENT_FROZEN_ORB
Definition
boss_toravon.cpp:33
EVENT_WHITEOUT
@ EVENT_WHITEOUT
Definition
boss_toravon.cpp:34
EVENT_FREEZING_GROUND
@ EVENT_FREEZING_GROUND
Definition
boss_toravon.cpp:32
AddSC_boss_toravon
void AddSC_boss_toravon()
Definition
boss_toravon.cpp:271
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::DoZoneInCombat
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition
CreatureAI.cpp:33
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
Creature
Definition
Creature.h:427
Creature::SetReactState
void SetReactState(ReactStates st)
Definition
Creature.h:460
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
EventMap
Definition
CreatureAIImpl.h:304
InstanceScript
Definition
InstanceScript.h:123
Object::SetFlag
void SetFlag(uint16 index, uint32 newFlag)
Definition
Object.cpp:1261
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
Unit::SetVisible
void SetVisible(bool x)
Definition
Unit.cpp:4163
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_toravon
Definition
boss_toravon.cpp:45
boss_toravon::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_toravon.cpp:102
boss_toravon::boss_toravon
boss_toravon()
Definition
boss_toravon.cpp:47
npc_frost_warder
Definition
boss_toravon.cpp:112
npc_frost_warder::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_toravon.cpp:157
npc_frost_warder::npc_frost_warder
npc_frost_warder()
Definition
boss_toravon.cpp:114
npc_frozen_orb_stalker
Definition
boss_toravon.cpp:222
npc_frozen_orb_stalker::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_toravon.cpp:265
npc_frozen_orb_stalker::npc_frozen_orb_stalker
npc_frozen_orb_stalker()
Definition
boss_toravon.cpp:224
npc_frozen_orb
Definition
boss_toravon.cpp:167
npc_frozen_orb::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_toravon.cpp:212
npc_frozen_orb::npc_frozen_orb
npc_frozen_orb()
Definition
boss_toravon.cpp:169
Position
Definition
Object.h:274
Position::m_positionZ
float m_positionZ
Definition
Object.h:289
Position::m_positionX
float m_positionX
Definition
Object.h:287
Position::m_positionY
float m_positionY
Definition
Object.h:288
ScriptedAI::SetCombatMovement
void SetCombatMovement(bool allowMovement)
Definition
ScriptedCreature.cpp:394
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::RAID_MODE
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition
ScriptedCreature.h:310
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_toravon::boss_toravonAI
Definition
boss_toravon.cpp:50
boss_toravon::boss_toravonAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_toravon.cpp:66
boss_toravon::boss_toravonAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_toravon.cpp:55
boss_toravon::boss_toravonAI::boss_toravonAI
boss_toravonAI(Creature *creature)
Definition
boss_toravon.cpp:51
npc_frost_warder::npc_frost_warderAI
Definition
boss_toravon.cpp:117
npc_frost_warder::npc_frost_warderAI::npc_frost_warderAI
npc_frost_warderAI(Creature *creature)
Definition
boss_toravon.cpp:118
npc_frost_warder::npc_frost_warderAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_toravon.cpp:134
npc_frost_warder::npc_frost_warderAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_toravon.cpp:125
npc_frost_warder::npc_frost_warderAI::Reset
void Reset() OVERRIDE
Definition
boss_toravon.cpp:120
npc_frost_warder::npc_frost_warderAI::events
EventMap events
Definition
boss_toravon.cpp:154
npc_frozen_orb::npc_frozen_orbAI
Definition
boss_toravon.cpp:172
npc_frozen_orb::npc_frozen_orbAI::killTimer
uint32 killTimer
Definition
boss_toravon.cpp:208
npc_frozen_orb::npc_frozen_orbAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_toravon.cpp:183
npc_frozen_orb::npc_frozen_orbAI::done
bool done
Definition
boss_toravon.cpp:209
npc_frozen_orb::npc_frozen_orbAI::npc_frozen_orbAI
npc_frozen_orbAI(Creature *creature)
Definition
boss_toravon.cpp:173
npc_frozen_orb::npc_frozen_orbAI::Reset
void Reset() OVERRIDE
Definition
boss_toravon.cpp:177
npc_frozen_orb::npc_frozen_orbAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_toravon.cpp:188
npc_frozen_orb_stalker::npc_frozen_orb_stalkerAI
Definition
boss_toravon.cpp:227
npc_frozen_orb_stalker::npc_frozen_orb_stalkerAI::UpdateAI
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_toravon.cpp:240
npc_frozen_orb_stalker::npc_frozen_orb_stalkerAI::spawned
bool spawned
Definition
boss_toravon.cpp:262
npc_frozen_orb_stalker::npc_frozen_orb_stalkerAI::instance
InstanceScript * instance
Definition
boss_toravon.cpp:261
npc_frozen_orb_stalker::npc_frozen_orb_stalkerAI::npc_frozen_orb_stalkerAI
npc_frozen_orb_stalkerAI(Creature *creature)
Definition
boss_toravon.cpp:228
vault_of_archavon.h
DATA_TORAVON
@ DATA_TORAVON
Definition
vault_of_archavon.h:16
src
server
scripts
Northrend
VaultOfArchavon
boss_toravon.cpp
Generated on
for Project SkyFire Core by
1.17.0