Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_urom.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
7SDName: Urom
8SD%Complete: 80
9SDComment: Is not working SPELL_ARCANE_SHIELD. SPELL_FROSTBOMB has some issues, the damage aura should not stack.
10SDCategory: Instance Script
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "oculus.h"
16#include "SpellInfo.h"
17
19{
20 SPELL_ARCANE_SHIELD = 53813, //Dummy --> Channeled, shields the caster from damage.
23 SPELL_FROSTBOMB = 51103, //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute.
24 SPELL_SUMMON_MENAGERIE = 50476, //Summons an assortment of creatures and teleports the caster to safety.
27 SPELL_TELEPORT = 51112, //Teleports to the center of Oculus
28 SPELL_TIME_BOMB = 51121, //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff.
30 SPELL_EVOCATE = 51602 // He always cast it on reset or after teleportation
31};
32
44
59
60struct Summons
61{
63};
64
71
76
78{
79public:
80 boss_urom() : CreatureScript("boss_urom") {}
81
83 {
84 return new boss_uromAI(creature);
85 }
86
87 struct boss_uromAI : public BossAI
88 {
90 {
91 x = 0.0f;
92 y = 0.0f;
93
94 canCast = false;
95 canGoBack = false;
96
97 for (uint8 i = 0; i < 3; ++i)
98 group[i] = 0;
99
100 teleportTimer = 0;
103 frostBombTimer = 0;
104 timeBombTimer = 0;
105 }
106
108 {
109 me->CastSpell(me, SPELL_EVOCATE);
110
111 _Reset();
112
113 if (instance->GetData(DATA_UROM_PLATAFORM) == 0)
114 {
115 for (uint8 i = 0; i < 3; i++)
116 group[i] = 0;
117 }
118
119 x = 0.0f;
120 y = 0.0f;
121 canCast = false;
122 canGoBack = false;
123
124 me->GetMotionMaster()->MoveIdle();
125
126 teleportTimer = std::rand() % 35000 + 30000;
129 frostBombTimer = std::rand() % 8000 + 5000;
130 timeBombTimer = std::rand() % 25000 + 20000;
131 }
132
133 void EnterCombat(Unit* /*who*/) OVERRIDE
134 {
135 _EnterCombat();
136
137 SetGroups();
138 SummonGroups();
139 CastTeleport();
140
141 if (instance->GetData(DATA_UROM_PLATAFORM) != 3)
143 }
144
146 {
147 if (!who)
148 return;
149
150 if (me->GetPositionZ() > 518.63f)
152
153 if (me->GetPositionZ() < 518.63f)
154 {
155 if (me->Attack(who, true))
156 {
158
159 me->SetInCombatWith(who);
160 who->SetInCombatWith(me);
161
162 me->GetMotionMaster()->MoveChase(who, 0, 0);
163 }
164 }
165 }
166
168 {
169 if (!instance || instance->GetData(DATA_UROM_PLATAFORM) != 0)
170 return;
171
172 while (group[0] == group[1] || group[0] == group[2] || group[1] == group[2])
173 {
174 for (uint8 i = 0; i < 3; i++)
175 group[i] = std::rand() % 2;
176 }
177 }
178
180 {
181 switch (i)
182 {
183 case 0:
184 x = me->GetPositionX() + 4;
185 y = me->GetPositionY() - 4;
186 break;
187 case 1:
188 x = me->GetPositionX() + 4;
189 y = me->GetPositionY() + 4;
190 break;
191 case 2:
192 x = me->GetPositionX() - 4;
193 y = me->GetPositionY() + 4;
194 break;
195 case 3:
196 x = me->GetPositionX() - 4;
197 y = me->GetPositionY() - 4;
198 break;
199 default:
200 break;
201 }
202 }
203
205 {
206 if (!instance || instance->GetData(DATA_UROM_PLATAFORM) > 2)
207 return;
208
209 for (uint8 i = 0; i < 4; i++)
210 {
211 SetPosition(i);
212 me->SummonCreature(Group[group[instance->GetData(DATA_UROM_PLATAFORM)]].entry[i], x, y, me->GetPositionZ(), me->GetOrientation());
213
214 // teleport to next platform and spawn adds
215 switch (instance->GetData(DATA_UROM_PLATAFORM))
216 {
217 case 1:
219 break;
220 case 2:
222 break;
223 case 3:
225 break;
226 default:
227 break;
228 }
229 }
230 }
231
233 {
234 if (!instance || instance->GetData(DATA_UROM_PLATAFORM) > 2)
235 return;
236
237 Talk(instance->GetData(DATA_UROM_PLATAFORM) < 5 ? instance->GetData(DATA_UROM_PLATAFORM) : 0);
239 }
240
241 void KilledUnit(Unit* /*victim*/) OVERRIDE
242 {
244 }
245
247 {
248 if (!UpdateVictim())
249 return;
250
251 if (!instance || instance->GetData(DATA_UROM_PLATAFORM) < 2)
252 return;
253
254 if (teleportTimer <= uiDiff)
255 {
256 me->InterruptNonMeleeSpells(false);
257 me->GetMotionMaster()->MoveIdle();
259 teleportTimer = std::rand() % 35000 + 30000;
260
261 }
262 else teleportTimer -= uiDiff;
263
264 if (canCast && !me->FindCurrentSpellBySpellId(SPELL_EMPOWERED_ARCANE_EXPLOSION))
265 {
266 if (castArcaneExplosionTimer <= uiDiff)
267 {
268 canCast = false;
269 canGoBack = true;
272 }
273 else castArcaneExplosionTimer -= uiDiff;
274 }
275
276 if (canGoBack)
277 {
278 if (arcaneExplosionTimer <= uiDiff)
279 {
280 Position pPos;
281 me->GetVictim()->GetPosition(&pPos);
282
283 me->NearTeleportTo(pPos.GetPositionX(), pPos.GetPositionY(), pPos.GetPositionZ(), pPos.GetOrientation());
284 me->GetMotionMaster()->MoveChase(me->GetVictim(), 0, 0);
285 me->SetWalk(true);
286
289
290 canCast = false;
291 canGoBack = false;
293 }
294 else arcaneExplosionTimer -= uiDiff;
295 }
296
297 if (!me->IsNonMeleeSpellCasted(false, true, true))
298 {
299 if (frostBombTimer <= uiDiff)
300 {
302 frostBombTimer = std::rand() % 8000 + 5000;
303 }
304 else frostBombTimer -= uiDiff;
305
306 if (timeBombTimer <= uiDiff)
307 {
309 DoCast(unit, SPELL_TIME_BOMB);
310
311 timeBombTimer = std::rand() % 25000 + 20000;
312 }
313 else timeBombTimer -= uiDiff;
314 }
315
317 }
318
319 void JustDied(Unit* /*killer*/) OVERRIDE
320 {
321 _JustDied();
323 DoCast(me, SPELL_DEATH_SPELL, true); // we cast the spell as triggered or the summon effect does not occur
324 }
325
327 {
328 me->RemoveAllAuras();
329 me->CombatStop(false);
330 me->DeleteThreatList();
331 }
332
333 void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) OVERRIDE
334 {
335 switch (pSpell->Id)
336 {
338 me->SetHomePosition(968.66f, 1042.53f, 527.32f, 0.077f);
339 LeaveCombat();
340 me->CastSpell(me, SPELL_EVOCATE);
341 break;
343 me->SetHomePosition(1164.02f, 1170.85f, 527.321f, 3.66f);
344 LeaveCombat();
345 me->CastSpell(me, SPELL_EVOCATE);
346 break;
348 me->SetHomePosition(1118.31f, 1080.377f, 508.361f, 4.25f);
349 LeaveCombat();
350 me->CastSpell(me, SPELL_EVOCATE);
351 break;
352 case SPELL_TELEPORT:
354 me->SetDisableGravity(true);
355 //me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting
356 canCast = true;
357 break;
358 default:
359 break;
360 }
361 }
362 private:
363 float x, y;
364
367
369
375 };
376};
377
379{
380 new boss_urom();
381}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
Creatures
@ SAY_PLAYER_KILL
#define SAY_DEATH
#define SAY_AGGRO
@ NPC_PHANTASMAL_WATER
Definition boss_urom.cpp:53
@ NPC_PHANTASMAL_WOLF
Definition boss_urom.cpp:49
@ NPC_PHANTASMAL_NAGAL
Definition boss_urom.cpp:56
@ NPC_PHANTASMAL_FIRE
Definition boss_urom.cpp:52
@ NPC_PHANTASMAL_OGRE
Definition boss_urom.cpp:57
@ NPC_PHANTASMAL_AIR
Definition boss_urom.cpp:51
@ NPC_PHANTASMAL_MURLOC
Definition boss_urom.cpp:55
@ NPC_PHANTASMAL_MAMMOTH
Definition boss_urom.cpp:48
@ NPC_PHANTASMAL_CLOUDSCRAPER
Definition boss_urom.cpp:47
@ SAY_DEATH
Definition boss_urom.cpp:41
@ EMOTE_ARCANE_EXPLOSION
Definition boss_urom.cpp:39
@ SAY_PLAYER_KILL
Definition boss_urom.cpp:42
@ SAY_SUMMON_3
Definition boss_urom.cpp:37
@ SAY_AGGRO
Definition boss_urom.cpp:38
@ SAY_SUMMON_1
Definition boss_urom.cpp:35
@ SAY_SUMMON_2
Definition boss_urom.cpp:36
@ SAY_ARCANE_EXPLOSION
Definition boss_urom.cpp:40
@ SPELL_ARCANE_SHIELD
Definition boss_urom.cpp:20
@ SPELL_EVOCATE
Definition boss_urom.cpp:30
@ SPELL_SUMMON_MENAGERIE
Definition boss_urom.cpp:24
@ SPELL_TELEPORT
Definition boss_urom.cpp:27
@ SPELL_SUMMON_MENAGERIE_2
Definition boss_urom.cpp:25
@ SPELL_SUMMON_MENAGERIE_3
Definition boss_urom.cpp:26
@ SPELL_TIME_BOMB_2
Definition boss_urom.cpp:29
@ SPELL_EMPOWERED_ARCANE_EXPLOSION_2
Definition boss_urom.cpp:22
@ SPELL_EMPOWERED_ARCANE_EXPLOSION
Definition boss_urom.cpp:21
@ SPELL_FROSTBOMB
Definition boss_urom.cpp:23
@ SPELL_TIME_BOMB
Definition boss_urom.cpp:28
static uint32 TeleportSpells[]
Definition boss_urom.cpp:72
static Summons Group[]
Definition boss_urom.cpp:65
void AddSC_boss_urom()
InstanceScript *const instance
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
Definition Group.h:147
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
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition boss_urom.cpp:82
@ SPELL_DEATH_SPELL
Definition oculus.h:70
@ DATA_UROM_EVENT
Definition oculus.h:13
@ DATA_UROM_PLATAFORM
Definition oculus.h:15
float GetPositionZ() const
Definition Object.h:330
float GetOrientation() const
Definition Object.h:331
float GetPositionX() const
Definition Object.h:328
float GetPositionY() const
Definition Object.h:329
void DoStartNoMovement(Unit *target)
Creature * me
uint32 entry[4]
Definition boss_urom.cpp:62
void KilledUnit(Unit *) OVERRIDE
void Reset() OVERRIDE
void JustDied(Unit *) OVERRIDE
boss_uromAI(Creature *creature)
Definition boss_urom.cpp:89
void EnterCombat(Unit *) OVERRIDE
void SpellHit(Unit *, const SpellInfo *pSpell) OVERRIDE
void SetPosition(uint8 i)
void AttackStart(Unit *who) OVERRIDE
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================