Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_lavanthor.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 "
violet_hold.h
"
9
10
enum
Spells
11
{
12
SPELL_CAUTERIZING_FLAMES
= 59466,
//Only in heroic
13
SPELL_FIREBOLT
= 54235,
14
H_SPELL_FIREBOLT
= 59468,
15
SPELL_FLAME_BREATH
= 54282,
16
H_SPELL_FLAME_BREATH
= 59469,
17
SPELL_LAVA_BURN
= 54249,
18
H_SPELL_LAVA_BURN
= 59594
19
};
20
21
class
boss_lavanthor
:
public
CreatureScript
22
{
23
public
:
24
boss_lavanthor
() :
CreatureScript
(
"boss_lavanthor"
) { }
25
26
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
27
{
28
return
new
boss_lavanthorAI
(creature);
29
}
30
31
struct
boss_lavanthorAI
:
public
ScriptedAI
32
{
33
boss_lavanthorAI
(
Creature
* creature) :
ScriptedAI
(creature)
34
{
35
instance
= creature->
GetInstanceScript
();
36
}
37
38
uint32
uiFireboltTimer
;
39
uint32
uiFlameBreathTimer
;
40
uint32
uiLavaBurnTimer
;
41
uint32
uiCauterizingFlamesTimer
;
42
43
InstanceScript
*
instance
;
44
45
void
Reset
()
OVERRIDE
46
{
47
uiFireboltTimer
= 1000;
48
uiFlameBreathTimer
= 5000;
49
uiLavaBurnTimer
= 10000;
50
uiCauterizingFlamesTimer
= 3000;
51
if
(
instance
)
52
{
53
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
54
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
NOT_STARTED
);
55
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
56
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
NOT_STARTED
);
57
}
58
}
59
60
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
61
{
62
if
(
instance
)
63
{
64
if
(
GameObject
* pDoor =
instance
->instance->GetGameObject(
instance
->GetData64(
DATA_LAVANTHOR_CELL
)))
65
if
(pDoor->GetGoState() ==
GOState::GO_STATE_READY
)
66
{
67
EnterEvadeMode
();
68
return
;
69
}
70
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
71
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
IN_PROGRESS
);
72
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
73
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
IN_PROGRESS
);
74
}
75
}
76
77
void
AttackStart
(
Unit
* who)
OVERRIDE
78
{
79
if
(
me
->HasFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_IMMUNE_TO_PC
) ||
me
->HasFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NON_ATTACKABLE
))
80
return
;
81
82
if
(
me
->Attack(who,
true
))
83
{
84
me
->AddThreat(who, 0.0f);
85
me
->SetInCombatWith(who);
86
who->SetInCombatWith(
me
);
87
DoStartMovement
(who);
88
}
89
}
90
91
void
MoveInLineOfSight
(
Unit
*
/*who*/
)
OVERRIDE
{ }
92
93
94
void
UpdateAI
(
uint32
diff)
OVERRIDE
95
{
96
//Return since we have no target
97
if
(!
UpdateVictim
())
98
return
;
99
100
if
(
uiFireboltTimer
<= diff)
101
{
102
DoCastVictim
(
SPELL_FIREBOLT
);
103
uiFireboltTimer
= std::rand() % 13000 + 5000;
104
}
else
uiFireboltTimer
-= diff;
105
106
if
(
uiFlameBreathTimer
<= diff)
107
{
108
DoCastVictim
(
SPELL_FLAME_BREATH
);
109
uiFlameBreathTimer
= std::rand() % 15000 + 10000;
110
}
else
uiFlameBreathTimer
-= diff;
111
112
if
(
uiLavaBurnTimer
<= diff)
113
{
114
DoCastVictim
(
SPELL_LAVA_BURN
);
115
uiLavaBurnTimer
= std::rand() % 23000 + 15000;
116
}
117
118
if
(
IsHeroic
())
119
{
120
if
(
uiCauterizingFlamesTimer
<= diff)
121
{
122
DoCastVictim
(
SPELL_CAUTERIZING_FLAMES
);
123
uiCauterizingFlamesTimer
= std::rand() % 16000 + 10000;
124
}
else
uiCauterizingFlamesTimer
-= diff;
125
}
126
127
DoMeleeAttackIfReady
();
128
}
129
130
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
131
{
132
if
(
instance
)
133
{
134
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
135
{
136
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
DONE
);
137
instance
->SetData(
DATA_WAVE_COUNT
, 7);
138
}
139
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
140
{
141
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
DONE
);
142
instance
->SetData(
DATA_WAVE_COUNT
, 13);
143
}
144
}
145
}
146
};
147
};
148
149
void
AddSC_boss_lavanthor
()
150
{
151
new
boss_lavanthor
();
152
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
GOState::GO_STATE_READY
@ GO_STATE_READY
Definition
GameObject.h:577
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
UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_NON_ATTACKABLE
Definition
Unit.h:626
UNIT_FLAG_IMMUNE_TO_PC
@ UNIT_FLAG_IMMUNE_TO_PC
Definition
Unit.h:633
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
H_SPELL_FIREBOLT
@ H_SPELL_FIREBOLT
Definition
boss_lavanthor.cpp:14
H_SPELL_FLAME_BREATH
@ H_SPELL_FLAME_BREATH
Definition
boss_lavanthor.cpp:16
SPELL_FLAME_BREATH
@ SPELL_FLAME_BREATH
Definition
boss_lavanthor.cpp:15
H_SPELL_LAVA_BURN
@ H_SPELL_LAVA_BURN
Definition
boss_lavanthor.cpp:18
SPELL_FIREBOLT
@ SPELL_FIREBOLT
Definition
boss_lavanthor.cpp:13
SPELL_LAVA_BURN
@ SPELL_LAVA_BURN
Definition
boss_lavanthor.cpp:17
SPELL_CAUTERIZING_FLAMES
@ SPELL_CAUTERIZING_FLAMES
Definition
boss_lavanthor.cpp:12
AddSC_boss_lavanthor
void AddSC_boss_lavanthor()
Definition
boss_lavanthor.cpp:149
SPELL_FLAME_BREATH
@ SPELL_FLAME_BREATH
Definition
boss_onyxia.cpp:39
SPELL_FIREBOLT
@ SPELL_FIREBOLT
Definition
boss_terestian_illhoof.cpp:41
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode()
Definition
CreatureAI.cpp:130
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
GameObject
Definition
GameObject.h:629
InstanceScript
Definition
InstanceScript.h:123
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_lavanthor
Definition
boss_lavanthor.cpp:22
boss_lavanthor::boss_lavanthor
boss_lavanthor()
Definition
boss_lavanthor.cpp:24
boss_lavanthor::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_lavanthor.cpp:26
DATA_WAVE_COUNT
@ DATA_WAVE_COUNT
Definition
halls_of_reflection.h:26
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition
ScriptedCreature.h:279
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
ScriptedAI::DoStartMovement
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Definition
ScriptedCreature.cpp:135
boss_lavanthor::boss_lavanthorAI
Definition
boss_lavanthor.cpp:32
boss_lavanthor::boss_lavanthorAI::boss_lavanthorAI
boss_lavanthorAI(Creature *creature)
Definition
boss_lavanthor.cpp:33
boss_lavanthor::boss_lavanthorAI::uiFlameBreathTimer
uint32 uiFlameBreathTimer
Definition
boss_lavanthor.cpp:39
boss_lavanthor::boss_lavanthorAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_lavanthor.cpp:94
boss_lavanthor::boss_lavanthorAI::Reset
void Reset() OVERRIDE
Definition
boss_lavanthor.cpp:45
boss_lavanthor::boss_lavanthorAI::uiLavaBurnTimer
uint32 uiLavaBurnTimer
Definition
boss_lavanthor.cpp:40
boss_lavanthor::boss_lavanthorAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_lavanthor.cpp:130
boss_lavanthor::boss_lavanthorAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *) OVERRIDE
Definition
boss_lavanthor.cpp:91
boss_lavanthor::boss_lavanthorAI::uiCauterizingFlamesTimer
uint32 uiCauterizingFlamesTimer
Definition
boss_lavanthor.cpp:41
boss_lavanthor::boss_lavanthorAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_lavanthor.cpp:60
boss_lavanthor::boss_lavanthorAI::AttackStart
void AttackStart(Unit *who) OVERRIDE
Definition
boss_lavanthor.cpp:77
boss_lavanthor::boss_lavanthorAI::uiFireboltTimer
uint32 uiFireboltTimer
Definition
boss_lavanthor.cpp:38
boss_lavanthor::boss_lavanthorAI::instance
InstanceScript * instance
Definition
boss_lavanthor.cpp:43
violet_hold.h
DATA_LAVANTHOR_CELL
@ DATA_LAVANTHOR_CELL
Definition
violet_hold.h:45
DATA_1ST_BOSS_EVENT
@ DATA_1ST_BOSS_EVENT
Definition
violet_hold.h:11
DATA_2ND_BOSS_EVENT
@ DATA_2ND_BOSS_EVENT
Definition
violet_hold.h:12
src
server
scripts
Northrend
VioletHold
boss_lavanthor.cpp
Generated on
for Project SkyFire Core by
1.17.0