Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_hadronox.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
* Comment: No Waves atm and the doors spells are crazy...
8
*
9
* When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians.
10
* When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back,
11
* so you don't aggro all 3. Hadronox will be under you, fighting Nerubians.
12
*
13
* This is the timed gauntlet - waves of non-elite spiders
14
* will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the
15
* main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for
16
* Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.
17
*/
18
19
#include "
ScriptMgr.h
"
20
#include "
ScriptedCreature.h
"
21
#include "
azjol_nerub.h
"
22
23
enum
Spells
24
{
25
SPELL_ACID_CLOUD
= 53400,
// Victim
26
SPELL_LEECH_POISON
= 53030,
// Victim
27
SPELL_PIERCE_ARMOR
= 53418,
// Victim
28
SPELL_WEB_GRAB
= 57731,
// Victim
29
SPELL_WEB_FRONT_DOORS
= 53177,
// Self
30
SPELL_WEB_SIDE_DOORS
= 53185,
// Self
31
H_SPELL_ACID_CLOUD
= 59419,
32
H_SPELL_LEECH_POISON
= 59417,
33
H_SPELL_WEB_GRAB
= 59421
34
};
35
36
class
boss_hadronox
:
public
CreatureScript
37
{
38
public
:
39
boss_hadronox
() :
CreatureScript
(
"boss_hadronox"
) { }
40
41
struct
boss_hadronoxAI
:
public
ScriptedAI
42
{
43
boss_hadronoxAI
(
Creature
* creature) :
ScriptedAI
(creature)
44
{
45
instance
= creature->
GetInstanceScript
();
46
fMaxDistance
= 50.0f;
47
bFirstTime
=
true
;
48
}
49
50
InstanceScript
*
instance
;
51
52
uint32
uiAcidTimer
;
53
uint32
uiLeechTimer
;
54
uint32
uiPierceTimer
;
55
uint32
uiGrabTimer
;
56
uint32
uiDoorsTimer
;
57
uint32
uiCheckDistanceTimer
;
58
59
bool
bFirstTime
;
60
61
float
fMaxDistance
;
62
63
void
Reset
()
OVERRIDE
64
{
65
me
->SetFloatValue(
UNIT_FIELD_BOUNDING_RADIUS
, 9.0f);
66
me
->SetFloatValue(
UNIT_FIELD_COMBAT_REACH
, 9.0f);
67
68
uiAcidTimer
= std::rand() % (14 *
IN_MILLISECONDS
) + (10*
IN_MILLISECONDS
);
69
uiLeechTimer
= std::rand() % (9 *
IN_MILLISECONDS
) + (3*
IN_MILLISECONDS
);
70
uiPierceTimer
= std::rand() % (3 *
IN_MILLISECONDS
) + (1*
IN_MILLISECONDS
);
71
uiGrabTimer
= std::rand() % (19 *
IN_MILLISECONDS
) + (15*
IN_MILLISECONDS
);
72
uiDoorsTimer
= std::rand() % (30 *
IN_MILLISECONDS
) + (20*
IN_MILLISECONDS
);
73
uiCheckDistanceTimer
= 2*
IN_MILLISECONDS
;
74
75
if
(
instance
&& (
instance
->GetBossState(
DATA_HADRONOX
) !=
DONE
&& !
bFirstTime
))
76
instance
->SetBossState(
DATA_HADRONOX
,
FAIL
);
77
78
bFirstTime
=
false
;
79
}
80
81
//when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on
82
void
KilledUnit
(
Unit
* Victim)
OVERRIDE
83
{
84
// not sure if this aura check is correct, I think it is though
85
if
(!Victim || !Victim->HasAura(
DUNGEON_MODE
(
SPELL_LEECH_POISON
,
H_SPELL_LEECH_POISON
)) || !
me
->IsAlive())
86
return
;
87
88
me
->ModifyHealth(
int32
(
me
->CountPctFromMaxHealth(10)));
89
}
90
91
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
92
{
93
if
(
instance
)
94
instance
->SetBossState(
DATA_HADRONOX
,
DONE
);
95
}
96
97
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
98
{
99
if
(
instance
)
100
instance
->SetBossState(
DATA_HADRONOX
,
IN_PROGRESS
);
101
me
->SetInCombatWithZone();
102
}
103
104
void
CheckDistance
(
float
dist,
const
uint32
uiDiff)
105
{
106
if
(!
me
->IsInCombat())
107
return
;
108
109
float
x=0.0f, y=0.0f, z=0.0f;
110
me
->GetRespawnPosition(x, y, z);
111
112
if
(
uiCheckDistanceTimer
<= uiDiff)
113
uiCheckDistanceTimer
= 5*
IN_MILLISECONDS
;
114
else
115
{
116
uiCheckDistanceTimer
-= uiDiff;
117
return
;
118
}
119
if
(
me
->IsInEvadeMode() || !
me
->GetVictim())
120
return
;
121
if
(
me
->GetDistance(x, y, z) > dist)
122
EnterEvadeMode
();
123
}
124
125
void
UpdateAI
(
uint32
diff)
OVERRIDE
126
{
127
//Return since we have no target
128
if
(!
UpdateVictim
())
129
return
;
130
131
// Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge!
132
CheckDistance
(
fMaxDistance
, diff);
133
134
if
(
me
->HasAura(
SPELL_WEB_FRONT_DOORS
) ||
me
->HasAura(
SPELL_WEB_SIDE_DOORS
))
135
{
136
if
(
IsCombatMovementAllowed
())
137
SetCombatMovement
(
false
);
138
}
139
else
if
(!
IsCombatMovementAllowed
())
140
SetCombatMovement
(
true
);
141
142
if
(
uiPierceTimer
<= diff)
143
{
144
DoCastVictim
(
SPELL_PIERCE_ARMOR
);
145
uiPierceTimer
= 8*
IN_MILLISECONDS
;
146
}
else
uiPierceTimer
-= diff;
147
148
if
(
uiAcidTimer
<= diff)
149
{
150
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
151
DoCast
(target,
SPELL_ACID_CLOUD
);
152
153
uiAcidTimer
= std::rand() % (30 *
IN_MILLISECONDS
) + (20*
IN_MILLISECONDS
);
154
}
else
uiAcidTimer
-= diff;
155
156
if
(
uiLeechTimer
<= diff)
157
{
158
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
159
DoCast
(target,
SPELL_LEECH_POISON
);
160
161
uiLeechTimer
= std::rand() % (14 *
IN_MILLISECONDS
) + (11*
IN_MILLISECONDS
);
162
}
else
uiLeechTimer
-= diff;
163
164
if
(
uiGrabTimer
<= diff)
165
{
166
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0))
// Draws all players (and attacking Mobs) to itself.
167
DoCast
(target,
SPELL_WEB_GRAB
);
168
169
uiGrabTimer
= std::rand() % (30 *
IN_MILLISECONDS
) + (15*
IN_MILLISECONDS
);
170
}
else
uiGrabTimer
-= diff;
171
172
if
(
uiDoorsTimer
<= diff)
173
{
174
uiDoorsTimer
= std::rand() % (60 *
IN_MILLISECONDS
) + (30*
IN_MILLISECONDS
);
175
}
else
uiDoorsTimer
-= diff;
176
177
DoMeleeAttackIfReady
();
178
}
179
};
180
181
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
182
{
183
return
new
boss_hadronoxAI
(creature);
184
}
185
};
186
187
void
AddSC_boss_hadronox
()
188
{
189
new
boss_hadronox
();
190
}
Spells
Spells
Definition
BattlegroundIC.h:645
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:125
int32
std::int32_t int32
Definition
Define.h:73
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
FAIL
@ FAIL
Definition
InstanceScript.h:48
DONE
@ DONE
Definition
InstanceScript.h:49
ScriptMgr.h
ScriptedCreature.h
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
UNIT_FIELD_BOUNDING_RADIUS
@ UNIT_FIELD_BOUNDING_RADIUS
Definition
UpdateFields.h:87
UNIT_FIELD_COMBAT_REACH
@ UNIT_FIELD_COMBAT_REACH
Definition
UpdateFields.h:88
azjol_nerub.h
DATA_HADRONOX
@ DATA_HADRONOX
Definition
azjol_nerub.h:17
SPELL_LEECH_POISON
@ SPELL_LEECH_POISON
Definition
boss_hadronox.cpp:26
SPELL_ACID_CLOUD
@ SPELL_ACID_CLOUD
Definition
boss_hadronox.cpp:25
SPELL_WEB_FRONT_DOORS
@ SPELL_WEB_FRONT_DOORS
Definition
boss_hadronox.cpp:29
H_SPELL_ACID_CLOUD
@ H_SPELL_ACID_CLOUD
Definition
boss_hadronox.cpp:31
SPELL_WEB_GRAB
@ SPELL_WEB_GRAB
Definition
boss_hadronox.cpp:28
H_SPELL_WEB_GRAB
@ H_SPELL_WEB_GRAB
Definition
boss_hadronox.cpp:33
SPELL_WEB_SIDE_DOORS
@ SPELL_WEB_SIDE_DOORS
Definition
boss_hadronox.cpp:30
H_SPELL_LEECH_POISON
@ H_SPELL_LEECH_POISON
Definition
boss_hadronox.cpp:32
SPELL_PIERCE_ARMOR
@ SPELL_PIERCE_ARMOR
Definition
boss_hadronox.cpp:27
AddSC_boss_hadronox
void AddSC_boss_hadronox()
Definition
boss_hadronox.cpp:187
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode()
Definition
CreatureAI.cpp:130
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
InstanceScript
Definition
InstanceScript.h:123
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
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_hadronox
Definition
boss_hadronox.cpp:37
boss_hadronox::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_hadronox.cpp:181
boss_hadronox::boss_hadronox
boss_hadronox()
Definition
boss_hadronox.cpp:39
ScriptedAI::SetCombatMovement
void SetCombatMovement(bool allowMovement)
Definition
ScriptedCreature.cpp:394
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::IsCombatMovementAllowed
bool IsCombatMovementAllowed() const
Definition
ScriptedCreature.h:267
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
ScriptedAI::DUNGEON_MODE
const T & DUNGEON_MODE(const T &normal5, const T &heroic5) const
Definition
ScriptedCreature.h:294
boss_hadronox::boss_hadronoxAI
Definition
boss_hadronox.cpp:42
boss_hadronox::boss_hadronoxAI::instance
InstanceScript * instance
Definition
boss_hadronox.cpp:50
boss_hadronox::boss_hadronoxAI::fMaxDistance
float fMaxDistance
Definition
boss_hadronox.cpp:61
boss_hadronox::boss_hadronoxAI::uiPierceTimer
uint32 uiPierceTimer
Definition
boss_hadronox.cpp:54
boss_hadronox::boss_hadronoxAI::bFirstTime
bool bFirstTime
Definition
boss_hadronox.cpp:59
boss_hadronox::boss_hadronoxAI::uiDoorsTimer
uint32 uiDoorsTimer
Definition
boss_hadronox.cpp:56
boss_hadronox::boss_hadronoxAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_hadronox.cpp:97
boss_hadronox::boss_hadronoxAI::boss_hadronoxAI
boss_hadronoxAI(Creature *creature)
Definition
boss_hadronox.cpp:43
boss_hadronox::boss_hadronoxAI::uiAcidTimer
uint32 uiAcidTimer
Definition
boss_hadronox.cpp:52
boss_hadronox::boss_hadronoxAI::uiCheckDistanceTimer
uint32 uiCheckDistanceTimer
Definition
boss_hadronox.cpp:57
boss_hadronox::boss_hadronoxAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_hadronox.cpp:91
boss_hadronox::boss_hadronoxAI::KilledUnit
void KilledUnit(Unit *Victim) OVERRIDE
Definition
boss_hadronox.cpp:82
boss_hadronox::boss_hadronoxAI::uiLeechTimer
uint32 uiLeechTimer
Definition
boss_hadronox.cpp:53
boss_hadronox::boss_hadronoxAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_hadronox.cpp:125
boss_hadronox::boss_hadronoxAI::CheckDistance
void CheckDistance(float dist, const uint32 uiDiff)
Definition
boss_hadronox.cpp:104
boss_hadronox::boss_hadronoxAI::Reset
void Reset() OVERRIDE
Definition
boss_hadronox.cpp:63
boss_hadronox::boss_hadronoxAI::uiGrabTimer
uint32 uiGrabTimer
Definition
boss_hadronox.cpp:55
src
server
scripts
Northrend
AzjolNerub
AzjolNerub
boss_hadronox.cpp
Generated on
for Project SkyFire Core by
1.17.0