Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_temporus.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
/*
7
Name: Boss_Temporus
8
%Complete: 75
9
Comment: More abilities need to be implemented
10
Category: Caverns of Time, The Black Morass
11
*/
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
the_black_morass.h
"
16
17
enum
Enums
18
{
19
SAY_ENTER
= 0,
20
SAY_AGGRO
= 1,
21
SAY_BANISH
= 2,
22
SAY_SLAY
= 3,
23
SAY_DEATH
= 4,
24
25
SPELL_HASTE
= 31458,
26
SPELL_MORTAL_WOUND
= 31464,
27
SPELL_WING_BUFFET
= 31475,
28
H_SPELL_WING_BUFFET
= 38593,
29
SPELL_REFLECT
= 38592
//Not Implemented (Heroic mod)
30
};
31
32
enum
Events
33
{
34
EVENT_HASTE
= 1,
35
EVENT_MORTAL_WOUND
= 2,
36
EVENT_WING_BUFFET
= 3,
37
EVENT_SPELL_REFLECTION
= 4
38
};
39
40
class
boss_temporus
:
public
CreatureScript
41
{
42
public
:
43
boss_temporus
() :
CreatureScript
(
"boss_temporus"
) { }
44
45
struct
boss_temporusAI
:
public
BossAI
46
{
47
boss_temporusAI
(
Creature
* creature) :
BossAI
(creature,
TYPE_TEMPORUS
) { }
48
49
void
Reset
()
OVERRIDE
{ }
50
51
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
52
{
53
events
.ScheduleEvent(
EVENT_HASTE
, std::rand() % 23000 + 15000);
54
events
.ScheduleEvent(
EVENT_MORTAL_WOUND
, 8000);
55
events
.ScheduleEvent(
EVENT_WING_BUFFET
, std::rand() % 35000 + 25000);
56
if
(
IsHeroic
())
57
events
.ScheduleEvent(
EVENT_SPELL_REFLECTION
, 30000);
58
59
Talk
(
SAY_AGGRO
);
60
}
61
62
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
63
{
64
Talk
(
SAY_SLAY
);
65
}
66
67
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
68
{
69
Talk
(
SAY_DEATH
);
70
71
if
(
instance
)
72
instance
->SetData(
TYPE_RIFT
,
SPECIAL
);
73
}
74
75
void
MoveInLineOfSight
(
Unit
* who)
OVERRIDE
76
77
{
78
//Despawn Time Keeper
79
if
(who->GetTypeId() ==
TypeID::TYPEID_UNIT
&& who->GetEntry() ==
NPC_TIME_KEEPER
)
80
{
81
if
(
me
->IsWithinDistInMap(who, 20.0f))
82
{
83
Talk
(
SAY_BANISH
);
84
85
me
->DealDamage(who, who->GetHealth(), NULL,
DIRECT_DAMAGE
,
SPELL_SCHOOL_MASK_NORMAL
, NULL,
false
);
86
}
87
}
88
89
ScriptedAI::MoveInLineOfSight
(who);
90
}
91
92
void
UpdateAI
(
uint32
diff)
OVERRIDE
93
{
94
//Return since we have no target
95
if
(!
UpdateVictim
())
96
return
;
97
98
events
.Update(diff);
99
100
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
101
return
;
102
103
while
(
uint32
eventId =
events
.ExecuteEvent())
104
{
105
switch
(eventId)
106
{
107
case
EVENT_HASTE
:
108
DoCast
(
me
,
SPELL_HASTE
);
109
events
.ScheduleEvent(
EVENT_HASTE
, std::rand() % 25000 + 20000);
110
break
;
111
case
EVENT_MORTAL_WOUND
:
112
DoCast
(
me
,
SPELL_MORTAL_WOUND
);
113
events
.ScheduleEvent(
EVENT_MORTAL_WOUND
, std::rand() % 20000 + 10000);
114
break
;
115
case
EVENT_WING_BUFFET
:
116
DoCast
(
me
,
SPELL_WING_BUFFET
);
117
events
.ScheduleEvent(
EVENT_WING_BUFFET
, std::rand() % 30000 + 20000);
118
break
;
119
case
EVENT_SPELL_REFLECTION
:
// Only in Heroic
120
DoCast
(
me
,
SPELL_REFLECT
);
121
events
.ScheduleEvent(
EVENT_SPELL_REFLECTION
, std::rand() % 35000 + 25000);
122
break
;
123
default
:
124
break
;
125
}
126
}
127
DoMeleeAttackIfReady
();
128
}
129
};
130
131
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
132
{
133
return
new
boss_temporusAI
(creature);
134
}
135
};
136
137
void
AddSC_boss_temporus
()
138
{
139
new
boss_temporus
();
140
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
SPECIAL
@ SPECIAL
Definition
InstanceScript.h:50
TypeID::TYPEID_UNIT
@ TYPEID_UNIT
Definition
Object.h:54
ScriptMgr.h
ScriptedCreature.h
SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_NORMAL
Definition
SharedDefines.h:270
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
DIRECT_DAMAGE
@ DIRECT_DAMAGE
Definition
Unit.h:614
Events
Events
Definition
alterac_valley.cpp:40
Enums
Enums
Definition
boss_aeonus.cpp:18
SAY_BANISH
@ SAY_BANISH
Definition
boss_aeonus.cpp:21
SAY_SLAY
@ SAY_SLAY
Definition
boss_alizabal.cpp:20
SPELL_REFLECT
@ SPELL_REFLECT
Definition
boss_azuregos.cpp:27
SAY_ENTER
@ SAY_ENTER
Definition
boss_captain_skarloc.cpp:23
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SPELL_WING_BUFFET
@ SPELL_WING_BUFFET
Definition
boss_epoch_hunter.cpp:32
SAY_DEATH
@ SAY_DEATH
Definition
boss_temporus.cpp:23
H_SPELL_WING_BUFFET
@ H_SPELL_WING_BUFFET
Definition
boss_temporus.cpp:28
SPELL_WING_BUFFET
@ SPELL_WING_BUFFET
Definition
boss_temporus.cpp:27
SAY_BANISH
@ SAY_BANISH
Definition
boss_temporus.cpp:21
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_temporus.cpp:20
SPELL_HASTE
@ SPELL_HASTE
Definition
boss_temporus.cpp:25
SPELL_REFLECT
@ SPELL_REFLECT
Definition
boss_temporus.cpp:29
SAY_SLAY
@ SAY_SLAY
Definition
boss_temporus.cpp:22
SPELL_MORTAL_WOUND
@ SPELL_MORTAL_WOUND
Definition
boss_temporus.cpp:26
AddSC_boss_temporus
void AddSC_boss_temporus()
Definition
boss_temporus.cpp:137
EVENT_MORTAL_WOUND
@ EVENT_MORTAL_WOUND
Definition
boss_temporus.cpp:35
EVENT_WING_BUFFET
@ EVENT_WING_BUFFET
Definition
boss_temporus.cpp:36
EVENT_SPELL_REFLECTION
@ EVENT_SPELL_REFLECTION
Definition
boss_temporus.cpp:37
EVENT_HASTE
@ EVENT_HASTE
Definition
boss_temporus.cpp:34
BossAI::instance
InstanceScript *const instance
Definition
ScriptedCreature.h:383
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::MoveInLineOfSight
virtual void MoveInLineOfSight(Unit *)
Definition
CreatureAI.cpp:114
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
Unit
Definition
Unit.h:1367
boss_temporus
Definition
boss_temporus.cpp:41
boss_temporus::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_temporus.cpp:131
boss_temporus::boss_temporus
boss_temporus()
Definition
boss_temporus.cpp:43
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition
ScriptedCreature.h:279
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
boss_temporus::boss_temporusAI
Definition
boss_temporus.cpp:46
boss_temporus::boss_temporusAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_temporus.cpp:92
boss_temporus::boss_temporusAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_temporus.cpp:51
boss_temporus::boss_temporusAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *who) OVERRIDE
Definition
boss_temporus.cpp:75
boss_temporus::boss_temporusAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_temporus.cpp:67
boss_temporus::boss_temporusAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_temporus.cpp:62
boss_temporus::boss_temporusAI::boss_temporusAI
boss_temporusAI(Creature *creature)
Definition
boss_temporus.cpp:47
boss_temporus::boss_temporusAI::Reset
void Reset() OVERRIDE
Definition
boss_temporus.cpp:49
the_black_morass.h
NPC_TIME_KEEPER
@ NPC_TIME_KEEPER
Definition
the_black_morass.h:40
TYPE_TEMPORUS
@ TYPE_TEMPORUS
Definition
the_black_morass.h:16
TYPE_RIFT
@ TYPE_RIFT
Definition
the_black_morass.h:14
src
server
scripts
Kalimdor
CavernsOfTime
TheBlackMorass
boss_temporus.cpp
Generated on
for Project SkyFire Core by
1.17.0