Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_muru.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: Boss_Muru
8SD%Complete: 80
9SDComment: all sounds, black hole effect triggers to often (46228)
10*/
11
12#include "ScriptMgr.h"
13#include "ScriptedCreature.h"
14#include "sunwell_plateau.h"
15#include "Player.h"
16#include "SpellInfo.h"
17
18// Muru & Entropius's spells
20{
21 SPELL_ENRAGE = 26662,
22
23 // Muru's spells
24 SPELL_NEGATIVE_ENERGY = 46009, //(this trigger 46008)
33
34 // Entropius's spells
39
40 // Shadowsword Berserker's spells
41 SPELL_FLURRY = 46160,
43
44 // Shadowsword Fury Mage's spells
47
48 // Void Sentinel's spells
51
52 // Void Spawn's spells
54
55 //Dark Fiend Spells
59
60 //Black Hole Spells
63};
64
71
72float DarkFiends[8][4] =
73{
74 {1819.9f, 609.80f, 69.74f, 1.94f},
75 {1829.39f, 617.89f, 69.73f, 2.61f},
76 {1801.98f, 633.62f, 69.74f, 5.71f},
77 {1830.88f, 629.99f, 69.73f, 3.52f},
78 {1800.38f, 621.41f, 69.74f, 0.22f},
79 {1808.3f, 612.45f, 69.73f, 1.02f},
80 {1823.9f, 639.69f, 69.74f, 4.12f},
81 {1811.85f, 640.46f, 69.73f, 4.97f}
82};
83
84float Humanoides[6][5] =
85{
86 {CREATURE_FURY_MAGE, 1780.16f, 666.83f, 71.19f, 5.21f},
87 {CREATURE_FURY_MAGE, 1847.93f, 600.30f, 71.30f, 2.57f},
88 {CREATURE_BERSERKER, 1779.97f, 660.64f, 71.19f, 5.28f},
89 {CREATURE_BERSERKER, 1786.2f, 661.01f, 71.19f, 4.51f},
90 {CREATURE_BERSERKER, 1845.17f, 602.63f, 71.28f, 2.43f},
91 {CREATURE_BERSERKER, 1842.91f, 599.93f, 71.23f, 2.44f}
92};
93
96{
97public:
98 boss_entropius() : CreatureScript("boss_entropius") { }
99
101 {
103 {
104 instance = creature->GetInstanceScript();
106 }
107
109 {
110 BlackHoleSummonTimer = 15000;
112
113 Summons.DespawnAll();
114
115 if (instance)
117 }
118
119 void EnterCombat(Unit* /*who*/) OVERRIDE
120 {
123
124 if (instance)
126 }
127
129 {
130 switch (summoned->GetEntry())
131 {
133 summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL, false);
134 break;
136 summoned->AddUnitState(UNIT_STATE_STUNNED);
137 float x, y, z, o;
138 summoned->GetHomePosition(x, y, z, o);
140 break;
141 }
142 summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true));
143 Summons.Summon(summoned);
144 }
145
146 void JustDied(Unit* /*killer*/) OVERRIDE
147 {
148 Summons.DespawnAll();
149
150 if (instance)
151 instance->SetData(DATA_MURU_EVENT, DONE);
152 }
153
155 {
156 if (!UpdateVictim())
157 return;
158
160 {
161 DoCast(me, SPELL_ENRAGE, false);
162 } else EnrageTimer -= diff;
163
164 if (BlackHoleSummonTimer <= diff)
165 {
166 Unit* random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
167 if (!random)
168 return;
169
170 DoCast(random, SPELL_DARKNESS_E, false);
171
172 random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
173 if (!random)
174 return;
175
176 random->CastSpell(random, SPELL_BLACKHOLE, false);
177 BlackHoleSummonTimer = 15000;
178 } else BlackHoleSummonTimer -= diff;
179
181 }
182
183 private:
186
188 };
189
191 {
192 return new boss_entropiusAI(creature);
193 }
194};
195
197{
198public:
199 boss_muru() : CreatureScript("boss_muru") { }
200
201 struct boss_muruAI : public ScriptedAI
202 {
203 boss_muruAI(Creature* creature) : ScriptedAI(creature), Summons(creature)
204 {
205 SetCombatMovement(false);
206 instance = creature->GetInstanceScript();
207 Phase = 0;
208
209 for (uint8 j = 0; j < 4; j++)
210 {
211 Timer[j] = 0;
212 }
213
214 DarkFiend = false;
215 }
216
218 {
219 DarkFiend = false;
220 Phase = 1;
221
222 EnrageTimer = 600000;
223 Timer[TIMER_DARKNESS] = 45000;
224 Timer[TIMER_HUMANOIDES] = 10000;
225 Timer[TIMER_PHASE] = 2000;
226 Timer[TIMER_SENTINEL] = 31500;
227
229 me->SetVisible(true);
230
231 Summons.DespawnAll();
232
233 if (instance)
235 }
236
237 void EnterCombat(Unit* /*who*/) OVERRIDE
238 {
240
241 if (instance)
243 }
244
245 void DamageTaken(Unit* /*done_by*/, uint32 &damage) OVERRIDE
246 {
247 if (damage > me->GetHealth() && Phase == 1)
248 {
249 damage = 0;
250 Phase = 2;
251 me->RemoveAllAuras();
254 }
255 if (Phase > 1 && Phase < 4)
256 damage = 0;
257 }
258
260 {
261 switch (summoned->GetEntry())
262 {
263 case BOSS_ENTROPIUS:
264 me->SetVisible(false);
265 break;
267 summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL, false);
268 break;
269 }
270 summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true));
271 Summons.Summon(summoned);
272 }
273
275 {
276 if (!UpdateVictim())
277 return;
278
279 if (Phase == 3)
280 {
281 if (Timer[TIMER_PHASE] <= diff)
282 {
283 if (!instance)
284 return;
285 switch (instance->GetData(DATA_MURU_EVENT))
286 {
287 case NOT_STARTED:
288 Reset();
289 break;
290 case DONE:
291 Phase = 4;
292 me->DisappearAndDie();
293 break;
294 }
295 Timer[TIMER_PHASE] = 3000;
296 } else Timer[TIMER_PHASE] -= diff;
297 return;
298 }
299
301 {
302 DoCast(me, SPELL_ENRAGE, false);
303 } else EnrageTimer -= diff;
304
305 for (uint8 i = 0; i < 4; ++i)
306 {
307 if (Timer[i] <= diff)
308 {
309 switch (i)
310 {
311 case TIMER_DARKNESS:
312 if (!DarkFiend)
313 {
315 Timer[TIMER_DARKNESS] = 3000;
316 DarkFiend = true;
317 }
318 else
319 {
320 DarkFiend = false;
321 for (uint8 j = 0; j < 8; ++j)
323 Timer[TIMER_DARKNESS] = 42000;
324 }
325 break;
326 case TIMER_HUMANOIDES:
327 for (uint8 j = 0; j < 6; ++j)
328 me->SummonCreature(uint32(Humanoides[j][0]), Humanoides[j][1], Humanoides[j][2], Humanoides[j][3], Humanoides[j][4], TempSummonType::TEMPSUMMON_CORPSE_DESPAWN, 0);
329 Timer[TIMER_HUMANOIDES] = 60000;
330 break;
331 case TIMER_PHASE:
332 me->RemoveAllAuras();
334 Timer[TIMER_PHASE] = 3000;
335 Phase = 3;
336 return;
337 case TIMER_SENTINEL:
339 Timer[TIMER_SENTINEL] = 30000;
340 break;
341 }
342 break;
343 }
344 }
345
346 //Timer
347 for (uint8 i = 0; i < 4; ++i)
348 {
349 if (i != TIMER_PHASE)Timer[i] -= diff;
350 else if (Phase == 2) Timer[i] -= diff;
351 }
352 }
353
354 private:
357
360
362 };
363
365 {
366 return new boss_muruAI(creature);
367 }
368};
369
371{
372public:
373 npc_muru_portal() : CreatureScript("npc_muru_portal") { }
374
376 {
377 npc_muru_portalAI(Creature* creature) : ScriptedAI(creature), Summons(creature)
378 {
379 SetCombatMovement(false);
380 instance = creature->GetInstanceScript();
381 SummonSentinel = false;
382 InAction = false;
383 SummonTimer = 0;
384 }
385
387 {
388 SummonTimer = 5000;
389
390 InAction = false;
391 SummonSentinel = false;
392
393 me->AddUnitState(UNIT_STATE_STUNNED);
394
395 Summons.DespawnAll();
396 }
397
399 {
400 if (instance)
401 if (Player* Target = ObjectAccessor::GetPlayer(*me, instance->GetData64(DATA_PLAYER_GUID)))
402 summoned->AI()->AttackStart(Target);
403
404 Summons.Summon(summoned);
405 }
406
407 void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) OVERRIDE
408 {
409 float x, y, z, o;
410 me->GetHomePosition(x, y, z, o);
411 DoTeleportTo(x, y, z);
412 InAction = true;
413 switch (Spell->Id)
414 {
417 break;
420 SummonSentinel = true;
421 break;
422 }
423 }
424
426 {
427 if (!SummonSentinel)
428 {
430 Reset();
431 return;
432 }
433 if (SummonTimer <= diff)
434 {
436 SummonTimer = 5000;
437 SummonSentinel = false;
438 } else SummonTimer -= diff;
439 }
440
441 private:
443
445
448
450 };
451
453 {
454 return new npc_muru_portalAI(creature);
455 }
456};
457
459{
460public:
461 npc_dark_fiend() : CreatureScript("npc_dark_fiend") { }
462
464 {
465 npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature)
466 {
467 WaitTimer = 0;
468 InAction = false;
469 }
470
472 {
473 WaitTimer = 2000;
474 InAction = false;
475
476 me->AddUnitState(UNIT_STATE_STUNNED);
477 }
478
479 void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) OVERRIDE
480 {
481 for (uint8 i = 0; i < 3; ++i)
482 if (Spell->Effects[i].Effect == 38)
483 me->DisappearAndDie();
484 }
485
487 {
488 if (!UpdateVictim())
489 return;
490
491 if (WaitTimer <= diff)
492 {
493 if (!InAction)
494 {
495 me->ClearUnitState(UNIT_STATE_STUNNED);
498 InAction = true;
499 WaitTimer = 500;
500 }
501 else
502 {
503 if (me->IsWithinDist(me->GetVictim(), 5))
504 {
506 me->DisappearAndDie();
507 }
508 WaitTimer = 500;
509 }
510 } else WaitTimer -= diff;
511 }
512
513 private:
516 };
517
519 {
520 return new npc_dark_fiendAI(creature);
521 }
522};
523
525{
526public:
527 npc_void_sentinel() : CreatureScript("npc_void_sentinel") { }
528
530 {
532 {
533 PulseTimer = 0;
534 VoidBlastTimer = 0;
535 }
536
538 {
539 PulseTimer = 3000;
540 VoidBlastTimer = 45000; //is this a correct timer?
541
542 float x, y, z, o;
543 me->GetHomePosition(x, y, z, o);
544 DoTeleportTo(x, y, 71);
545 }
546
547 void JustDied(Unit* /*killer*/) OVERRIDE
548 {
549 for (uint8 i = 0; i < 8; ++i)
550 me->SummonCreature(CREATURE_VOID_SPAWN, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%6), TempSummonType::TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
551 }
552
554 {
555 if (!UpdateVictim())
556 return;
557
558 if (PulseTimer <= diff)
559 {
561 PulseTimer = 3000;
562 } else PulseTimer -= diff;
563
564 if (VoidBlastTimer <= diff)
565 {
567 VoidBlastTimer = 45000;
568 } else VoidBlastTimer -= diff;
569
571 }
572
573 private:
576 };
577
579 {
580 return new npc_void_sentinelAI(creature);
581 }
582};
583
585{
586public:
587 npc_blackhole() : CreatureScript("npc_blackhole") { }
588
590 {
591 npc_blackholeAI(Creature* creature) : ScriptedAI(creature)
592 {
593 instance = creature->GetInstanceScript();
594 DespawnTimer = 0;
595 SpellTimer = 0;
596 Phase = 0;
597 NeedForAHack = 0;
598 }
599
601 {
602 DespawnTimer = 15000;
603 SpellTimer = 5000;
604 Phase = 0;
605
606 me->AddUnitState(UNIT_STATE_STUNNED);
608 }
609
611 {
612 if (SpellTimer <= diff)
613 {
614 Unit* Victim = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_PLAYER_GUID) : 0);
615 switch (NeedForAHack)
616 {
617 case 0:
618 me->ClearUnitState(UNIT_STATE_STUNNED);
620 if (Victim)
621 AttackStart(Victim);
622 SpellTimer = 700;
623 NeedForAHack = 2;
624 break;
625 case 1:
626 me->AddAura(SPELL_BLACKHOLE_GROW, me);
627 NeedForAHack = 2;
628 SpellTimer = 600;
629 break;
630 case 2:
631 SpellTimer = 400;
632 NeedForAHack = 3;
633 me->RemoveAura(SPELL_BLACKHOLE_GROW, 1);
634 break;
635 case 3:
636 SpellTimer = std::rand() % 900 + 400;
637 NeedForAHack = 1;
638 if (Unit* Temp = me->GetVictim())
639 {
640 if (Temp->GetPositionZ() > 73 && Victim)
641 AttackStart(Victim);
642 } else
643 return;
644 }
645 } else SpellTimer -= diff;
646
647 if (DespawnTimer <= diff)
648 me->DisappearAndDie();
649 else DespawnTimer -= diff;
650 }
651
652 private:
654
659 };
660
662 {
663 return new npc_blackholeAI(creature);
664 }
665};
666
668{
669 new boss_muru();
670 new boss_entropius();
671 new npc_muru_portal();
672 new npc_dark_fiend();
673 new npc_void_sentinel();
674 new npc_blackhole();
675}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ IN_PROGRESS
@ DONE
@ NOT_STARTED
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:72
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition Object.h:69
@ UNIT_STATE_STUNNED
Definition Unit.h:515
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_FLAGS
@ SPELL_ENRAGE
@ SPELL_DUAL_WIELD
@ TIMER_DARKNESS
@ SPELL_SHADOW_BOLT_VOLLEY
BossTimers
Definition boss_muru.cpp:65
@ TIMER_DARKNESS
Definition boss_muru.cpp:66
@ TIMER_PHASE
Definition boss_muru.cpp:68
@ TIMER_HUMANOIDES
Definition boss_muru.cpp:67
@ TIMER_SENTINEL
Definition boss_muru.cpp:69
@ SPELL_DARKFIEND_AOE
Definition boss_muru.cpp:56
@ SPELL_DARKNESS_E
Definition boss_muru.cpp:35
@ SPELL_DARKNESS
Definition boss_muru.cpp:25
@ SPELL_ENRAGE
Definition boss_muru.cpp:21
@ SPELL_VOID_BLAST
Definition boss_muru.cpp:50
@ SPELL_SUMMON_ENTROPIUS
Definition boss_muru.cpp:32
@ SPELL_BLACKHOLE_GROW
Definition boss_muru.cpp:62
@ SPELL_SUMNON_FURY_MAGE
Definition boss_muru.cpp:30
@ SPELL_SPELL_FURY
Definition boss_muru.cpp:46
@ SPELL_SHADOW_PULSE
Definition boss_muru.cpp:49
@ SPELL_OPEN_PORTAL_2
Definition boss_muru.cpp:28
@ SPELL_NEGATIVE_ENERGY_E
Definition boss_muru.cpp:37
@ SPELL_BLACKHOLE
Definition boss_muru.cpp:36
@ SPELL_OPEN_ALL_PORTALS
Definition boss_muru.cpp:26
@ SPELL_SUMMON_VOID_SENTINEL
Definition boss_muru.cpp:31
@ SPELL_NEGATIVE_ENERGY
Definition boss_muru.cpp:24
@ SPELL_OPEN_PORTAL
Definition boss_muru.cpp:27
@ SPELL_FLURRY
Definition boss_muru.cpp:41
@ SPELL_FEL_FIREBALL
Definition boss_muru.cpp:45
@ SPELL_BLACKHOLE_SPAWN
Definition boss_muru.cpp:61
@ SPELL_SUMMON_BERSERKER
Definition boss_muru.cpp:29
@ SPELL_DARKFIEND_VISUAL
Definition boss_muru.cpp:57
@ SPELL_DARKFIEND_SKIN
Definition boss_muru.cpp:58
@ SPELL_ENTROPIUS_SPAWN
Definition boss_muru.cpp:38
float DarkFiends[8][4]
Definition boss_muru.cpp:72
float Humanoides[6][5]
Definition boss_muru.cpp:84
void AddSC_boss_muru()
uint32 EnrageTimer
Definition boss_muru.cpp:94
bool UpdateVictim()
CreatureScript(const char *name)
static Player * GetPlayer(WorldObject const &, uint64 guid)
Definition Spell.h:289
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
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
static Unit * GetUnit(WorldObject &object, uint64 guid)
Definition Unit.cpp:4895
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
void SetCombatMovement(bool allowMovement)
Creature * me
void DoTeleportTo(float x, float y, float z, uint32 time=0)
ScriptedAI(Creature *creature)
void AttackStart(Unit *) OVERRIDE
void JustSummoned(Creature *summoned) OVERRIDE
boss_entropiusAI(Creature *creature)
void JustDied(Unit *) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
InstanceScript * instance
void JustSummoned(Creature *summoned) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE
boss_muruAI(Creature *creature)
void Reset() OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
npc_blackholeAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *, const SpellInfo *Spell) OVERRIDE
npc_dark_fiendAI(Creature *creature)
void JustSummoned(Creature *summoned) OVERRIDE
npc_muru_portalAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *, const SpellInfo *Spell) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
@ CREATURE_VOID_SPAWN
@ CREATURE_DARK_FIENDS
@ BOSS_ENTROPIUS
@ CREATURE_DARKNESS
@ CREATURE_FURY_MAGE
@ CREATURE_BERSERKER
@ DATA_PLAYER_GUID
@ DATA_MURU_EVENT