Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_halycon.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_REND
= 13738,
13
SPELL_THRASH
= 3391,
14
};
15
16
enum
Says
17
{
18
EMOTE_DEATH
= 0
19
};
20
21
enum
Events
22
{
23
EVENT_REND
= 1,
24
EVENT_THRASH
= 2,
25
};
26
27
const
Position
SummonLocation
= { -167.9561f, -411.7844f, 76.23057f, 1.53589f };
28
29
class
boss_halycon
:
public
CreatureScript
30
{
31
public
:
32
boss_halycon
() :
CreatureScript
(
"boss_halycon"
) { }
33
34
struct
boss_halyconAI
:
public
BossAI
35
{
36
boss_halyconAI
(
Creature
* creature) :
BossAI
(creature,
DATA_HALYCON
) { }
37
38
void
Reset
()
OVERRIDE
39
{
40
_Reset
();
41
Summoned
=
false
;
42
}
43
44
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
45
{
46
_EnterCombat
();
47
events
.ScheduleEvent(
EVENT_REND
, std::rand() % 20000 + 17000);
48
events
.ScheduleEvent(
EVENT_THRASH
, std::rand() % 12000 + 10000);
49
}
50
51
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
52
{
53
me
->SummonCreature(
NPC_GIZRUL_THE_SLAVENER
,
SummonLocation
,
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 300000);
54
Talk
(
EMOTE_DEATH
);
55
56
Summoned
=
true
;
57
}
58
59
void
UpdateAI
(
uint32
diff)
OVERRIDE
60
{
61
if
(!
UpdateVictim
())
62
return
;
63
64
events
.Update(diff);
65
66
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
67
return
;
68
69
while
(
uint32
eventId =
events
.ExecuteEvent())
70
{
71
switch
(eventId)
72
{
73
case
EVENT_REND
:
74
DoCastVictim
(
SPELL_REND
);
75
events
.ScheduleEvent(
EVENT_REND
, std::rand() % 10000 + 8000);
76
break
;
77
case
EVENT_THRASH
:
78
DoCast
(
me
,
SPELL_THRASH
);
79
break
;
80
default
:
81
break
;
82
}
83
}
84
DoMeleeAttackIfReady
();
85
}
86
private
:
87
bool
Summoned
;
88
};
89
90
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
91
{
92
return
new
boss_halyconAI
(creature);
93
}
94
};
95
96
void
AddSC_boss_halycon
()
97
{
98
new
boss_halycon
();
99
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
Definition
Object.h:70
ScriptMgr.h
ScriptedCreature.h
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
Events
Events
Definition
alterac_valley.cpp:40
blackrock_spire.h
NPC_GIZRUL_THE_SLAVENER
@ NPC_GIZRUL_THE_SLAVENER
Definition
blackrock_spire.h:49
DATA_HALYCON
@ DATA_HALYCON
Definition
blackrock_spire.h:22
Says
Says
Definition
boss_halycon.cpp:17
EMOTE_DEATH
@ EMOTE_DEATH
Definition
boss_halycon.cpp:18
SPELL_THRASH
@ SPELL_THRASH
Definition
boss_halycon.cpp:13
SPELL_REND
@ SPELL_REND
Definition
boss_halycon.cpp:12
SummonLocation
const Position SummonLocation
Definition
boss_halycon.cpp:27
AddSC_boss_halycon
void AddSC_boss_halycon()
Definition
boss_halycon.cpp:96
EVENT_REND
@ EVENT_REND
Definition
boss_halycon.cpp:23
EVENT_THRASH
@ EVENT_THRASH
Definition
boss_halycon.cpp:24
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:462
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
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
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
boss_halycon
Definition
boss_halycon.cpp:30
boss_halycon::boss_halycon
boss_halycon()
Definition
boss_halycon.cpp:32
boss_halycon::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_halycon.cpp:90
Position
Definition
Object.h:274
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
boss_halycon::boss_halyconAI
Definition
boss_halycon.cpp:35
boss_halycon::boss_halyconAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_halycon.cpp:44
boss_halycon::boss_halyconAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_halycon.cpp:51
boss_halycon::boss_halyconAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_halycon.cpp:59
boss_halycon::boss_halyconAI::Reset
void Reset() OVERRIDE
Definition
boss_halycon.cpp:38
boss_halycon::boss_halyconAI::Summoned
bool Summoned
Definition
boss_halycon.cpp:87
boss_halycon::boss_halyconAI::boss_halyconAI
boss_halyconAI(Creature *creature)
Definition
boss_halycon.cpp:36
src
server
scripts
EasternKingdoms
BlackrockMountain
BlackrockSpire
boss_halycon.cpp
Generated on
for Project SkyFire Core by
1.17.0