Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_zum_rah.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_Zum_Rah
8
Category: Tanaris, ZulFarrak
9
*/
10
11
#include "
ScriptMgr.h
"
12
#include "
ScriptedCreature.h
"
13
#include "
zulfarrak.h
"
14
15
enum
Says
16
{
17
SAY_SANCT_INVADE
= 0,
18
SAY_WARD
= 1,
19
SAY_KILL
= 2
20
};
21
22
enum
Spells
23
{
24
SPELL_SHADOW_BOLT
= 12739,
25
SPELL_SHADOWBOLT_VOLLEY
= 15245,
26
SPELL_WARD_OF_ZUM_RAH
= 11086,
27
SPELL_HEALING_WAVE
= 12491
28
};
29
30
enum
Events
31
{
32
EVENT_SHADOW_BOLT
= 1,
33
EVENT_SHADOWBOLT_VOLLEY
= 2,
34
EVENT_WARD_OF_ZUM_RAH
= 3,
35
EVENT_HEALING_WAVE
= 4
36
};
37
38
enum
Faction
39
{
40
ZUMRAH_FRIENDLY_FACTION
= 35
41
};
42
43
class
boss_zum_rah
:
public
CreatureScript
44
{
45
public
:
46
boss_zum_rah
() :
CreatureScript
(
"boss_zum_rah"
) { }
47
48
struct
boss_zum_rahAI
:
public
BossAI
49
{
50
boss_zum_rahAI
(
Creature
* creature) :
BossAI
(creature,
DATA_ZUM_RAH
) { }
51
52
void
Reset
()
OVERRIDE
53
{
54
me
->setFaction(
ZUMRAH_FRIENDLY_FACTION
);
// areatrigger sets faction to enemy
55
_ward80
=
false
;
56
_ward40
=
false
;
57
_heal30
=
false
;
58
}
59
60
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
61
{
62
Talk
(
SAY_SANCT_INVADE
);
63
events
.ScheduleEvent(
EVENT_SHADOW_BOLT
, 1000);
64
events
.ScheduleEvent(
EVENT_SHADOWBOLT_VOLLEY
, 10000);
65
}
66
67
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
68
{
69
if
(
instance
)
70
instance
->SetData(
DATA_ZUM_RAH
,
DONE
);
71
}
72
73
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
74
{
75
Talk
(
SAY_KILL
);
76
}
77
78
void
UpdateAI
(
uint32
diff)
OVERRIDE
79
{
80
if
(!
UpdateVictim
())
81
return
;
82
83
events
.Update(diff);
84
85
while
(
uint32
eventId =
events
.ExecuteEvent())
86
{
87
switch
(eventId)
88
{
89
case
EVENT_SHADOW_BOLT
:
90
DoCastVictim
(
SPELL_SHADOW_BOLT
);
91
events
.ScheduleEvent(
EVENT_SHADOW_BOLT
, 4000);
92
break
;
93
case
EVENT_WARD_OF_ZUM_RAH
:
94
DoCast
(
me
,
SPELL_WARD_OF_ZUM_RAH
);
95
break
;
96
case
EVENT_HEALING_WAVE
:
97
DoCast
(
me
,
SPELL_HEALING_WAVE
);
98
break
;
99
case
EVENT_SHADOWBOLT_VOLLEY
:
100
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
101
DoCast
(target,
SPELL_SHADOWBOLT_VOLLEY
);
102
events
.ScheduleEvent(
EVENT_SHADOWBOLT_VOLLEY
, 9000);
103
break
;
104
default
:
105
break
;
106
}
107
}
108
109
if
(!
_ward80
&&
HealthBelowPct
(80))
110
{
111
_ward80
=
true
;
112
Talk
(
SAY_WARD
);
113
events
.ScheduleEvent(
EVENT_WARD_OF_ZUM_RAH
, 1000);
114
}
115
116
if
(!
_ward40
&&
HealthBelowPct
(40))
117
{
118
_ward40
=
true
;
119
Talk
(
SAY_WARD
);
120
events
.ScheduleEvent(
EVENT_WARD_OF_ZUM_RAH
, 1000);
121
}
122
123
if
(!
_heal30
&&
HealthBelowPct
(30))
124
{
125
_heal30
=
true
;
126
events
.ScheduleEvent(
EVENT_HEALING_WAVE
, 3000);
127
}
128
129
DoMeleeAttackIfReady
();
130
}
131
132
private
:
133
bool
_ward80
;
134
bool
_ward40
;
135
bool
_heal30
;
136
137
};
138
139
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
140
{
141
return
new
boss_zum_rahAI
(creature);
142
}
143
};
144
145
void
AddSC_boss_zum_rah
()
146
{
147
new
boss_zum_rah
();
148
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
DONE
@ DONE
Definition
InstanceScript.h:49
ScriptMgr.h
ScriptedCreature.h
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Events
Events
Definition
alterac_valley.cpp:40
SAY_KILL
#define SAY_KILL
Definition
boss_commander_kolurg.cpp:29
SPELL_SHADOW_BOLT
@ SPELL_SHADOW_BOLT
Definition
boss_gehennas.cpp:22
Says
Says
Definition
boss_halycon.cpp:17
SPELL_SHADOWBOLT_VOLLEY
@ SPELL_SHADOWBOLT_VOLLEY
Definition
boss_nefarian.cpp:104
EVENT_SHADOW_BOLT
@ EVENT_SHADOW_BOLT
Definition
boss_nefarian.cpp:16
SAY_KILL
@ SAY_KILL
Definition
boss_zum_rah.cpp:19
SAY_WARD
@ SAY_WARD
Definition
boss_zum_rah.cpp:18
SAY_SANCT_INVADE
@ SAY_SANCT_INVADE
Definition
boss_zum_rah.cpp:17
SPELL_SHADOW_BOLT
@ SPELL_SHADOW_BOLT
Definition
boss_zum_rah.cpp:24
SPELL_SHADOWBOLT_VOLLEY
@ SPELL_SHADOWBOLT_VOLLEY
Definition
boss_zum_rah.cpp:25
SPELL_WARD_OF_ZUM_RAH
@ SPELL_WARD_OF_ZUM_RAH
Definition
boss_zum_rah.cpp:26
SPELL_HEALING_WAVE
@ SPELL_HEALING_WAVE
Definition
boss_zum_rah.cpp:27
AddSC_boss_zum_rah
void AddSC_boss_zum_rah()
Definition
boss_zum_rah.cpp:145
Faction
Faction
Definition
boss_zum_rah.cpp:39
ZUMRAH_FRIENDLY_FACTION
@ ZUMRAH_FRIENDLY_FACTION
Definition
boss_zum_rah.cpp:40
EVENT_SHADOWBOLT_VOLLEY
@ EVENT_SHADOWBOLT_VOLLEY
Definition
boss_zum_rah.cpp:33
EVENT_WARD_OF_ZUM_RAH
@ EVENT_WARD_OF_ZUM_RAH
Definition
boss_zum_rah.cpp:34
EVENT_HEALING_WAVE
@ EVENT_HEALING_WAVE
Definition
boss_zum_rah.cpp:35
EVENT_SHADOW_BOLT
@ EVENT_SHADOW_BOLT
Definition
boss_zum_rah.cpp:32
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::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::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_zum_rah
Definition
boss_zum_rah.cpp:44
boss_zum_rah::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_zum_rah.cpp:139
boss_zum_rah::boss_zum_rah
boss_zum_rah()
Definition
boss_zum_rah.cpp:46
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
boss_zum_rah::boss_zum_rahAI
Definition
boss_zum_rah.cpp:49
boss_zum_rah::boss_zum_rahAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_zum_rah.cpp:67
boss_zum_rah::boss_zum_rahAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_zum_rah.cpp:78
boss_zum_rah::boss_zum_rahAI::_heal30
bool _heal30
Definition
boss_zum_rah.cpp:135
boss_zum_rah::boss_zum_rahAI::_ward80
bool _ward80
Definition
boss_zum_rah.cpp:133
boss_zum_rah::boss_zum_rahAI::_ward40
bool _ward40
Definition
boss_zum_rah.cpp:134
boss_zum_rah::boss_zum_rahAI::boss_zum_rahAI
boss_zum_rahAI(Creature *creature)
Definition
boss_zum_rah.cpp:50
boss_zum_rah::boss_zum_rahAI::Reset
void Reset() OVERRIDE
Definition
boss_zum_rah.cpp:52
boss_zum_rah::boss_zum_rahAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_zum_rah.cpp:73
boss_zum_rah::boss_zum_rahAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_zum_rah.cpp:60
zulfarrak.h
DATA_ZUM_RAH
@ DATA_ZUM_RAH
Definition
zulfarrak.h:26
src
server
scripts
Kalimdor
ZulFarrak
boss_zum_rah.cpp
Generated on
for Project SkyFire Core by
1.17.0