Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_watchkeeper_gargolmar.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
/* ScriptData
7
SDName: Boss_Watchkeeper_Gargolmar
8
SD%Complete: 80
9
SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random.
10
SDCategory: Hellfire Citadel, Hellfire Ramparts
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
hellfire_ramparts.h
"
16
17
enum
Says
18
{
19
SAY_TAUNT
= 0,
20
SAY_HEAL
= 1,
21
SAY_SURGE
= 2,
22
SAY_AGGRO
= 3,
23
SAY_KILL
= 4,
24
SAY_DIE
= 5
25
};
26
27
enum
Spells
28
{
29
SPELL_MORTAL_WOUND
= 30641,
30
H_SPELL_MORTAL_WOUND
= 36814,
31
SPELL_SURGE
= 34645,
32
SPELL_RETALIATION
= 22857
33
};
34
35
enum
Events
36
{
37
EVENT_MORTAL_WOUND
= 1,
38
EVENT_SURGE
= 2,
39
EVENT_RETALIATION
= 3
40
};
41
42
class
boss_watchkeeper_gargolmar
:
public
CreatureScript
43
{
44
public
:
45
boss_watchkeeper_gargolmar
() :
CreatureScript
(
"boss_watchkeeper_gargolmar"
) { }
46
47
struct
boss_watchkeeper_gargolmarAI
:
public
BossAI
48
{
49
boss_watchkeeper_gargolmarAI
(
Creature
* creature) :
BossAI
(creature,
DATA_WATCHKEEPER_GARGOLMAR
) { }
50
51
void
Reset
()
OVERRIDE
52
{
53
hasTaunted
=
false
;
54
yelledForHeal
=
false
;
55
retaliation
=
false
;
56
_Reset
();
57
}
58
59
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
60
{
61
Talk
(
SAY_AGGRO
);
62
events
.ScheduleEvent(
EVENT_MORTAL_WOUND
, 5000);
63
events
.ScheduleEvent(
EVENT_SURGE
, 4000);
64
_EnterCombat
();
65
}
66
67
void
MoveInLineOfSight
(
Unit
* who)
OVERRIDE
68
69
{
70
if
(!
me
->GetVictim() &&
me
->CanCreatureAttack(who))
71
{
72
if
(!
me
->CanFly() &&
me
->GetDistanceZ(who) >
CREATURE_Z_ATTACK_RANGE
)
73
return
;
74
75
float
attackRadius =
me
->GetAttackDistance(who);
76
if
(
me
->IsWithinDistInMap(who, attackRadius) &&
me
->IsWithinLOSInMap(who))
77
{
78
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
79
AttackStart
(who);
80
}
81
else
if
(!
hasTaunted
&&
me
->IsWithinDistInMap(who, 60.0f))
82
{
83
Talk
(
SAY_TAUNT
);
84
hasTaunted
=
true
;
85
}
86
}
87
}
88
89
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
90
{
91
Talk
(
SAY_KILL
);
92
}
93
94
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
95
{
96
Talk
(
SAY_DIE
);
97
_JustDied
();
98
}
99
100
void
UpdateAI
(
uint32
diff)
OVERRIDE
101
{
102
if
(!
UpdateVictim
())
103
return
;
104
105
events
.Update(diff);
106
107
while
(
uint32
eventId =
events
.ExecuteEvent())
108
{
109
switch
(eventId)
110
{
111
case
EVENT_MORTAL_WOUND
:
112
DoCastVictim
(
SPELL_MORTAL_WOUND
);
113
events
.ScheduleEvent(
EVENT_MORTAL_WOUND
, std::rand() % 13000 + 5000);
114
break
;
115
case
EVENT_SURGE
:
116
Talk
(
SAY_SURGE
);
117
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
118
DoCast
(target,
SPELL_SURGE
);
119
events
.ScheduleEvent(
EVENT_SURGE
, std::rand() % 13000 + 5000);
120
break
;
121
case
EVENT_RETALIATION
:
122
DoCast
(
me
,
SPELL_RETALIATION
);
123
events
.ScheduleEvent(
EVENT_RETALIATION
, 30000);
124
break
;
125
default
:
126
break
;
127
}
128
}
129
130
if
(!
retaliation
)
131
{
132
if
(
HealthBelowPct
(20))
133
{
134
events
.ScheduleEvent(
EVENT_RETALIATION
, 1000);
135
retaliation
=
true
;
136
}
137
}
138
139
if
(!
yelledForHeal
)
140
{
141
if
(
HealthBelowPct
(40))
142
{
143
Talk
(
SAY_HEAL
);
144
yelledForHeal
=
true
;
145
}
146
}
147
148
DoMeleeAttackIfReady
();
149
}
150
151
private
:
152
bool
hasTaunted
;
153
bool
yelledForHeal
;
154
bool
retaliation
;
155
};
156
157
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
158
{
159
return
new
boss_watchkeeper_gargolmarAI
(creature);
160
}
161
};
162
163
void
AddSC_boss_watchkeeper_gargolmar
()
164
{
165
new
boss_watchkeeper_gargolmar
();
166
}
167
Spells
Spells
Definition
BattlegroundIC.h:645
CREATURE_Z_ATTACK_RANGE
#define CREATURE_Z_ATTACK_RANGE
Definition
Creature.h:422
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ScriptMgr.h
ScriptedCreature.h
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
Events
Events
Definition
alterac_valley.cpp:40
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SAY_KILL
#define SAY_KILL
Definition
boss_commander_kolurg.cpp:29
EVENT_SURGE
@ EVENT_SURGE
Definition
boss_drakkari_colossus.cpp:61
SPELL_SURGE
@ SPELL_SURGE
Definition
boss_drakkari_colossus.cpp:23
SPELL_RETALIATION
@ SPELL_RETALIATION
Definition
boss_faction_champions.cpp:139
EVENT_RETALIATION
@ EVENT_RETALIATION
Definition
boss_faction_champions.cpp:285
SAY_TAUNT
@ SAY_TAUNT
Definition
boss_four_horsemen.cpp:67
Says
Says
Definition
boss_halycon.cpp:17
SAY_DIE
@ SAY_DIE
Definition
boss_kelidan_the_breaker.cpp:29
SAY_SURGE
@ SAY_SURGE
Definition
boss_nalorakk.cpp:18
H_SPELL_MORTAL_WOUND
@ H_SPELL_MORTAL_WOUND
Definition
boss_palehoof.cpp:376
SPELL_MORTAL_WOUND
@ SPELL_MORTAL_WOUND
Definition
boss_temporus.cpp:26
EVENT_MORTAL_WOUND
@ EVENT_MORTAL_WOUND
Definition
boss_temporus.cpp:35
SAY_SURGE
@ SAY_SURGE
Definition
boss_watchkeeper_gargolmar.cpp:21
SAY_HEAL
@ SAY_HEAL
Definition
boss_watchkeeper_gargolmar.cpp:20
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_watchkeeper_gargolmar.cpp:22
SAY_KILL
@ SAY_KILL
Definition
boss_watchkeeper_gargolmar.cpp:23
SAY_TAUNT
@ SAY_TAUNT
Definition
boss_watchkeeper_gargolmar.cpp:19
SAY_DIE
@ SAY_DIE
Definition
boss_watchkeeper_gargolmar.cpp:24
SPELL_RETALIATION
@ SPELL_RETALIATION
Definition
boss_watchkeeper_gargolmar.cpp:32
SPELL_MORTAL_WOUND
@ SPELL_MORTAL_WOUND
Definition
boss_watchkeeper_gargolmar.cpp:29
SPELL_SURGE
@ SPELL_SURGE
Definition
boss_watchkeeper_gargolmar.cpp:31
AddSC_boss_watchkeeper_gargolmar
void AddSC_boss_watchkeeper_gargolmar()
Definition
boss_watchkeeper_gargolmar.cpp:163
EVENT_MORTAL_WOUND
@ EVENT_MORTAL_WOUND
Definition
boss_watchkeeper_gargolmar.cpp:37
EVENT_RETALIATION
@ EVENT_RETALIATION
Definition
boss_watchkeeper_gargolmar.cpp:39
EVENT_SURGE
@ EVENT_SURGE
Definition
boss_watchkeeper_gargolmar.cpp:38
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::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_watchkeeper_gargolmar
Definition
boss_watchkeeper_gargolmar.cpp:43
boss_watchkeeper_gargolmar::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_watchkeeper_gargolmar.cpp:157
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmar
boss_watchkeeper_gargolmar()
Definition
boss_watchkeeper_gargolmar.cpp:45
hellfire_ramparts.h
DATA_WATCHKEEPER_GARGOLMAR
@ DATA_WATCHKEEPER_GARGOLMAR
Definition
hellfire_ramparts.h:13
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::HealthBelowPct
bool HealthBelowPct(uint32 pct) const
Definition
ScriptedCreature.h:247
ScriptedAI::AttackStart
void AttackStart(Unit *) OVERRIDE
Definition
ScriptedCreature.cpp:118
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI
Definition
boss_watchkeeper_gargolmar.cpp:48
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_watchkeeper_gargolmar.cpp:89
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *who) OVERRIDE
Definition
boss_watchkeeper_gargolmar.cpp:67
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::boss_watchkeeper_gargolmarAI
boss_watchkeeper_gargolmarAI(Creature *creature)
Definition
boss_watchkeeper_gargolmar.cpp:49
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_watchkeeper_gargolmar.cpp:100
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_watchkeeper_gargolmar.cpp:59
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::Reset
void Reset() OVERRIDE
Definition
boss_watchkeeper_gargolmar.cpp:51
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::yelledForHeal
bool yelledForHeal
Definition
boss_watchkeeper_gargolmar.cpp:153
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_watchkeeper_gargolmar.cpp:94
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::hasTaunted
bool hasTaunted
Definition
boss_watchkeeper_gargolmar.cpp:152
boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmarAI::retaliation
bool retaliation
Definition
boss_watchkeeper_gargolmar.cpp:154
SAY_HEAL
@ SAY_HEAL
Definition
zone_azuremyst_isle.cpp:37
src
server
scripts
Outland
HellfireCitadel
HellfireRamparts
boss_watchkeeper_gargolmar.cpp
Generated on
for Project SkyFire Core by
1.17.0