Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_koralon.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 "
SpellAuraEffects.h
"
9
#include "
SpellScript.h
"
10
#include "
vault_of_archavon.h
"
11
12
enum
Events
13
{
14
// Koralon
15
EVENT_BURNING_BREATH
= 1,
16
EVENT_BURNING_FURY
= 2,
17
EVENT_FLAME_CINDER
= 3,
18
EVENT_METEOR_FISTS
= 4,
19
20
// Flame Warder
21
EVENT_FW_LAVA_BIRST
= 5,
22
EVENT_FW_METEOR_FISTS
= 6
23
};
24
25
enum
Spells
26
{
27
// Spells Koralon
28
SPELL_BURNING_BREATH
= 66665,
29
SPELL_BURNING_FURY
= 66721,
30
SPELL_FLAME_CINDER_A
= 66684,
31
SPELL_FLAME_CINDER_B
= 66681,
// don't know the real relation to SPELL_FLAME_CINDER_A atm.
32
SPELL_METEOR_FISTS
= 66725,
33
SPELL_METEOR_FISTS_DAMAGE
= 66765,
34
35
// Spells Flame Warder
36
SPELL_FW_LAVA_BIRST
= 66813,
37
SPELL_FW_METEOR_FISTS
= 66808,
38
SPELL_FW_METEOR_FISTS_DAMAGE
= 66809
39
};
40
41
class
boss_koralon
:
public
CreatureScript
42
{
43
public
:
44
boss_koralon
() :
CreatureScript
(
"boss_koralon"
) { }
45
46
struct
boss_koralonAI
:
public
BossAI
47
{
48
boss_koralonAI
(
Creature
* creature) :
BossAI
(creature,
DATA_KORALON
)
49
{
50
}
51
52
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
53
{
54
DoCast
(
me
,
SPELL_BURNING_FURY
);
55
56
events
.ScheduleEvent(
EVENT_BURNING_FURY
, 20000);
57
events
.ScheduleEvent(
EVENT_BURNING_BREATH
, 15000);
// 1st after 15sec, then every 45sec
58
events
.ScheduleEvent(
EVENT_METEOR_FISTS
, 75000);
// 1st after 75sec, then every 45sec
59
events
.ScheduleEvent(
EVENT_FLAME_CINDER
, 30000);
60
61
_EnterCombat
();
62
}
63
64
void
UpdateAI
(
uint32
diff)
OVERRIDE
65
{
66
if
(!
UpdateVictim
())
67
return
;
68
69
events
.Update(diff);
70
71
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
72
return
;
73
74
while
(
uint32
eventId =
events
.ExecuteEvent())
75
{
76
switch
(eventId)
77
{
78
case
EVENT_BURNING_FURY
:
79
DoCast
(
me
,
SPELL_BURNING_FURY
);
80
events
.ScheduleEvent(
EVENT_BURNING_FURY
, 20000);
81
break
;
82
case
EVENT_BURNING_BREATH
:
83
DoCast
(
me
,
SPELL_BURNING_BREATH
);
84
events
.ScheduleEvent(
EVENT_BURNING_BREATH
, 45000);
85
break
;
86
case
EVENT_METEOR_FISTS
:
87
DoCast
(
me
,
SPELL_METEOR_FISTS
);
88
events
.ScheduleEvent(
EVENT_METEOR_FISTS
, 45000);
89
break
;
90
case
EVENT_FLAME_CINDER
:
91
DoCast
(
me
,
SPELL_FLAME_CINDER_A
);
92
events
.ScheduleEvent(
EVENT_FLAME_CINDER
, 30000);
93
break
;
94
default
:
95
break
;
96
}
97
}
98
99
DoMeleeAttackIfReady
();
100
}
101
};
102
103
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
104
{
105
return
new
boss_koralonAI
(creature);
106
}
107
};
108
109
/*######
110
## Npc Flame Warder
111
######*/
112
class
npc_flame_warder
:
public
CreatureScript
113
{
114
public
:
115
npc_flame_warder
() :
CreatureScript
(
"npc_flame_warder"
) { }
116
117
struct
npc_flame_warderAI
:
public
ScriptedAI
118
{
119
npc_flame_warderAI
(
Creature
* creature) :
ScriptedAI
(creature)
120
{
121
}
122
123
void
Reset
()
OVERRIDE
124
{
125
events
.Reset();
126
}
127
128
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
129
{
130
DoZoneInCombat
();
131
132
events
.ScheduleEvent(
EVENT_FW_LAVA_BIRST
, 5000);
133
events
.ScheduleEvent(
EVENT_FW_METEOR_FISTS
, 10000);
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_FW_LAVA_BIRST
:
148
DoCastVictim
(
SPELL_FW_LAVA_BIRST
);
149
events
.ScheduleEvent(
EVENT_FW_LAVA_BIRST
, 15000);
150
break
;
151
case
EVENT_FW_METEOR_FISTS
:
152
DoCast
(
me
,
SPELL_FW_METEOR_FISTS
);
153
events
.ScheduleEvent(
EVENT_FW_METEOR_FISTS
, 20000);
154
break
;
155
default
:
156
break
;
157
}
158
}
159
160
DoMeleeAttackIfReady
();
161
}
162
163
private
:
164
EventMap
events
;
165
};
166
167
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
168
{
169
return
new
npc_flame_warderAI
(creature);
170
}
171
};
172
173
class
spell_koralon_meteor_fists
:
public
SpellScriptLoader
174
{
175
public
:
176
spell_koralon_meteor_fists
() :
SpellScriptLoader
(
"spell_koralon_meteor_fists"
) { }
177
178
class
spell_koralon_meteor_fists_AuraScript
:
public
AuraScript
179
{
180
PrepareAuraScript
(
spell_koralon_meteor_fists_AuraScript
);
181
182
bool
Validate
(
SpellInfo
const
*
/*spellInfo*/
)
OVERRIDE
183
{
184
if
(!
sSpellMgr
->GetSpellInfo(
SPELL_METEOR_FISTS_DAMAGE
))
185
return
false
;
186
return
true
;
187
}
188
189
void
TriggerFists
(
AuraEffect
const
* aurEff,
ProcEventInfo
& eventInfo)
190
{
191
PreventDefaultAction
();
192
GetTarget
()->
CastSpell
(eventInfo.
GetProcTarget
(),
SPELL_METEOR_FISTS_DAMAGE
,
true
, NULL, aurEff);
193
}
194
195
void
Register
()
OVERRIDE
196
{
197
OnEffectProc
+=
AuraEffectProcFn
(
spell_koralon_meteor_fists_AuraScript::TriggerFists
,
EFFECT_0
,
SPELL_AURA_DUMMY
);
198
}
199
};
200
201
AuraScript
*
GetAuraScript
() const
OVERRIDE
202
{
203
return
new
spell_koralon_meteor_fists_AuraScript
();
204
}
205
};
206
207
class
spell_koralon_meteor_fists_damage
:
public
SpellScriptLoader
208
{
209
public
:
210
spell_koralon_meteor_fists_damage
() :
SpellScriptLoader
(
"spell_koralon_meteor_fists_damage"
) { }
211
212
class
spell_koralon_meteor_fists_damage_SpellScript
:
public
SpellScript
213
{
214
PrepareSpellScript
(
spell_koralon_meteor_fists_damage_SpellScript
);
215
216
bool
Load
()
OVERRIDE
217
{
218
_chainTargets
= 0;
219
return
true
;
220
}
221
222
void
FilterTargets
(std::list<WorldObject*>& targets)
223
{
224
_chainTargets
= targets.size();
225
}
226
227
void
CalculateSplitDamage
()
228
{
229
if
(
_chainTargets
)
230
SetHitDamage
(
GetHitDamage
() / (
_chainTargets
+ 1));
231
}
232
233
void
Register
()
OVERRIDE
234
{
235
OnObjectAreaTargetSelect
+=
SpellObjectAreaTargetSelectFn
(
spell_koralon_meteor_fists_damage_SpellScript::FilterTargets
,
EFFECT_0
,
TARGET_UNIT_TARGET_ENEMY
);
236
OnHit
+=
SpellHitFn
(
spell_koralon_meteor_fists_damage_SpellScript::CalculateSplitDamage
);
237
}
238
239
private
:
240
uint8
_chainTargets
;
241
};
242
243
SpellScript
*
GetSpellScript
() const
OVERRIDE
244
{
245
return
new
spell_koralon_meteor_fists_damage_SpellScript
();
246
}
247
};
248
249
class
spell_flame_warder_meteor_fists
:
public
SpellScriptLoader
250
{
251
public
:
252
spell_flame_warder_meteor_fists
() :
SpellScriptLoader
(
"spell_flame_warder_meteor_fists"
) { }
253
254
class
spell_flame_warder_meteor_fists_AuraScript
:
public
AuraScript
255
{
256
PrepareAuraScript
(
spell_flame_warder_meteor_fists_AuraScript
);
257
258
bool
Validate
(
SpellInfo
const
*
/*spellInfo*/
)
OVERRIDE
259
{
260
if
(!
sSpellMgr
->GetSpellInfo(
SPELL_FW_METEOR_FISTS_DAMAGE
))
261
return
false
;
262
return
true
;
263
}
264
265
void
TriggerFists
(
AuraEffect
const
* aurEff,
ProcEventInfo
& eventInfo)
266
{
267
PreventDefaultAction
();
268
GetTarget
()->
CastSpell
(eventInfo.
GetProcTarget
(),
SPELL_FW_METEOR_FISTS_DAMAGE
,
true
, NULL, aurEff);
269
}
270
271
void
Register
()
OVERRIDE
272
{
273
OnEffectProc
+=
AuraEffectProcFn
(
spell_flame_warder_meteor_fists_AuraScript::TriggerFists
,
EFFECT_0
,
SPELL_AURA_DUMMY
);
274
}
275
};
276
277
AuraScript
*
GetAuraScript
() const
OVERRIDE
278
{
279
return
new
spell_flame_warder_meteor_fists_AuraScript
();
280
}
281
};
282
283
void
AddSC_boss_koralon
()
284
{
285
new
boss_koralon
();
286
new
npc_flame_warder
();
287
new
spell_koralon_meteor_fists
();
288
new
spell_koralon_meteor_fists_damage
();
289
new
spell_flame_warder_meteor_fists
();
290
}
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
EFFECT_0
@ EFFECT_0
Definition
SharedDefines.h:18
TARGET_UNIT_TARGET_ENEMY
@ TARGET_UNIT_TARGET_ENEMY
Definition
SharedDefines.h:1616
SPELL_AURA_DUMMY
@ SPELL_AURA_DUMMY
Definition
SpellAuraDefines.h:51
SpellAuraEffects.h
sSpellMgr
#define sSpellMgr
Definition
SpellMgr.h:744
SpellScript.h
AuraEffectProcFn
#define AuraEffectProcFn(F, I, N)
Definition
SpellScript.h:751
SpellObjectAreaTargetSelectFn
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition
SpellScript.h:283
SpellHitFn
#define SpellHitFn(F)
Definition
SpellScript.h:278
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
Events
Events
Definition
alterac_valley.cpp:40
SPELL_METEOR_FISTS_DAMAGE
@ SPELL_METEOR_FISTS_DAMAGE
Definition
boss_koralon.cpp:33
SPELL_BURNING_FURY
@ SPELL_BURNING_FURY
Definition
boss_koralon.cpp:29
SPELL_FLAME_CINDER_A
@ SPELL_FLAME_CINDER_A
Definition
boss_koralon.cpp:30
SPELL_FLAME_CINDER_B
@ SPELL_FLAME_CINDER_B
Definition
boss_koralon.cpp:31
SPELL_METEOR_FISTS
@ SPELL_METEOR_FISTS
Definition
boss_koralon.cpp:32
SPELL_FW_LAVA_BIRST
@ SPELL_FW_LAVA_BIRST
Definition
boss_koralon.cpp:36
SPELL_FW_METEOR_FISTS_DAMAGE
@ SPELL_FW_METEOR_FISTS_DAMAGE
Definition
boss_koralon.cpp:38
SPELL_BURNING_BREATH
@ SPELL_BURNING_BREATH
Definition
boss_koralon.cpp:28
SPELL_FW_METEOR_FISTS
@ SPELL_FW_METEOR_FISTS
Definition
boss_koralon.cpp:37
AddSC_boss_koralon
void AddSC_boss_koralon()
Definition
boss_koralon.cpp:283
EVENT_FLAME_CINDER
@ EVENT_FLAME_CINDER
Definition
boss_koralon.cpp:17
EVENT_FW_LAVA_BIRST
@ EVENT_FW_LAVA_BIRST
Definition
boss_koralon.cpp:21
EVENT_BURNING_BREATH
@ EVENT_BURNING_BREATH
Definition
boss_koralon.cpp:15
EVENT_METEOR_FISTS
@ EVENT_METEOR_FISTS
Definition
boss_koralon.cpp:18
EVENT_FW_METEOR_FISTS
@ EVENT_FW_METEOR_FISTS
Definition
boss_koralon.cpp:22
EVENT_BURNING_FURY
@ EVENT_BURNING_FURY
Definition
boss_koralon.cpp:16
AuraEffect
Definition
SpellAuraEffects.h:18
AuraScript
Definition
SpellScript.h:436
AuraScript::PreventDefaultAction
void PreventDefaultAction()
Definition
SpellScript.cpp:905
AuraScript::AuraScript
AuraScript()
Definition
SpellScript.h:597
AuraScript::GetTarget
Unit * GetTarget() const
Definition
SpellScript.cpp:1085
AuraScript::OnEffectProc
HookList< EffectProcHandler > OnEffectProc
Definition
SpellScript.h:746
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
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
EventMap
Definition
CreatureAIImpl.h:304
ProcEventInfo
Definition
Unit.h:966
ProcEventInfo::GetProcTarget
Unit * GetProcTarget() const
Definition
Unit.h:974
SpellInfo
Definition
SpellInfo.h:158
SpellScript
Definition
SpellScript.h:139
SpellScript::OnHit
HookList< HitHandler > OnHit
Definition
SpellScript.h:274
SpellScript::SetHitDamage
void SetHitDamage(int32 damage)
Definition
SpellScript.cpp:475
SpellScript::OnObjectAreaTargetSelect
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition
SpellScript.h:282
SpellScript::GetHitDamage
int32 GetHitDamage()
Definition
SpellScript.cpp:465
SpellScriptLoader::SpellScriptLoader
SpellScriptLoader(const char *name)
Definition
ScriptMgr.cpp:1372
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
boss_koralon
Definition
boss_koralon.cpp:42
boss_koralon::boss_koralon
boss_koralon()
Definition
boss_koralon.cpp:44
boss_koralon::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_koralon.cpp:103
npc_flame_warder
Definition
boss_koralon.cpp:113
npc_flame_warder::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_koralon.cpp:167
npc_flame_warder::npc_flame_warder
npc_flame_warder()
Definition
boss_koralon.cpp:115
spell_flame_warder_meteor_fists::spell_flame_warder_meteor_fists_AuraScript
Definition
boss_koralon.cpp:255
spell_flame_warder_meteor_fists::spell_flame_warder_meteor_fists_AuraScript::Validate
bool Validate(SpellInfo const *) OVERRIDE
Definition
boss_koralon.cpp:258
spell_flame_warder_meteor_fists::spell_flame_warder_meteor_fists_AuraScript::Register
void Register() OVERRIDE
Definition
boss_koralon.cpp:271
spell_flame_warder_meteor_fists::spell_flame_warder_meteor_fists_AuraScript::PrepareAuraScript
PrepareAuraScript(spell_flame_warder_meteor_fists_AuraScript)
spell_flame_warder_meteor_fists::spell_flame_warder_meteor_fists_AuraScript::TriggerFists
void TriggerFists(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition
boss_koralon.cpp:265
spell_flame_warder_meteor_fists
Definition
boss_koralon.cpp:250
spell_flame_warder_meteor_fists::spell_flame_warder_meteor_fists
spell_flame_warder_meteor_fists()
Definition
boss_koralon.cpp:252
spell_flame_warder_meteor_fists::GetAuraScript
AuraScript * GetAuraScript() const OVERRIDE
Definition
boss_koralon.cpp:277
spell_koralon_meteor_fists::spell_koralon_meteor_fists_AuraScript
Definition
boss_koralon.cpp:179
spell_koralon_meteor_fists::spell_koralon_meteor_fists_AuraScript::PrepareAuraScript
PrepareAuraScript(spell_koralon_meteor_fists_AuraScript)
spell_koralon_meteor_fists::spell_koralon_meteor_fists_AuraScript::Register
void Register() OVERRIDE
Definition
boss_koralon.cpp:195
spell_koralon_meteor_fists::spell_koralon_meteor_fists_AuraScript::TriggerFists
void TriggerFists(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
Definition
boss_koralon.cpp:189
spell_koralon_meteor_fists::spell_koralon_meteor_fists_AuraScript::Validate
bool Validate(SpellInfo const *) OVERRIDE
Definition
boss_koralon.cpp:182
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage_SpellScript
Definition
boss_koralon.cpp:213
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage_SpellScript::Load
bool Load() OVERRIDE
Definition
boss_koralon.cpp:216
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage_SpellScript::_chainTargets
uint8 _chainTargets
Definition
boss_koralon.cpp:240
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage_SpellScript::CalculateSplitDamage
void CalculateSplitDamage()
Definition
boss_koralon.cpp:227
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage_SpellScript::Register
void Register() OVERRIDE
Definition
boss_koralon.cpp:233
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage_SpellScript::FilterTargets
void FilterTargets(std::list< WorldObject * > &targets)
Definition
boss_koralon.cpp:222
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage_SpellScript::PrepareSpellScript
PrepareSpellScript(spell_koralon_meteor_fists_damage_SpellScript)
spell_koralon_meteor_fists_damage
Definition
boss_koralon.cpp:208
spell_koralon_meteor_fists_damage::spell_koralon_meteor_fists_damage
spell_koralon_meteor_fists_damage()
Definition
boss_koralon.cpp:210
spell_koralon_meteor_fists_damage::GetSpellScript
SpellScript * GetSpellScript() const OVERRIDE
Definition
boss_koralon.cpp:243
spell_koralon_meteor_fists
Definition
boss_koralon.cpp:174
spell_koralon_meteor_fists::GetAuraScript
AuraScript * GetAuraScript() const OVERRIDE
Definition
boss_koralon.cpp:201
spell_koralon_meteor_fists::spell_koralon_meteor_fists
spell_koralon_meteor_fists()
Definition
boss_koralon.cpp:176
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_koralon::boss_koralonAI
Definition
boss_koralon.cpp:47
boss_koralon::boss_koralonAI::boss_koralonAI
boss_koralonAI(Creature *creature)
Definition
boss_koralon.cpp:48
boss_koralon::boss_koralonAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_koralon.cpp:52
boss_koralon::boss_koralonAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_koralon.cpp:64
npc_flame_warder::npc_flame_warderAI
Definition
boss_koralon.cpp:118
npc_flame_warder::npc_flame_warderAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_koralon.cpp:128
npc_flame_warder::npc_flame_warderAI::Reset
void Reset() OVERRIDE
Definition
boss_koralon.cpp:123
npc_flame_warder::npc_flame_warderAI::npc_flame_warderAI
npc_flame_warderAI(Creature *creature)
Definition
boss_koralon.cpp:119
npc_flame_warder::npc_flame_warderAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_koralon.cpp:136
npc_flame_warder::npc_flame_warderAI::events
EventMap events
Definition
boss_koralon.cpp:164
vault_of_archavon.h
DATA_KORALON
@ DATA_KORALON
Definition
vault_of_archavon.h:15
src
server
scripts
Northrend
VaultOfArchavon
boss_koralon.cpp
Generated on
for Project SkyFire Core by
1.17.0