Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_the_beast.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 "
blackrock_spire.h
"
9
10
enum
Spells
11
{
12
SPELL_FLAMEBREAK
= 16785,
13
SPELL_IMMOLATE
= 20294,
14
SPELL_TERRIFYINGROAR
= 14100,
15
};
16
17
enum
Events
18
{
19
EVENT_FLAME_BREAK
= 1,
20
EVENT_IMMOLATE
= 2,
21
EVENT_TERRIFYING_ROAR
= 3,
22
};
23
24
class
boss_the_beast
:
public
CreatureScript
25
{
26
public
:
27
boss_the_beast
() :
CreatureScript
(
"boss_the_beast"
) { }
28
29
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
30
{
31
return
new
boss_thebeastAI
(creature);
32
}
33
34
struct
boss_thebeastAI
:
public
BossAI
35
{
36
boss_thebeastAI
(
Creature
* creature) :
BossAI
(creature,
DATA_THE_BEAST
) { }
37
38
void
Reset
()
OVERRIDE
39
{
40
_Reset
();
41
}
42
43
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
44
{
45
_EnterCombat
();
46
events
.ScheduleEvent(
EVENT_FLAME_BREAK
, 12 *
IN_MILLISECONDS
);
47
events
.ScheduleEvent(
EVENT_IMMOLATE
, 3 *
IN_MILLISECONDS
);
48
events
.ScheduleEvent(
EVENT_TERRIFYING_ROAR
, 23 *
IN_MILLISECONDS
);
49
}
50
51
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
52
{
53
_JustDied
();
54
}
55
56
void
UpdateAI
(
uint32
diff)
OVERRIDE
57
{
58
if
(!
UpdateVictim
())
59
return
;
60
61
events
.Update(diff);
62
63
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
64
return
;
65
66
while
(
uint32
eventId =
events
.ExecuteEvent())
67
{
68
switch
(eventId)
69
{
70
case
EVENT_FLAME_BREAK
:
71
DoCastVictim
(
SPELL_FLAMEBREAK
);
72
events
.ScheduleEvent(
EVENT_FLAME_BREAK
, 10 *
IN_MILLISECONDS
);
73
break
;
74
case
EVENT_IMMOLATE
:
75
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
76
DoCast
(target,
SPELL_IMMOLATE
);
77
events
.ScheduleEvent(
EVENT_IMMOLATE
, 8 *
IN_MILLISECONDS
);
78
break
;
79
case
EVENT_TERRIFYING_ROAR
:
80
DoCastVictim
(
SPELL_TERRIFYINGROAR
);
81
events
.ScheduleEvent(
EVENT_TERRIFYING_ROAR
, 20 *
IN_MILLISECONDS
);
82
break
;
83
}
84
}
85
DoMeleeAttackIfReady
();
86
}
87
};
88
};
89
90
void
AddSC_boss_thebeast
()
91
{
92
new
boss_the_beast
();
93
}
Spells
Spells
Definition
BattlegroundIC.h:645
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:125
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
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Events
Events
Definition
alterac_valley.cpp:40
blackrock_spire.h
DATA_THE_BEAST
@ DATA_THE_BEAST
Definition
blackrock_spire.h:27
SPELL_FLAMEBREAK
@ SPELL_FLAMEBREAK
Definition
boss_the_beast.cpp:12
SPELL_IMMOLATE
@ SPELL_IMMOLATE
Definition
boss_the_beast.cpp:13
SPELL_TERRIFYINGROAR
@ SPELL_TERRIFYINGROAR
Definition
boss_the_beast.cpp:14
AddSC_boss_thebeast
void AddSC_boss_thebeast()
Definition
boss_the_beast.cpp:90
EVENT_IMMOLATE
@ EVENT_IMMOLATE
Definition
boss_the_beast.cpp:20
EVENT_FLAME_BREAK
@ EVENT_FLAME_BREAK
Definition
boss_the_beast.cpp:19
EVENT_TERRIFYING_ROAR
@ EVENT_TERRIFYING_ROAR
Definition
boss_the_beast.cpp:21
SPELL_IMMOLATE
@ SPELL_IMMOLATE
Definition
boss_tomb_of_seven.cpp:83
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::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
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
boss_the_beast
Definition
boss_the_beast.cpp:25
boss_the_beast::boss_the_beast
boss_the_beast()
Definition
boss_the_beast.cpp:27
boss_the_beast::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_the_beast.cpp:29
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
boss_the_beast::boss_thebeastAI
Definition
boss_the_beast.cpp:35
boss_the_beast::boss_thebeastAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_the_beast.cpp:51
boss_the_beast::boss_thebeastAI::boss_thebeastAI
boss_thebeastAI(Creature *creature)
Definition
boss_the_beast.cpp:36
boss_the_beast::boss_thebeastAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_the_beast.cpp:56
boss_the_beast::boss_thebeastAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_the_beast.cpp:43
boss_the_beast::boss_thebeastAI::Reset
void Reset() OVERRIDE
Definition
boss_the_beast.cpp:38
src
server
scripts
EasternKingdoms
BlackrockMountain
BlackrockSpire
boss_the_beast.cpp
Generated on
for Project SkyFire Core by
1.17.0