Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_vazruden_the_herald.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
7Name: Boss_Vazruden_the_Herald
8%Complete: 90
9Comment:
10Category: Hellfire Citadel, Hellfire Ramparts
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "SpellInfo.h"
16#include "hellfire_ramparts.h"
17
18enum Says
19{
21
26
28};
29
44
45const float VazrudenMiddle[3] = { -1406.5f, 1746.5f, 81.2f };
46
47const float VazrudenRing[2][3] =
48{
49 { -1430.0f, 1705.0f, 112.0f },
50 { -1377.0f, 1760.0f, 112.0f }
51};
52
54{
55 public:
56 boss_nazan() : CreatureScript("boss_nazan") { }
57
58 struct boss_nazanAI : public BossAI
59 {
60 boss_nazanAI(Creature* creature) : BossAI(creature, DATA_NAZAN)
61 {
62 VazrudenGUID = 0;
63 flight = true;
64 }
65
67 {
68 Fireball_Timer = 4000;
69 Fly_Timer = 45000;
70 Turn_Timer = 0;
71 }
72
73 void EnterCombat(Unit* /*who*/) OVERRIDE { }
74
75 void IsSummonedBy(Unit* summoner) OVERRIDE
76 {
77 if (summoner->GetEntry() == NPC_VAZRUDEN_HERALD)
78 VazrudenGUID = summoner->GetGUID();
79 }
80
82 {
83 if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE)
84 {
85 summoned->SetLevel(me->getLevel());
86 summoned->setFaction(me->getFaction());
87 summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE, SPELL_SUMMON_LIQUID_FIRE_H), true);
88 summoned->CastSpell(summoned, SPELL_FIRE_NOVA_VISUAL, true);
89 }
90 }
91
92 void SpellHitTarget(Unit* target, const SpellInfo* entry) OVERRIDE
93 {
94 if (target && entry->Id == uint32(SPELL_FIREBALL))
95 me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TempSummonType::TEMPSUMMON_TIMED_DESPAWN, 30000);
96 }
97
99 {
100 if (!UpdateVictim())
101 return;
102
103 if (Fireball_Timer <= diff)
104 {
105 if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0))
107 Fireball_Timer = std::rand() % 7000 + 4000;
108 }
109 else
110 Fireball_Timer -= diff;
111
112 if (flight) // phase 1 - the flight
113 {
115 if (Fly_Timer < diff || !(Vazruden && Vazruden->IsAlive() && Vazruden->HealthAbovePct(20)))
116 {
117 flight = false;
118 BellowingRoar_Timer = 6000;
119 ConeOfFire_Timer = 12000;
120 me->SetDisableGravity(false);
121 me->SetWalk(true);
122 me->GetMotionMaster()->Clear();
123 if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0))
124 me->AI()->AttackStart(victim);
125 DoStartMovement(me->GetVictim());
126 Talk(EMOTE);
127 return;
128 }
129 else
130 Fly_Timer -= diff;
131
132 if (Turn_Timer <= diff)
133 {
134 uint32 waypoint = (Fly_Timer/10000)%2;
135 if (!me->IsWithinDist3d(VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2], 5))
136 me->GetMotionMaster()->MovePoint(0, VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2]);
137 Turn_Timer = 10000;
138 }
139 else
140 Turn_Timer -= diff;
141 }
142 else // phase 2 - land fight
143 {
144 if (ConeOfFire_Timer <= diff)
145 {
147 ConeOfFire_Timer = 12000;
148 Fireball_Timer = 4000;
149 }
150 else
151 ConeOfFire_Timer -= diff;
152
153 if (IsHeroic())
154 {
155 if (BellowingRoar_Timer <= diff)
156 {
158 BellowingRoar_Timer = 45000;
159 }
160 else
161 BellowingRoar_Timer -= diff;
162 }
163
165 }
166 }
167
168 private:
174 bool flight;
176 };
177
179 {
180 return new boss_nazanAI(creature);
181 }
182};
183
185{
186 public:
187 boss_vazruden() : CreatureScript("boss_vazruden") { }
188
189 struct boss_vazrudenAI : public BossAI
190 {
191 boss_vazrudenAI(Creature* creature) : BossAI(creature, DATA_VAZRUDEN) { }
192
194 {
195 Revenge_Timer = 4000;
196 UnsummonCheck = 2000;
197 WipeSaid = false;
198 _Reset();
199 }
200
201 void EnterCombat(Unit* /*who*/) OVERRIDE
202 {
204 _EnterCombat();
205 }
206
208 {
209 if (who && who->GetEntry() != NPC_VAZRUDEN)
210 Talk(SAY_KILL);
211 }
212
213 void JustDied(Unit* killer) OVERRIDE
214 {
215 if (killer && killer != me)
216 Talk(SAY_DIE);
217 _JustDied();
218 }
219
221 {
222 if (!UpdateVictim())
223 {
224 if (UnsummonCheck < diff && me->IsAlive())
225 {
226 if (!WipeSaid)
227 {
228 Talk(SAY_WIPE);
229 WipeSaid = true;
230 }
231 me->DisappearAndDie();
232 }
233 else
234 UnsummonCheck -= diff;
235 return;
236 }
237
238 if (Revenge_Timer <= diff)
239 {
240 if (Unit* victim = me->GetVictim())
242 Revenge_Timer = 5000;
243 }
244 else
245 Revenge_Timer -= diff;
246
248 }
249
250 private:
254 };
255
257 {
258 return new boss_vazrudenAI(creature);
259 }
260};
261
263{
264 public:
265 boss_vazruden_the_herald() : CreatureScript("boss_vazruden_the_herald") { }
266
268 {
270 {
271 summoned = false;
272 sentryDown = false;
273 lootSpawned = false;
274 NazanGUID = 0;
275 VazrudenGUID = 0;
276 }
277
279 {
280 phase = 0;
281 waypoint = 0;
282 check = 0;
283 UnsummonAdds();
284 }
285
287 {
288 if (summoned)
289 {
291 if (!Nazan)
292 Nazan = me->FindNearestCreature(NPC_NAZAN, 5000);
293 if (Nazan)
294 {
295 Nazan->DisappearAndDie();
296 NazanGUID = 0;
297 }
298
300 if (!Vazruden)
301 Vazruden = me->FindNearestCreature(NPC_VAZRUDEN, 5000);
302 if (Vazruden)
303 {
304 Vazruden->DisappearAndDie();
305 VazrudenGUID = 0;
306 }
307 summoned = false;
308 me->ClearUnitState(UNIT_STATE_ROOT);
309 me->SetVisible(true);
310 }
311 }
312
314 {
315 if (!summoned)
316 {
318 VazrudenGUID = Vazruden->GetGUID();
320 NazanGUID = Nazan->GetGUID();
321 summoned = true;
322 me->SetVisible(false);
323 me->AddUnitState(UNIT_STATE_ROOT);
324 }
325 }
326
327 void EnterCombat(Unit* /*who*/) OVERRIDE
328 {
329 if (phase == 0)
330 {
331 phase = 1;
332 check = 0;
334 }
335 }
336
338 {
339 if (!summoned)
340 return;
341 Unit* victim = me->GetVictim();
342 if (summoned->GetEntry() == NPC_NAZAN)
343 {
344 summoned->SetDisableGravity(true);
345 summoned->SetSpeed(MOVE_FLIGHT, 2.5f);
346 if (victim)
347 AttackStartNoMove(victim);
348 }
349 else
350 if (victim)
351 summoned->AI()->AttackStart(victim);
352 }
353
354 void SentryDownBy(Unit* killer)
355 {
356 if (sentryDown)
357 {
358 AttackStartNoMove(killer);
359 sentryDown = false;
360 }
361 else
362 sentryDown = true;
363 }
364
366 {
367 switch (phase)
368 {
369 case 0: // circle around the platform
370 return;
371 break;
372 case 1: // go to the middle and begin the fight
373 if (check <= diff)
374 {
375 if (!me->IsWithinDist3d(VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 5))
376 {
377 me->GetMotionMaster()->Clear();
378 me->GetMotionMaster()->MovePoint(0, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2]);
379 check = 1000;
380 }
381 else
382 {
383 SummonAdds();
384 phase = 2;
385 return;
386 }
387 }
388 else
389 check -= diff;
390 break;
391 default: // adds do the job now
392 if (check <= diff)
393 {
396 if ((Nazan && Nazan->IsAlive()) || (Vazruden && Vazruden->IsAlive()))
397 {
398 if ((Nazan && Nazan->GetVictim()) || (Vazruden && Vazruden->GetVictim()))
399 return;
400 else
401 {
402 UnsummonAdds();
404 return;
405 }
406 }
407 else if (!lootSpawned)
408 {
410 me->SetLootRecipient(NULL); // don't think this is necessary..
411 //me->Kill(me);
412 lootSpawned = true;
413 }
414 check = 2000;
415 }
416 else
417 check -= diff;
418 break;
419 }
420 }
421
422 private:
431 };
432
434 {
435 return new boss_vazruden_the_heraldAI(creature);
436 }
437};
438
440{
441 public:
442 npc_hellfire_sentry() : CreatureScript("npc_hellfire_sentry") { }
443
445 {
446 npc_hellfire_sentryAI(Creature* creature) : ScriptedAI(creature) { }
447
449 {
450 KidneyShot_Timer = std::rand() % 7000 + 3000;
451 }
452
453 void EnterCombat(Unit* /*who*/) OVERRIDE { }
454
455 void JustDied(Unit* killer) OVERRIDE
456 {
457 if (Creature* herald = me->FindNearestCreature(NPC_VAZRUDEN_HERALD, 150))
458 CAST_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(killer);
459 }
460
462 {
463 if (!UpdateVictim())
464 return;
465
466 if (KidneyShot_Timer <= diff)
467 {
468 if (Unit* victim = me->GetVictim())
469 DoCast(victim, SPELL_KIDNEY_SHOT);
470 KidneyShot_Timer = 20000;
471 }
472 else
473 KidneyShot_Timer -= diff;
474
476 }
477
478 private:
480 };
481
483 {
484 return new npc_hellfire_sentryAI(creature);
485 }
486};
494
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:73
#define CAST_AI(a, b)
@ UNIT_STATE_ROOT
Definition Unit.h:522
@ MOVE_FLIGHT
Definition Unit.h:561
@ SELECT_TARGET_NEAREST
Definition UnitAI.h:26
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
static float waypoint[6][3]
Definition boss_alar.cpp:36
@ SAY_INTRO
@ SPELL_FIREBALL
#define SAY_AGGRO
#define SAY_KILL
@ SPELL_FIREBALL_H
@ SPELL_BELLOWING_ROAR
const float VazrudenRing[2][3]
@ SPELL_SUMMON_LIQUID_FIRE
@ SPELL_SUMMON_LIQUID_FIRE_H
void AddSC_boss_vazruden_the_herald()
const float VazrudenMiddle[3]
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
virtual void EnterEvadeMode()
void DisappearAndDie()
Definition Creature.cpp:206
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
Definition Unit.h:1367
bool HealthAbovePct(int32 pct) const
Definition Unit.h:1621
bool IsAlive() const
Definition Unit.h:2032
static Creature * GetCreature(WorldObject &object, uint64 guid)
Definition Unit.cpp:4905
Unit * GetVictim() const
Definition Unit.h:1468
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ NPC_VAZRUDEN
@ NPC_NAZAN
@ NPC_VAZRUDEN_HERALD
@ NPC_LIQUID_FIRE
@ GO_FEL_IRON_CHECT_HEROIC
@ GO_FEL_IRON_CHEST_NORMAL
@ DATA_VAZRUDEN
@ DATA_NAZAN
bool IsHeroic() const
Creature * me
void AttackStartNoMove(Unit *target)
ScriptedAI(Creature *creature)
const T & DUNGEON_MODE(const T &normal5, const T &heroic5) const
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
void JustSummoned(Creature *summoned) OVERRIDE
void IsSummonedBy(Unit *summoner) OVERRIDE
void SpellHitTarget(Unit *target, const SpellInfo *entry) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ SPELL_REVENGE
Definition zulfarrak.cpp:44