TrinityCore
Loading...
Searching...
No Matches
boss_algalon_the_observer.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "Containers.h"
20#include "DBCStores.h"
21#include "GameObject.h"
22#include "GameObjectAI.h"
23#include "InstanceScript.h"
24#include "Map.h"
25#include "MotionMaster.h"
26#include "MoveSplineInit.h"
27#include "PassiveAI.h"
28#include "Player.h"
29#include "ScriptedCreature.h"
30#include "Spell.h"
31#include "SpellAuraEffects.h"
32#include "SpellInfo.h"
33#include "SpellScript.h"
34#include "TemporarySummon.h"
35#include "ulduar.h"
36
68
114
115uint32 const PhasePunchAlphaId[5] = {64435, 64434, 64428, 64421, 64417};
116
165
175
182
188
197
205
206#define LIVING_CONSTELLATION_COUNT 11
208{
209 {1625.208f, -267.2771f, 446.4296f, 5.044002f},
210 {1658.279f, -262.5490f, 441.9073f, 4.188790f},
211 {1678.677f, -276.3280f, 427.7531f, 3.979351f},
212 {1593.389f, -299.4325f, 432.4636f, 6.073746f},
213 {1685.613f, -300.1219f, 443.2366f, 3.385939f},
214 {1591.706f, -263.8201f, 441.4153f, 5.253441f},
215 {1668.317f, -324.7676f, 457.9394f, 3.211406f},
216 {1592.242f, -325.5323f, 446.9508f, 0.226893f},
217 {1635.821f, -363.3442f, 424.3459f, 1.466077f},
218 {1672.188f, -357.2484f, 436.7337f, 2.338741f},
219 {1615.800f, -348.0065f, 442.9586f, 1.134464f}
220};
221
222#define COLLAPSING_STAR_COUNT 4
224{
225 {1649.438f, -319.8127f, 418.3941f, 1.082104f},
226 {1647.005f, -288.6790f, 417.3955f, 3.490659f},
227 {1622.451f, -321.1563f, 417.6188f, 4.677482f},
228 {1615.060f, -291.6816f, 417.7796f, 3.490659f}
229};
230
231Position const BrannIntroSpawnPos = { 1677.363f, -162.3514f, 427.332f, 3.191144f };
232Position const AlgalonSummonPos = { 1632.531f, -304.8516f, 450.1123f, 1.530165f };
233Position const AlgalonLandPos = { 1632.668f, -302.7656f, 417.3211f, 1.530165f };
234Position const AlgalonOutroPos = {1633.64f, -317.78f, 417.3211f, 0.0f};
235Position const BrannOutroPos = { 1631.989f, -221.5439f, 418.4091f, 4.714909f };
236
238{
239 public:
240 ActivateLivingConstellation(Unit* owner) : _owner(owner), _instance(owner->GetInstanceScript()) { }
241
242 bool Execute(uint64 execTime, uint32 /*diff*/) override
243 {
245 return true; // delete event
246
248 _owner->m_Events.AddEvent(this, Milliseconds(execTime) + randtime(45s, 50s));
249 return false;
250 }
251
252 private:
255};
256
258{
259 public:
260 CosmicSmashDamageEvent(Unit* caster) : _caster(caster) { }
261
262 bool Execute(uint64 /*execTime*/, uint32 /*diff*/) override
263 {
265 return true;
266 }
267
268 private:
270};
271
273{
274 public:
276
277 bool Execute(uint64 execTime, uint32 /*diff*/) override
278 {
280 _caster->m_Events.AddEvent(this, Milliseconds(execTime) + 30s);
281 return false;
282 }
283
284 private:
286};
287
289{
291 {
292 Initialize();
293 _firstPull = true;
294 _fedOnTears = false;
295 }
296
298 {
299 _phaseTwo = false;
300 _fightWon = false;
301 _hasYelled = false;
302 }
303
304 void Reset() override
305 {
306 _Reset();
308 Initialize();
309 }
310
311 void DoAction(int32 action) override
312 {
313 switch (action)
314 {
316 {
318 me->SetDisableGravity(true);
322
323 std::function<void(Movement::MoveSplineInit&)> initializer = [](Movement::MoveSplineInit& init)
324 {
326 init.SetOrientationFixed(true);
327 };
329
330 events.Reset();
333 break;
334 }
335 case ACTION_ASCEND:
339 break;
341 events.Reset();
343 if (me->IsInCombat())
348 me->DespawnOrUnsummon(34s);
350 me->SetImmuneToNPC(true);
351 break;
353 _firstPull = false;
354 me->SetImmuneToPC(false);
355 break;
356 default:
357 break;
358 }
359 }
360
361 uint32 GetData(uint32 type) const override
362 {
363 return type == DATA_HAS_FED_ON_TEARS ? _fedOnTears : 1;
364 }
365
366 void JustEngagedWith(Unit* who) override
367 {
368 Milliseconds introDelay = 0ms;
370 me->SetImmuneToNPC(true);
371 events.Reset();
373
374 if (!_firstPull)
375 {
379 introDelay = 8s;
380 }
381 else
382 {
383 _firstPull = false;
386 me->setActive(true);
387 me->SetFarVisible(true);
389 introDelay = 26500ms;
393 }
394
396 events.ScheduleEvent(EVENT_QUANTUM_STRIKE, 3500ms + introDelay);
397 events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500ms + introDelay);
399 events.ScheduleEvent(EVENT_BIG_BANG, 90s + introDelay);
401 events.ScheduleEvent(EVENT_COSMIC_SMASH, 25s + introDelay);
402
403 std::list<Creature*> stalkers;
405 for (std::list<Creature*>::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr)
406 (*itr)->m_Events.KillAllEvents(true);
407 }
408
409 void MovementInform(uint32 movementType, uint32 pointId) override
410 {
411 if (movementType != POINT_MOTION_TYPE)
412 return;
413
414 if (pointId == POINT_ALGALON_OUTRO)
415 {
416 me->SetFacingTo(1.605703f);
418 }
419 }
420
421 void JustSummoned(Creature* summon) override
422 {
423 summons.Summon(summon);
424 switch (summon->GetEntry())
425 {
428 summon->GetMotionMaster()->MoveRandom(20.0f);
430 break;
433 break;
436 break;
438 summon->m_Events.AddEventAtOffset(new CosmicSmashDamageEvent(summon), 3s + 250ms);
439 break;
440 case NPC_WORM_HOLE:
444 break;
446 DoZoneInCombat(summon);
447 break;
448 default:
449 break;
450 }
451 }
452
460
461 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
462 {
463 if (_fightWon)
464 {
465 damage = 0;
466 return;
467 }
468
469 if (!_phaseTwo && me->HealthBelowPctDamaged(20, damage))
470 {
471 _phaseTwo = true;
478 std::list<Creature*> stalkers;
480 for (std::list<Creature*>::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr)
481 (*itr)->m_Events.KillAllEvents(true);
482 for (uint8 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
484 wormHole->m_Events.AddEventAtOffset(new SummonUnleashedDarkMatter(wormHole), i >= 2 ? 8s : 6s);
485 }
486 else if ((int32(me->GetHealth()) - int32(damage)) < CalculatePct<int32>(int32(me->GetMaxHealth()), 2.5f) && !_fightWon)
487 {
488 _fightWon = true;
489 damage = 0;
492 me->AttackStop();
495 events.Reset();
499 }
500 }
501
502 void KilledUnit(Unit* victim) override
503 {
504 if (victim->GetTypeId() == TYPEID_PLAYER)
505 {
506 _fedOnTears = true;
507 if (!_hasYelled)
508 {
509 _hasYelled = true;
512 }
513 }
514 }
515
516 void UpdateAI(uint32 diff) override
517 {
519 return;
520
521 events.Update(diff);
522
525 return;
526
527 while (uint32 eventId = events.ExecuteEvent())
528 {
529 switch (eventId)
530 {
531 case EVENT_INTRO_1:
535 break;
538 if (Creature* azeroth = instance->GetCreature(DATA_AZEROTH))
539 if (TempSummon* summon = azeroth->ToTempSummon())
540 summon->SetTempSummonType(TEMPSUMMON_MANUAL_DESPAWN);
542 break;
543 case EVENT_INTRO_2:
544 me->SetDisableGravity(false);
548 break;
549 case EVENT_INTRO_3:
552 break;
554 events.Reset();
555 me->SetImmuneToPC(false);
557 brann->AI()->DoAction(ACTION_INTRO_2);
558 break;
563 break;
565 {
569 me->SetImmuneToNPC(false);
577 for (uint8 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i)
579 summon->SetReactState(REACT_PASSIVE);
580
581 std::list<Creature*> stalkers;
583 if (!stalkers.empty())
584 {
586 stalker->m_Events.AddEventAtOffset(new ActivateLivingConstellation(stalker), 45s, 50s);
587 }
588 break;
589 }
592 events.Repeat(3s, 5s);
593 break;
596 events.Repeat(15s + 500ms);
597 break;
601 for (uint8 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
603 events.Repeat(1min);
604 break;
605 case EVENT_BIG_BANG:
606 {
610 std::list<Creature*> constellations;
612 for (std::list<Creature*>::iterator itr = constellations.begin(); itr != constellations.end(); ++itr)
613 (*itr)->AI()->DoAction(ACTION_BIG_BANG);
615 events.Repeat(1min + 30s + 500ms);
617 break;
618 }
621 break;
625 events.ScheduleEvent(EVENT_EVADE, 2s + 500ms);
626 break;
627 case EVENT_EVADE:
629 break;
633 events.Repeat(25s + 500ms);
634 break;
636 _hasYelled = false;
637 break;
640 break;
641 case EVENT_OUTRO_1:
647 break;
648 case EVENT_OUTRO_2:
649 me->SetRegenerateHealth(false);
650 me->CombatStop();
652 break;
653 case EVENT_OUTRO_3:
657 break;
658 case EVENT_OUTRO_4:
661 break;
662 case EVENT_OUTRO_5:
664 brann->AI()->DoAction(ACTION_OUTRO);
666 break;
667 case EVENT_OUTRO_6:
671 break;
672 case EVENT_OUTRO_7:
675 break;
676 case EVENT_OUTRO_8:
679 break;
680 case EVENT_OUTRO_9:
683 break;
684 case EVENT_OUTRO_10:
687 break;
688 case EVENT_OUTRO_11:
691 me->DespawnOrUnsummon(1s + 200ms);
692 break;
695 break;
698 break;
701 break;
702 default:
703 break;
704 }
705
707 return;
708 }
709
711 }
712
713private:
719};
720
722{
723 npc_living_constellation(Creature* creature) : CreatureAI(creature), _instance(creature->GetInstanceScript())
724 {
725 Initialize();
726 }
727
729 {
730 _isActive = false;
731 }
732
733 void Reset() override
734 {
735 _events.Reset();
737 Initialize();
738 }
739
740 uint32 GetData(uint32 /*type*/) const override
741 {
742 return _isActive ? 1 : 0;
743 }
744
745 void DoAction(int32 action) override
746 {
747 switch (action)
748 {
751 {
752 if (Unit* target = algalon->AI()->SelectTarget(SelectTargetMethod::Random, 0, NonTankTargetSelector(algalon)))
753 {
756 AttackStart(target);
758 _isActive = true;
759 }
760 }
761 break;
762 case ACTION_BIG_BANG:
764 _events.DelayEvents(9s + 500ms);
766 break;
767 default:
768 break;
769 }
770 }
771
772 void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
773 {
774 Creature* creatureCaster = caster->ToCreature();
775 if (!creatureCaster)
776 return;
777
778 if (spellInfo->Id != SPELL_CONSTELLATION_PHASE_EFFECT)
779 return;
780
782 creatureCaster->CastSpell(nullptr, SPELL_BLACK_HOLE_CREDIT, TRIGGERED_FULL_MASK);
784 me->DespawnOrUnsummon(500ms);
785 }
786
787 void UpdateAI(uint32 diff) override
788 {
790 return;
791
792 _events.Update(diff);
793
794 while (uint32 eventId = _events.ExecuteEvent())
795 {
796 switch (eventId)
797 {
799 {
802 _events.Repeat(4s, 5s);
803 break;
804 }
807 break;
808 }
809 }
810 }
811
812private:
816};
817
819{
820 npc_black_hole(Creature* creature) : ScriptedAI(creature), _summons(creature) { }
821
830
831 void JustSummoned(Creature* summon) override
832 {
833 _summons.Summon(summon);
834 }
835
836 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
837 {
838 if (spellInfo->Id == SPELL_DESPAWN_BLACK_HOLE)
839 {
841 me->DespawnOrUnsummon(1ms);
842 }
843 }
844
845 void EnterEvadeMode(EvadeReason /*why*/) override { }
846
847private:
849};
850
852{
853 npc_collapsing_star(Creature* creature) : PassiveAI(creature), _dying(false), _instance(creature->GetInstanceScript()) { }
854
855 void JustSummoned(Creature* summon) override
856 {
857 if (summon->GetEntry() != NPC_BLACK_HOLE)
858 return;
859
861 algalon->AI()->JustSummoned(summon);
862
863 me->DespawnOrUnsummon(1ms);
864 }
865
866 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
867 {
868 if (_dying)
869 {
870 damage = 0;
871 return;
872 }
873
874 if (damage >= me->GetHealth())
875 {
876 _dying = true;
877 damage = 0;
880 }
881 }
882
883private:
884 bool _dying;
886};
887
889{
891
892 void DoAction(int32 action) override
893 {
894 switch (action)
895 {
897 _events.Reset();
899 break;
900 case ACTION_OUTRO:
902 _events.ScheduleEvent(EVENT_BRANN_OUTRO_1, 1min + 32s + 200ms);
904 break;
905 case ACTION_INTRO_2:
908 break;
909 default:
910 break;
911 }
912 }
913
914 void MovementInform(uint32 type, uint32 pointId) override
915 {
916 if (type != POINT_MOTION_TYPE && type != SPLINE_CHAIN_MOTION_TYPE)
917 return;
918
919 switch (pointId)
920 {
923 break;
925 me->SetFacingTo(4.714909f);
927 break;
928 case POINT_DESPAWN:
930 break;
931 default:
932 break;
933 }
934 }
935
936 void UpdateAI(uint32 diff) override
937 {
938 if (_events.Empty())
939 return;
940
941 _events.Update(diff);
942
943 while (uint32 eventId = _events.ExecuteEvent())
944 {
945 switch (eventId)
946 {
949 break;
953 break;
956 algalon->AI()->DoAction(ACTION_START_INTRO);
957 break;
960 break;
963 break;
964 default:
965 break;
966 }
967 }
968 }
969
970private:
972};
973
975{
976 go_celestial_planetarium_access(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
977
978 bool OnReportUse(Player* player) override
979 {
981 return true;
982
983 bool hasKey = true;
984 if (LockEntry const* lock = sLockStore.LookupEntry(me->GetGOInfo()->GetLockId()))
985 {
986 hasKey = false;
987 for (uint8 i = 0; i < MAX_LOCK_CASE; ++i)
988 {
989 if (!lock->Index[i])
990 continue;
991
992 if (player->HasItemCount(lock->Index[i]))
993 {
994 hasKey = true;
995 break;
996 }
997 }
998 }
999
1000 if (!hasKey)
1001 return false;
1002
1003 // Start Algalon event
1007 brann->AI()->DoAction(ACTION_START_INTRO);
1008
1011 sigil->SetGoState(GO_STATE_ACTIVE);
1012
1014 sigil->SetGoState(GO_STATE_ACTIVE);
1015
1016 return false;
1017 }
1018
1019 void UpdateAI(uint32 diff) override
1020 {
1021 if (_events.Empty())
1022 return;
1023
1024 _events.Update(diff);
1025
1026 while (uint32 eventId = _events.ExecuteEvent())
1027 {
1028 switch (eventId)
1029 {
1031 me->Delete();
1032 break;
1033 default:
1034 break;
1035 }
1036 }
1037 }
1038
1039private:
1042};
1043
1044// 64412 - Phase Punch
1071
1072// 65508 - Constellation Phase Trigger
1074{
1076
1077 bool Validate(SpellInfo const* spellInfo) override
1078 {
1079 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
1080 }
1081
1082 void HandlePeriodic(AuraEffect const* aurEff)
1083 {
1085 CastSpellExtraArgs args(aurEff);
1087 // Phase Effect should only 1 target. Avoid 1 black hole despawn multiple Living Constellation
1088 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, args);
1089 }
1090
1095};
1096
1097// 62266 - Trigger 3 Adds
1099{
1101
1102 void SelectTarget(std::list<WorldObject*>& targets)
1103 {
1104 // Remove Living Constellation already actived
1105 targets.remove_if([](WorldObject* target) -> bool
1106 {
1107 return target->ToUnit() && target->ToUnit()->GetAI() && target->ToUnit()->GetAI()->GetData(0);
1108 });
1109 }
1110
1112 {
1113 PreventHitDefaultEffect(effIndex);
1114 if (Creature* target = GetHitCreature())
1115 target->AI()->DoAction(ACTION_ACTIVATE_STAR);
1116 }
1117
1123};
1124
1125// 62018 - Collapse
1141
1142// 64443, 64584 - Big Bang
1144{
1146
1147 bool Load() override
1148 {
1149 _targetCount = 0;
1150 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1151 }
1152
1153 void CountTargets(std::list<WorldObject*>& targets)
1154 {
1155 _targetCount = targets.size();
1156 }
1157
1159 {
1160 if (!_targetCount)
1162 }
1163
1169private:
1171};
1172
1173// 64445 - Remove Player from Phase
1189
1190// 62295 - Cosmic Smash
1192{
1194
1196 {
1197 // Meteor should spawn below the platform
1198 Position const offset = { 0.0f, 0.0f, -36.1325f, 0.0f };
1199 dest.RelocateOffset(offset);
1200 }
1201
1206};
1207
1208// 62311, 64596 - Cosmic Smash
1210{
1212
1214 {
1215 if (!GetExplTargetDest() || !GetHitUnit())
1216 return;
1217
1218 float distance = GetHitUnit()->GetDistance2d(GetExplTargetDest()->GetPositionX(), GetExplTargetDest()->GetPositionY());
1219 if (distance > 6.0f)
1220 SetHitDamage(int32(float(GetHitDamage()) / distance) * 2);
1221 }
1222
1227};
1228
1229// 65311 - Supermassive Fail
1231{
1233
1235 {
1236 if (Player* player = GetHitPlayer())
1237 player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT, GetSpellInfo()->Id, true);
1238 }
1239
1244};
1245
1246// 62168 - Black Hole (Phase Shifts)
1247// 65250 - Worm Hole (Phase Shifts)
1248// 64417 - Phase Punch (Phase Shifts)
1273
1275{
1276 public:
1277 achievement_he_feeds_on_your_tears() : AchievementCriteriaScript("achievement_he_feeds_on_your_tears") { }
1278
1279 bool OnCheck(Player* /*source*/, Unit* target) override
1280 {
1281 return !target->GetAI()->GetData(DATA_HAS_FED_ON_TEARS);
1282 }
1283};
1284
Actions
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:122
@ ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT
Definition DBCEnums.h:103
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
#define MAX_LOCK_CASE
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint64_t uint64
Definition Define.h:132
uint32_t uint32
Definition Define.h:133
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
@ IN_PROGRESS
@ FAIL
@ DONE
@ MOTION_PRIORITY_NORMAL
@ SPLINE_CHAIN_MOTION_TYPE
@ POINT_MOTION_TYPE
@ TEMPSUMMON_DEAD_DESPAWN
@ TEMPSUMMON_MANUAL_DESPAWN
@ TEMPSUMMON_CORPSE_DESPAWN
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
Spells
Definition PlayerAI.cpp:32
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:62
#define RegisterGameObjectAI(ai_name)
Definition ScriptMgr.h:1157
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ TARGET_DEST_CASTER_SUMMON
@ GO_FLAG_IN_USE
@ FACTION_FRIENDLY
@ GO_STATE_ACTIVE
@ AURA_REMOVE_BY_DEFAULT
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PHASE
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLVALUE_MAX_TARGETS
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define SpellCastFn(F)
#define SpellDestinationTargetSelectFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ UNIT_FLAG2_DO_NOT_FADE_IN
@ REACT_DEFENSIVE
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STAND_STATE_KNEEL
Definition UnitDefines.h:42
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:34
@ SHEATH_STATE_UNARMED
Definition UnitDefines.h:98
@ SHEATH_STATE_MELEE
Definition UnitDefines.h:99
@ UNIT_FLAG_RENAME
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
@ NODAMAGE
Definition Unit.h:357
Position const AlgalonLandPos
Position const AlgalonOutroPos
Position const CollapsingStarPos[COLLAPSING_STAR_COUNT]
void AddSC_boss_algalon_the_observer()
Position const BrannOutroPos
@ SPELL_CONSTELLATION_PHASE_EFFECT
@ SPELL_SUMMON_UNLEASHED_DARK_MATTER
@ SPELL_COSMIC_SMASH_TRIGGERED
@ SPELL_ASCEND_TO_THE_HEAVENS
@ SPELL_CONSTELLATION_PHASE_TRIGGER
@ SPELL_SUMMON_VOID_ZONE_VISUAL
@ SPELL_BLACK_HOLE_SPAWN_VISUAL
@ SPELL_COSMIC_SMASH_VISUAL_STATE
uint32 const PhasePunchAlphaId[5]
#define LIVING_CONSTELLATION_COUNT
@ EVENT_ID_SUPERMASSIVE_START
#define COLLAPSING_STAR_COUNT
Position const ConstellationPos[LIVING_CONSTELLATION_COUNT]
@ SAY_BRANN_ALGALON_INTRO_1
@ EMOTE_ALGALON_COSMIC_SMASH
@ SAY_ALGALON_COLLAPSING_STAR
@ EMOTE_ALGALON_COLLAPSING_STAR
@ SAY_BRANN_ALGALON_INTRO_2
Position const AlgalonSummonPos
Position const BrannIntroSpawnPos
@ EVENT_ASCEND_TO_THE_HEAVENS
@ EVENT_SUMMON_COLLAPSING_STAR
bool Execute(uint64 execTime, uint32) override
SpellEffectInfo const & GetSpellEffectInfo() const
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Unit * GetUnitOwner() const
uint8 GetStackAmount() const
HookList< EffectApplyHandler > OnEffectApply
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
bool Execute(uint64, uint32) override
@ EVADE_REASON_OTHER
Definition CreatureAI.h:98
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
Creature * DoSummon(uint32 entry, Position const &pos, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:293
void SetImmuneToPC(bool apply) override
Definition Creature.h:129
void SetReactState(ReactStates st)
Definition Creature.h:119
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetRegenerateHealth(bool value)
Definition Creature.h:285
void SetImmuneToNPC(bool apply) override
Definition Creature.h:132
void Update(uint32 time)
Definition EventMap.h:67
bool Empty() const
Definition EventMap.h:95
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
void DelayEvents(Milliseconds delay)
Definition EventMap.cpp:95
EventId ExecuteEvent()
Definition EventMap.cpp:73
bool IsInPhase(PhaseIndex phase) const
Definition EventMap.h:236
void CancelEvent(EventId eventId)
Definition EventMap.cpp:151
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:28
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
GameObject *const me
GameObjectTemplate const * GetGOInfo() const
Definition GameObject.h:102
bool HasFlag(GameObjectFlags flags) const
Definition GameObject.h:170
void Delete()
void SetFlag(GameObjectFlags flags)
Definition GameObject.h:171
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
EncounterState GetBossState(uint32 id) const
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
GameObject * GetGameObject(uint32 type)
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1852
void LaunchMoveSpline(std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk)
void MoveRandom(float wanderDistance=0.0f)
static Creature * ToCreature(Object *o)
Definition Object.h:186
static Unit * ToUnit(Object *o)
Definition Object.h:192
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetEntry() const
Definition Object.h:81
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition Player.cpp:9763
uint32 TriggerSpell
Definition SpellInfo.h:228
uint32 Id
Definition SpellInfo.h:289
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
HookList< CastHandler > AfterCast
Creature * GetHitCreature() const
Player * GetHitPlayer() const
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
HookList< HitHandler > OnHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
void SetHitDamage(int32 damage)
WorldLocation const * GetExplTargetDest() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void DespawnEntry(uint32 entry)
void Summon(Creature const *summon)
bool Execute(uint64 execTime, uint32) override
Unit * GetCurrentVictim()
bool IsThreatListEmpty(bool includeOffline=false) const
virtual void DoAction(int32)
Definition UnitAI.h:154
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
virtual uint32 GetData(uint32) const
Definition UnitAI.h:155
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:30
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true)
Definition Unit.cpp:716
void ClearUnitState(uint32 f)
Definition Unit.h:877
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3765
ThreatManager & GetThreatManager()
Definition Unit.h:1155
void SetFaction(uint32 faction) override
Definition Unit.h:974
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3093
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
uint32 GetMaxHealth() const
Definition Unit.h:914
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:960
TempSummon * ToTempSummon()
Definition Unit.h:1794
UnitAI * GetAI() const
Definition Unit.h:800
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13286
virtual void SetSheath(SheathState sheathed)
Definition Unit.h:970
uint32 GetHealth() const
Definition Unit.h:913
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void SetFacingTo(float ori, bool force=true, uint32 movementId=EVENT_FACE)
Definition Unit.cpp:13250
void SetStandState(UnitStandStateType state)
Definition Unit.cpp:10363
void RemoveAllAuras()
Definition Unit.cpp:4157
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:5691
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:954
bool AttackStop()
Definition Unit.cpp:5645
bool IsInCombat() const
Definition Unit.h:1144
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
Map * GetMap() const
Definition Object.h:449
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
Definition Object.cpp:3153
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1992
void setActive(bool isActiveObject)
Definition Object.cpp:991
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:1141
void SetFarVisible(bool on)
Definition Object.cpp:1014
void PlayDirectMusic(uint32 musicId, Player *target=nullptr)
Definition Object.cpp:3441
EventProcessor m_Events
Definition Object.h:591
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnCheck(Player *, Unit *target) override
PrepareSpellScript(spell_algalon_big_bang)
void CountTargets(std::list< WorldObject * > &targets)
PrepareAuraScript(spell_algalon_black_hole_phase_shifts)
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_algalon_collapse)
void HandlePeriodic(AuraEffect const *)
PrepareSpellScript(spell_algalon_cosmic_smash_damage)
PrepareSpellScript(spell_algalon_cosmic_smash)
void ModDestHeight(SpellDestination &dest)
PrepareAuraScript(spell_algalon_phase_constellation)
bool Validate(SpellInfo const *spellInfo) override
void HandlePeriodic(AuraEffect const *aurEff)
void HandlePeriodic(AuraEffect const *)
PrepareAuraScript(spell_algalon_phase_punch)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_algalon_remove_phase)
PrepareSpellScript(spell_algalon_supermassive_fail)
void HandleDummy(SpellEffIndex effIndex)
void SelectTarget(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_algalon_trigger_3_adds)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
uint32 GetLockId() const
float GetPositionZ() const
Definition Position.h:81
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
void AttackStart(Unit *) override
void ResetThreatList(Unit *who=nullptr)
void RelocateOffset(Position const &offset)
Definition Spell.cpp:110
void UpdateAI(uint32 diff) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustSummoned(Creature *summon) override
void EnterEvadeMode(EvadeReason why) override
void KilledUnit(Unit *victim) override
void DoAction(int32 action) override
void MovementInform(uint32 movementType, uint32 pointId) override
void JustEngagedWith(Unit *who) override
uint32 GetData(uint32 type) const override
bool OnReportUse(Player *player) override
npc_black_hole(Creature *creature)
void EnterEvadeMode(EvadeReason) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void JustSummoned(Creature *summon) override
void MovementInform(uint32 type, uint32 pointId) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustSummoned(Creature *summon) override
npc_collapsing_star(Creature *creature)
void SpellHit(WorldObject *caster, SpellInfo const *spellInfo) override
void UpdateAI(uint32 diff) override
void DoAction(int32 action) override
uint32 GetData(uint32) const override
@ EVENT_DESPAWN_ALGALON
Definition ulduar.h:507
@ ACTION_INIT_ALGALON
Definition ulduar.h:509
@ DATA_ALGALON
Definition ulduar.h:49
@ DATA_SIGILDOOR_02
Definition ulduar.h:453
@ DATA_SIGILDOOR_01
Definition ulduar.h:452
@ DATA_AZEROTH
Definition ulduar.h:461
@ DATA_BRANN_BRONZEBEARD_ALG
Definition ulduar.h:459
@ DATA_ALGALON_SUMMON_STATE
Definition ulduar.h:451
#define RegisterUlduarCreatureAI(ai_name)
Definition ulduar.h:541
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_01
Definition ulduar.h:238
@ NPC_BLACK_HOLE
Definition ulduar.h:235
@ NPC_COLLAPSING_STAR
Definition ulduar.h:234
@ NPC_UNLEASHED_DARK_MATTER
Definition ulduar.h:240
@ NPC_WORM_HOLE
Definition ulduar.h:236
@ NPC_LIVING_CONSTELLATION
Definition ulduar.h:232
@ NPC_ALGALON_STALKER
Definition ulduar.h:233
@ NPC_ALGALON
Definition ulduar.h:83
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_02
Definition ulduar.h:239
@ NPC_AZEROTH
Definition ulduar.h:231
@ NPC_ALGALON_VOID_ZONE_VISUAL_STALKER
Definition ulduar.h:237
@ NPC_BRANN_BRONZBEARD_ALG
Definition ulduar.h:230