Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
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
34};
35
37{
38public:
39 boss_hadronox() : CreatureScript("boss_hadronox") { }
40
42 {
43 boss_hadronoxAI(Creature* creature) : ScriptedAI(creature)
44 {
45 instance = creature->GetInstanceScript();
46 fMaxDistance = 50.0f;
47 bFirstTime = true;
48 }
49
51
58
60
62
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);
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)
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)
123 }
124
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!
133
134 if (me->HasAura(SPELL_WEB_FRONT_DOORS) || me->HasAura(SPELL_WEB_SIDE_DOORS))
135 {
137 SetCombatMovement(false);
138 }
139 else if (!IsCombatMovementAllowed())
140 SetCombatMovement(true);
141
142 if (uiPierceTimer <= diff)
143 {
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
178 }
179 };
180
182 {
183 return new boss_hadronoxAI(creature);
184 }
185};
186
188{
189 new boss_hadronox();
190}
@ IN_MILLISECONDS
Definition Common.h:125
std::int32_t int32
Definition Define.h:73
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ FAIL
@ DONE
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_BOUNDING_RADIUS
@ UNIT_FIELD_COMBAT_REACH
@ DATA_HADRONOX
Definition azjol_nerub.h:17
@ SPELL_LEECH_POISON
@ SPELL_ACID_CLOUD
@ SPELL_WEB_FRONT_DOORS
@ H_SPELL_ACID_CLOUD
@ SPELL_WEB_GRAB
@ H_SPELL_WEB_GRAB
@ SPELL_WEB_SIDE_DOORS
@ H_SPELL_LEECH_POISON
@ SPELL_PIERCE_ARMOR
void AddSC_boss_hadronox()
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
void SetCombatMovement(bool allowMovement)
Creature * me
bool IsCombatMovementAllowed() const
ScriptedAI(Creature *creature)
const T & DUNGEON_MODE(const T &normal5, const T &heroic5) const
void EnterCombat(Unit *) OVERRIDE
boss_hadronoxAI(Creature *creature)
void JustDied(Unit *) OVERRIDE
void KilledUnit(Unit *Victim) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void CheckDistance(float dist, const uint32 uiDiff)