TrinityCore
boss_flame_leviathan.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/*
19 * Comment: there is missing code on triggers,
20 * brann bronzebeard needs correct gossip info.
21 * requires more work involving area triggers.
22 * if reached brann speaks through his radio..
23 */
24
25#include "ScriptMgr.h"
26#include "GameObjectAI.h"
27#include "CellImpl.h"
28#include "CombatAI.h"
29#include "Containers.h"
30#include "GameObject.h"
31#include "GridNotifiersImpl.h"
32#include "InstanceScript.h"
33#include "MotionMaster.h"
34#include "ObjectAccessor.h"
35#include "PassiveAI.h"
36#include "Player.h"
37#include "ScriptedEscortAI.h"
38#include "ScriptedGossip.h"
39#include "Spell.h"
40#include "SpellAuraEffects.h"
41#include "SpellInfo.h"
42#include "SpellScript.h"
43#include "ulduar.h"
44#include "Vehicle.h"
45
47{
57 SPELL_BLAZE = 62292,
61 SPELL_NAPALM = 63666,
63 //TOWER Additional SPELLS
64 SPELL_THORIM_S_HAMMER = 62911, // Tower of Storms
65 SPELL_MIMIRON_S_INFERNO = 62909, // Tower of Flames
66 SPELL_HODIR_S_FURY = 62533, // Tower of Frost
67 SPELL_FREYA_S_WARD = 62906, // Tower of Nature
68 SPELL_FREYA_SUMMONS = 62947, // Tower of Nature
69 //TOWER ap & health spells
74 //Additional Spells
75 SPELL_LASH = 65062,
87};
88
90{
91 NPC_SEAT = 33114,
93 NPC_LIQUID = 33189,
103 NPC_ULDUAR_GAUNTLET_GENERATOR = 33571, // Trigger tied to towers
104};
105
107{
112};
113
115{
123 EVENT_THORIM_S_HAMMER = 8, // Tower of Storms
124 EVENT_MIMIRON_S_INFERNO = 9, // Tower of Flames
125 EVENT_HODIR_S_FURY = 10, // Tower of Frost
126 EVENT_FREYA_S_WARD = 11, // Tower of Nature
127};
128
130{
135};
136
138{
142};
143
145{
146 DATA_SHUTOUT = 29112912, // 2911, 2912 are achievement IDs
148 FREYA_SPAWNS = 4
149
151
153{
168 EMOTE_REPAIR = 14
170
172{
173 // Other Actions are in Ulduar.h
176 // Amount of seats depending on Raid mode
179};
180
181Position const Center = { 354.8771f, -12.90240f, 409.803650f, 0.0f };
182Position const InfernoStart = { 390.93f, -13.91f, 409.81f, 0.0f };
183
185{
186 {-814.59f, -64.54f, 429.92f, 5.969f},
187 {-784.37f, -33.31f, 429.92f, 5.096f},
188 {-808.99f, -52.10f, 429.92f, 5.668f},
189 {-798.59f, -44.00f, 429.92f, 5.663f},
190 {-812.83f, -77.71f, 429.92f, 0.046f},
191};
192
194{
195 {-717.83f, -106.56f, 430.02f, 0.122f},
196 {-717.83f, -114.23f, 430.44f, 0.122f},
197 {-717.83f, -109.70f, 430.22f, 0.122f},
198 {-718.45f, -118.24f, 430.26f, 0.052f},
199 {-718.45f, -123.58f, 430.41f, 0.085f},
200};
201
203{
204 {-724.12f, -176.64f, 430.03f, 2.543f},
205 {-766.70f, -225.03f, 430.50f, 1.710f},
206 {-729.54f, -186.26f, 430.12f, 1.902f},
207 {-756.01f, -219.23f, 430.50f, 2.369f},
208 {-798.01f, -227.24f, 429.84f, 1.446f},
209};
210
212{
213 {377.02f, -119.10f, 409.81f, 0.0f},
214 {185.62f, -119.10f, 409.81f, 0.0f},
215 {377.02f, 54.78f, 409.81f, 0.0f},
216 {185.62f, 54.78f, 409.81f, 0.0f},
217};
218
220{
221 public:
222 boss_flame_leviathan() : CreatureScript("boss_flame_leviathan") { }
223
225 {
227 {
228 Initialize();
229 me->SetCanMelee(false); // DoSpellAttackIfReady
230 }
231
233 {
235 Shutdown = 0;
236 ActiveTowers = false;
237 towerOfStorms = false;
238 towerOfLife = false;
239 towerOfFlames = false;
240 towerOfFrost = false;
241 Shutout = true;
242 Unbroken = true;
243 }
244
245 void InitializeAI() override
246 {
247 if (!me->isDead())
248 Reset();
249
250 Initialize();
251
253
255 me->SetUninteractible(true);
257 }
258
268
269 void Reset() override
270 {
271 _Reset();
272 //resets shutdown counter to 0. 2 or 4 depending on raid mode
273 Shutdown = 0;
275
277 }
278
279 void JustEngagedWith(Unit* who) override
280 {
289 ActiveTower(); //void ActiveTower
290 }
291
293 {
294 if (ActiveTowers)
295 {
296 if (towerOfStorms)
297 {
300 }
301
302 if (towerOfFlames)
303 {
306 }
307
308 if (towerOfFrost)
309 {
312 }
313
314 if (towerOfLife)
315 {
318 }
319
322 else
324 }
325 else
327 }
328
329 void JustDied(Unit* /*killer*/) override
330 {
331 _JustDied();
333 }
334
335 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
336 {
337 if (spellInfo->Id == SPELL_START_THE_ENGINE)
338 if (Vehicle* vehicleKit = me->GetVehicleKit())
339 vehicleKit->InstallAllAccessories(false);
340
341 if (spellInfo->Id == SPELL_ELECTROSHOCK)
343
344 if (spellInfo->Id == SPELL_OVERLOAD_CIRCUIT)
345 ++Shutdown;
346 }
347
348 uint32 GetData(uint32 type) const override
349 {
350 switch (type)
351 {
352 case DATA_SHUTOUT:
353 return Shutout ? 1 : 0;
354 case DATA_UNBROKEN:
355 return Unbroken ? 1 : 0;
356 default:
357 break;
358 }
359
360 return 0;
361 }
362
363 void SetData(uint32 id, uint32 data) override
364 {
365 if (id == DATA_UNBROKEN)
366 Unbroken = data ? true : false;
367 }
368
369 void UpdateAI(uint32 diff) override
370 {
371 if (!me->IsEngaged())
372 return;
373
374 if (!me->IsInCombat())
375 {
377 return;
378 }
379
380 events.Update(diff);
381
383 {
384 Shutdown = 0;
388 return;
389 }
390
392 return;
393
394 while (uint32 eventId = events.ExecuteEvent())
395 {
396 switch (eventId)
397 {
398 case EVENT_PURSUE:
400 DoCast(SPELL_PURSUED); // Will select target in spellscript
402 break;
403 case EVENT_MISSILE:
406 break;
407 case EVENT_VENT:
410 break;
411 case EVENT_SPEED:
414 break;
415 case EVENT_SUMMON:
416 if (summons.size() < 15)
417 if (Creature* lift = DoSummonFlyer(NPC_MECHANOLIFT, me, 30.0f, 50.0f, 0s))
418 lift->GetMotionMaster()->MoveRandom(100);
420 break;
421 case EVENT_SHUTDOWN:
425 if (Shutout)
426 Shutout = false;
428 events.DelayEvents(20s, 0);
429 break;
430 case EVENT_REPAIR:
435 break;
436 case EVENT_THORIM_S_HAMMER: // Tower of Storms
437 for (uint8 i = 0; i < 7; ++i)
438 {
439 if (Creature* thorim = DoSummon(NPC_THORIM_BEACON, me, float(urand(20, 60)), 20s, TEMPSUMMON_TIMED_DESPAWN))
440 thorim->GetMotionMaster()->MoveRandom(100);
441 }
444 break;
445 case EVENT_MIMIRON_S_INFERNO: // Tower of Flames
449 break;
450 case EVENT_HODIR_S_FURY: // Tower of Frost
451 for (uint8 i = 0; i < 7; ++i)
452 {
453 if (Creature* hodir = DoSummon(NPC_HODIR_BEACON, me, 50, 0s))
454 hodir->GetMotionMaster()->MoveRandom(100);
455 }
458 break;
459 case EVENT_FREYA_S_WARD: // Tower of Nature
461 for (int32 i = 0; i < 4; ++i)
463
465 DoCast(target, SPELL_FREYA_S_WARD);
467 break;
468 }
469
471 return;
472 }
473
475 }
476
477 void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
478 {
479 Unit* unitTarget = target->ToUnit();
480 if (!unitTarget)
481 return;
482
483 if (spellInfo->Id != SPELL_PURSUED)
484 return;
485
486 _pursueTarget = unitTarget->GetGUID();
487 AttackStart(unitTarget);
488
489 for (SeatMap::const_iterator itr = unitTarget->GetVehicleKit()->Seats.begin(); itr != unitTarget->GetVehicleKit()->Seats.end(); ++itr)
490 {
491 if (Player* passenger = ObjectAccessor::GetPlayer(*me, itr->second.Passenger.Guid))
492 {
493 Talk(EMOTE_PURSUE, passenger);
494 return;
495 }
496 }
497 }
498
499 void DoAction(int32 action) override
500 {
501 if (action && action <= 4) // Tower destruction, debuff leviathan loot and reduce active tower count
502 {
505
508
511
514 }
515
516 switch (action)
517 {
519 if (towerOfStorms)
520 {
521 towerOfStorms = false;
524 }
525 break;
527 if (towerOfFrost)
528 {
529 towerOfFrost = false;
532 }
533 break;
535 if (towerOfFlames)
536 {
537 towerOfFlames = false;
540 }
541 break;
543 if (towerOfLife)
544 {
545 towerOfLife = false;
548 }
549 break;
550 case ACTION_START_HARD_MODE: // Activate hard-mode enable all towers, apply buffs on leviathan
552 ActiveTowers = true;
553 towerOfStorms = true;
554 towerOfLife = true;
555 towerOfFlames = true;
556 towerOfFrost = true;
558 break;
559 case ACTION_MOVE_TO_CENTER_POSITION: // Triggered by 2 Collossus near door
561 {
564 }
565 break;
566 default:
567 break;
568 }
569 }
570
571 void MovementInform(uint32 /*type*/, uint32 id) override
572 {
574 return;
577 me->SetUninteractible(false);
578 }
579
580 private:
584 {
585 if (me->isAttackReady())
586 {
588
589 if (!target)
590 {
592 return;
593 }
594
595 if (me->IsWithinCombatRange(target, 30.0f))
596 {
599 }
600 }
601 }
602
604 };
605
606 CreatureAI* GetAI(Creature* creature) const override
607 {
608 return GetUlduarAI<boss_flame_leviathanAI>(creature);
609 }
610};
611
613{
614 public:
615 boss_flame_leviathan_seat() : CreatureScript("boss_flame_leviathan_seat") { }
616
618 {
620 {
623 instance = creature->GetInstanceScript();
624 }
625
627
628 void PassengerBoarded(Unit* who, int8 seatId, bool apply) override
629 {
630 if (!me->GetVehicle())
631 return;
632
633 if (seatId == SEAT_PLAYER)
634 {
635 if (!apply)
636 return;
637 else if (Creature* leviathan = me->GetVehicleCreatureBase())
638 leviathan->AI()->Talk(SAY_PLAYER_RIDING);
639
640 if (Unit* turretPassenger = me->GetVehicleKit()->GetPassenger(SEAT_TURRET))
641 if (Creature* turret = turretPassenger->ToCreature())
642 {
643 turret->SetFaction(me->GetVehicleBase()->GetFaction());
644 turret->ReplaceAllUnitFlags(UnitFlags(0)); // unselectable
645 turret->AI()->AttackStart(who);
646 }
647 if (Unit* devicePassenger = me->GetVehicleKit()->GetPassenger(SEAT_DEVICE))
648 if (Creature* device = devicePassenger->ToCreature())
649 {
650 device->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
651 device->SetUninteractible(false);
652 }
653
654 me->SetUninteractible(true);
655 }
656 else if (seatId == SEAT_TURRET)
657 {
658 if (apply)
659 return;
660
661 if (Unit* device = ASSERT_NOTNULL(me->GetVehicleKit())->GetPassenger(SEAT_DEVICE))
662 {
663 device->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
664 device->ReplaceAllUnitFlags(UnitFlags(0)); // unselectable
665 }
666 }
667 }
668 };
669
670 CreatureAI* GetAI(Creature* creature) const override
671 {
672 return GetUlduarAI<boss_flame_leviathan_seatAI>(creature);
673 }
674};
675
677{
678 public:
679 boss_flame_leviathan_defense_cannon() : CreatureScript("boss_flame_leviathan_defense_cannon") { }
680
682 {
684 {
685 Initialize();
686 }
687
689 {
691 }
692
694
695 void Reset() override
696 {
697 Initialize();
699 }
700
701 void UpdateAI(uint32 diff) override
702 {
703 if (!UpdateVictim())
704 return;
705
706 if (NapalmTimer <= diff)
707 {
709 if (CanAIAttack(target))
710 DoCast(target, SPELL_NAPALM, true);
711
712 NapalmTimer = 5000;
713 }
714 else
715 NapalmTimer -= diff;
716 }
717
718 bool CanAIAttack(Unit const* who) const override
719 {
720 if (who->GetTypeId() != TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() == NPC_SEAT)
721 return false;
722 return true;
723 }
724 };
725
726 CreatureAI* GetAI(Creature* creature) const override
727 {
728 return GetUlduarAI<boss_flame_leviathan_defense_cannonAI>(creature);
729 }
730};
731
733{
734 public:
735 boss_flame_leviathan_defense_turret() : CreatureScript("boss_flame_leviathan_defense_turret") { }
736
738 {
740
741 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
742 {
743 if (!CanAIAttack(who))
744 damage = 0;
745 }
746
747 bool CanAIAttack(Unit const* who) const override
748 {
749 if (!who || who->GetTypeId() != TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() != NPC_SEAT)
750 return false;
751 return true;
752 }
753 };
754
755 CreatureAI* GetAI(Creature* creature) const override
756 {
757 return GetUlduarAI<boss_flame_leviathan_defense_turretAI>(creature);
758 }
759};
760
762{
763 public:
764 boss_flame_leviathan_overload_device() : CreatureScript("boss_flame_leviathan_overload_device") { }
765
767 {
769 {
770 }
771
772 void OnSpellClick(Unit* /*clicker*/, bool spellClickHandled) override
773 {
774 if (!spellClickHandled)
775 return;
776
777 if (me->GetVehicle())
778 {
780 me->SetUninteractible(true);
781
782 if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
783 {
784 me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
785 player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPosition(), 30, 30);
786 player->ExitVehicle();
787 }
788 }
789 }
790 };
791
792 CreatureAI* GetAI(Creature* creature) const override
793 {
794 return GetUlduarAI<boss_flame_leviathan_overload_deviceAI>(creature);
795 }
796};
797
799{
800 public:
801 boss_flame_leviathan_safety_container() : CreatureScript("boss_flame_leviathan_safety_container") { }
802
804 {
806 {
807 }
808
809 void JustDied(Unit* /*killer*/) override
810 {
811 float x, y, z;
812 me->GetPosition(x, y, z);
813 z = me->GetMap()->GetHeight(me->GetPhaseShift(), x, y, z);
814 me->GetMotionMaster()->MovePoint(0, x, y, z);
815 me->UpdatePosition(x, y, z, 0);
816 }
817
818 void UpdateAI(uint32 /*diff*/) override
819 {
820 }
821 };
822
823 CreatureAI* GetAI(Creature* creature) const override
824 {
825 return GetUlduarAI<boss_flame_leviathan_safety_containerAI>(creature);
826 }
827};
828
830{
831 public:
832 npc_mechanolift() : CreatureScript("npc_mechanolift") { }
833
835 {
836 npc_mechanoliftAI(Creature* creature) : PassiveAI(creature)
837 {
838 Initialize();
840 }
841
843 {
844 MoveTimer = 0;
845 }
846
848
849 void Reset() override
850 {
851 Initialize();
853 }
854
855 void JustDied(Unit* /*killer*/) override
856 {
859 Creature* liquid = DoSummon(NPC_LIQUID, me, 0);
860 if (liquid)
861 {
862 liquid->CastSpell(liquid, SPELL_LIQUID_PYRITE, true);
863 liquid->CastSpell(liquid, SPELL_DUST_CLOUD_IMPACT, true);
864 }
865 }
866
867 void MovementInform(uint32 type, uint32 id) override
868 {
869 if (type == POINT_MOTION_TYPE && id == 1)
870 if (Creature* container = me->FindNearestCreature(NPC_CONTAINER, 5, true))
871 container->EnterVehicle(me);
872 }
873
874 void UpdateAI(uint32 diff) override
875 {
876 if (MoveTimer <= diff)
877 {
878 if (me->GetVehicleKit()->HasEmptySeat(-1))
879 {
880 Creature* container = me->FindNearestCreature(NPC_CONTAINER, 50, true);
881 if (container && !container->GetVehicle())
882 me->GetMotionMaster()->MovePoint(1, container->GetPositionX(), container->GetPositionY(), container->GetPositionZ());
883 }
884
885 MoveTimer = 30000; //check next 30 seconds
886 }
887 else
888 MoveTimer -= diff;
889 }
890 };
891
892 CreatureAI* GetAI(Creature* creature) const override
893 {
894 return GetUlduarAI<npc_mechanoliftAI>(creature);
895 }
896};
897
899{
900 public:
901 npc_pool_of_tar() : CreatureScript("npc_pool_of_tar") { }
902
904 {
905 npc_pool_of_tarAI(Creature* creature) : ScriptedAI(creature)
906 {
907 me->SetUninteractible(false);
910 }
911
912 void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
913 {
914 damage = 0;
915 }
916
917 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
918 {
920 me->CastSpell(me, SPELL_BLAZE, true);
921 }
922
923 void UpdateAI(uint32 /*diff*/) override { }
924 };
925
926 CreatureAI* GetAI(Creature* creature) const override
927 {
928 return GetUlduarAI<npc_pool_of_tarAI>(creature);
929 }
930};
931
933{
934 public:
935 npc_colossus() : CreatureScript("npc_colossus") { }
936
938 {
939 npc_colossusAI(Creature* creature) : ScriptedAI(creature)
940 {
941 instance = creature->GetInstanceScript();
942 }
943
945
946 void JustDied(Unit* /*killer*/) override
947 {
948 if (me->GetHomePosition().IsInDist(&Center, 50.f))
950 }
951 };
952
953 CreatureAI* GetAI(Creature* creature) const override
954 {
955 return GetUlduarAI<npc_colossusAI>(creature);
956 }
957};
958
960{
961 public:
962 npc_thorims_hammer() : CreatureScript("npc_thorims_hammer") { }
963
965 {
967 {
968 me->SetUninteractible(true);
970 }
971
972 void MoveInLineOfSight(Unit* who) override
973
974 {
975 if (who->GetTypeId() == TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who, 0, 10, false))
976 {
978 trigger->CastSpell(who, SPELL_THORIM_S_HAMMER, true);
979 }
980 }
981
982 void UpdateAI(uint32 /*diff*/) override
983 {
986
987 UpdateVictim();
988 }
989 };
990
991 CreatureAI* GetAI(Creature* creature) const override
992 {
993 return GetUlduarAI<npc_thorims_hammerAI>(creature);
994 }
995};
996
997static constexpr uint32 PATH_ESCORT_MIMIRONS_INFERNO = 266962;
998
1000{
1001public:
1002 npc_mimirons_inferno() : CreatureScript("npc_mimirons_inferno") { }
1003
1005 {
1007 {
1008 Initialize();
1010 me->SetUninteractible(true);
1013 }
1014
1016 {
1017 infernoTimer = 2000;
1018 }
1019
1020 void Reset() override
1021 {
1022 Initialize();
1023 }
1024
1026
1027 void UpdateAI(uint32 diff) override
1028 {
1029 EscortAI::UpdateAI(diff);
1030
1032 {
1034 Start(false, ObjectGuid::Empty, nullptr, false, true);
1035 }
1036 else
1037 {
1038 if (infernoTimer <= diff)
1039 {
1041 {
1042 trigger->CastSpell(me->GetPosition(), SPELL_MIMIRON_S_INFERNO, true);
1043 infernoTimer = 2000;
1044 }
1045 }
1046 else
1047 infernoTimer -= diff;
1048
1051 }
1052 }
1053 };
1054
1055 CreatureAI* GetAI(Creature* creature) const override
1056 {
1057 return GetUlduarAI<npc_mimirons_infernoAI>(creature);
1058 }
1059};
1060
1062{
1063 public:
1064 npc_hodirs_fury() : CreatureScript("npc_hodirs_fury") { }
1065
1067 {
1069 {
1070 me->SetUninteractible(true);
1072 }
1073
1074 void MoveInLineOfSight(Unit* who) override
1075
1076 {
1077 if (who->GetTypeId() == TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who, 0, 5, false))
1078 {
1080 trigger->CastSpell(who, SPELL_HODIR_S_FURY, true);
1081 }
1082 }
1083
1084 void UpdateAI(uint32 /*diff*/) override
1085 {
1088
1089 UpdateVictim();
1090 }
1091 };
1092
1093 CreatureAI* GetAI(Creature* creature) const override
1094 {
1095 return GetUlduarAI<npc_hodirs_furyAI>(creature);
1096 }
1097};
1098
1100{
1101 public:
1102 npc_freyas_ward() : CreatureScript("npc_freyas_ward") { }
1103
1105 {
1107 {
1108 Initialize();
1110 }
1111
1113 {
1114 summonTimer = 5000;
1115 }
1116
1118
1119 void Reset() override
1120 {
1121 Initialize();
1122 }
1123
1124 void UpdateAI(uint32 diff) override
1125 {
1126 if (summonTimer <= diff)
1127 {
1130 summonTimer = 20000;
1131 }
1132 else
1133 summonTimer -= diff;
1134
1137
1138 UpdateVictim();
1139 }
1140 };
1141
1142 CreatureAI* GetAI(Creature* creature) const override
1143 {
1144 return GetUlduarAI<npc_freyas_wardAI>(creature);
1145 }
1146};
1147
1149{
1150 public:
1151 npc_freya_ward_summon() : CreatureScript("npc_freya_ward_summon") { }
1152
1154 {
1156 {
1157 Initialize();
1158 creature->GetMotionMaster()->MoveRandom(100);
1159 }
1160
1162 {
1163 lashTimer = 5000;
1164 }
1165
1167
1168 void Reset() override
1169 {
1170 Initialize();
1171 }
1172
1173 void UpdateAI(uint32 diff) override
1174 {
1175 if (!UpdateVictim())
1176 return;
1177
1178 if (lashTimer <= diff)
1179 {
1181 lashTimer = 20000;
1182 }
1183 else
1184 lashTimer -= diff;
1185 }
1186 };
1187
1188 CreatureAI* GetAI(Creature* creature) const override
1189 {
1190 return GetUlduarAI<npc_freya_ward_summonAI>(creature);
1191 }
1192};
1193
1195{
1199
1201{
1202 public:
1203 npc_brann_bronzebeard_ulduar_intro() : CreatureScript("npc_brann_bronzebeard_ulduar_intro") { }
1204
1206 {
1208 {
1209 _instance = creature->GetInstanceScript();
1210 }
1211
1212 bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
1213 {
1214 if (menuId == GOSSIP_MENU_BRANN_BRONZEBEARD && gossipListId == GOSSIP_OPTION_BRANN_BRONZEBEARD)
1215 {
1217 CloseGossipMenuFor(player);
1219 loreKeeper->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1220 }
1221 return false;
1222 }
1223
1224 private:
1226 };
1227
1228 CreatureAI* GetAI(Creature* creature) const override
1229 {
1230 return GetUlduarAI<npc_brann_bronzebeard_ulduar_introAI>(creature);
1231 }
1232};
1233
1235{
1239
1241{
1242 public:
1243 npc_lorekeeper() : CreatureScript("npc_lorekeeper") { }
1244
1246 {
1247 npc_lorekeeperAI(Creature* creature) : ScriptedAI(creature)
1248 {
1249 _instance = creature->GetInstanceScript();
1250 }
1251
1252 void DoAction(int32 action) override
1253 {
1254 // Start encounter
1255 if (action == ACTION_SPAWN_VEHICLES)
1256 {
1257 for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
1259 for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
1261 for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
1263 }
1264 }
1265
1266 bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
1267 {
1268 if (menuId == GOSSIP_MENU_LORE_KEEPER && gossipListId == GOSSIP_OPTION_LORE_KEEPER)
1269 {
1271 CloseGossipMenuFor(player);
1272 me->GetMap()->LoadGrid(364, -16); // make sure leviathan is loaded
1273
1275 {
1276 leviathan->AI()->DoAction(ACTION_START_HARD_MODE);
1277 me->SetVisible(false);
1278 DoAction(ACTION_SPAWN_VEHICLES); // spawn the vehicles
1280 {
1282 {
1283 brann->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1284 delorah->GetMotionMaster()->MovePoint(0, brann->GetPositionX() - 4, brann->GetPositionY(), brann->GetPositionZ());
1286 }
1287 }
1288 }
1289 }
1290 return false;
1291 }
1292
1293 private:
1295 };
1296
1297 CreatureAI* GetAI(Creature* creature) const override
1298 {
1299 return GetUlduarAI<npc_lorekeeperAI>(creature);
1300 }
1301};
1302
1304{
1305 public:
1306 go_ulduar_tower() : GameObjectScript("go_ulduar_tower") { }
1307
1309 {
1310 go_ulduar_towerAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
1311
1313
1314 void Destroyed(WorldObject* attacker, uint32 /*eventId*/) override
1315 {
1316 switch (me->GetEntry())
1317 {
1318 case GO_TOWER_OF_STORMS:
1320 break;
1321 case GO_TOWER_OF_FLAMES:
1323 break;
1324 case GO_TOWER_OF_FROST:
1326 break;
1327 case GO_TOWER_OF_LIFE:
1329 break;
1330 }
1331
1332 if (Creature* trigger = me->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true))
1333 trigger->DisappearAndDie();
1334 }
1335 };
1336
1337 GameObjectAI* GetAI(GameObject* go) const override
1338 {
1339 return GetUlduarAI<go_ulduar_towerAI>(go);
1340 }
1341};
1342
1344{
1345 public:
1346 achievement_three_car_garage_demolisher() : AchievementCriteriaScript("achievement_three_car_garage_demolisher") { }
1347
1348 bool OnCheck(Player* source, Unit* /*target*/) override
1349 {
1350 if (Creature* vehicle = source->GetVehicleCreatureBase())
1351 {
1352 if (vehicle->GetEntry() == VEHICLE_DEMOLISHER)
1353 return true;
1354 }
1355
1356 return false;
1357 }
1358};
1359
1361{
1362 public:
1363 achievement_three_car_garage_chopper() : AchievementCriteriaScript("achievement_three_car_garage_chopper") { }
1364
1365 bool OnCheck(Player* source, Unit* /*target*/) override
1366 {
1367 if (Creature* vehicle = source->GetVehicleCreatureBase())
1368 {
1369 if (vehicle->GetEntry() == VEHICLE_CHOPPER)
1370 return true;
1371 }
1372
1373 return false;
1374 }
1375};
1376
1378{
1379 public:
1380 achievement_three_car_garage_siege() : AchievementCriteriaScript("achievement_three_car_garage_siege") { }
1381
1382 bool OnCheck(Player* source, Unit* /*target*/) override
1383 {
1384 if (Creature* vehicle = source->GetVehicleCreatureBase())
1385 {
1386 if (vehicle->GetEntry() == VEHICLE_SIEGE)
1387 return true;
1388 }
1389
1390 return false;
1391 }
1392};
1393
1395{
1396 public:
1397 achievement_shutout() : AchievementCriteriaScript("achievement_shutout") { }
1398
1399 bool OnCheck(Player* /*source*/, Unit* target) override
1400 {
1401 if (target)
1402 if (Creature* leviathan = target->ToCreature())
1403 if (leviathan->AI()->GetData(DATA_SHUTOUT))
1404 return true;
1405
1406 return false;
1407 }
1408};
1409
1411{
1412 public:
1413 achievement_unbroken() : AchievementCriteriaScript("achievement_unbroken") { }
1414
1415 bool OnCheck(Player* /*source*/, Unit* target) override
1416 {
1417 if (target)
1418 if (InstanceScript* instance = target->GetInstanceScript())
1419 return instance->GetData(DATA_UNBROKEN) != 0;
1420
1421 return false;
1422 }
1423};
1424
1425// 62399 - Overload Circuit
1427{
1428 bool Validate(SpellInfo const* /*spellInfo*/) override
1429 {
1431 }
1432
1433 void PeriodicTick(AuraEffect const* /*aurEff*/)
1434 {
1435 if (!GetTarget()->GetMap()->IsDungeon() || int32(GetTarget()->GetAppliedAuras().count(GetId())) < (GetTarget()->GetMap()->Is25ManRaid() ? 4 : 2))
1436 return;
1437
1438 GetTarget()->CastSpell(nullptr, SPELL_SYSTEMS_SHUTDOWN, true);
1439 if (Unit* veh = GetTarget()->GetVehicleBase())
1440 veh->CastSpell(nullptr, SPELL_SYSTEMS_SHUTDOWN, true);
1441 }
1442
1443 void Register() override
1444 {
1446 }
1447};
1448
1449// 62292 - Blaze
1451{
1452 bool Validate(SpellInfo const* spellInfo) override
1453 {
1454 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
1455 }
1456
1457 void PeriodicTick(AuraEffect const* aurEff)
1458 {
1459 // should we use custom damage?
1460 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, true);
1461 }
1462
1463 void Register() override
1464 {
1466 }
1467};
1468
1469// 64414 - Load into Catapult
1471{
1473 {
1475 };
1476
1477 public:
1478 spell_load_into_catapult() : SpellScriptLoader("spell_load_into_catapult") { }
1479
1481 {
1482 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1483 {
1484 Unit* owner = GetOwner()->ToUnit();
1485 if (!owner)
1486 return;
1487
1488 owner->CastSpell(owner, SPELL_PASSENGER_LOADED, true);
1489 }
1490
1491 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1492 {
1493 Unit* owner = GetOwner()->ToUnit();
1494 if (!owner)
1495 return;
1496
1498 }
1499
1500 void Register() override
1501 {
1504 }
1505 };
1506
1507 AuraScript* GetAuraScript() const override
1508 {
1510 }
1511};
1512
1513// 62705 - Auto-repair
1515{
1517 {
1519 };
1520
1521 public:
1522 spell_auto_repair() : SpellScriptLoader("spell_auto_repair") { }
1523
1525 {
1527 {
1528 if (missInfo != SPELL_MISS_NONE)
1529 return;
1530
1531 if (GetHitUnit()->HasAuraEffect(SPELL_AUTO_REPAIR, EFFECT_2)) // Check presence of dummy aura indicating cooldown
1532 {
1541 //PreventHitAura();
1542 }
1543 }
1544
1546 {
1547 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
1548 if (!vehicle)
1549 return;
1550
1551 Unit* driver = vehicle->GetPassenger(0);
1552 if (!driver)
1553 return;
1554
1555 driver->TextEmote(EMOTE_REPAIR, driver, true);
1556
1557 InstanceScript* instance = driver->GetInstanceScript();
1558 if (!instance)
1559 return;
1560
1561 // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
1562 vehicle->GetBase()->SetFullHealth();
1563
1564 // For achievement
1565 instance->SetData(DATA_UNBROKEN, 0);
1566 }
1567
1568 void Register() override
1569 {
1572 }
1573 };
1574
1575 SpellScript* GetSpellScript() const override
1576 {
1577 return new spell_auto_repair_SpellScript();
1578 }
1579};
1580
1581// 62475 - Systems Shutdown
1583{
1584 public:
1585 spell_systems_shutdown() : SpellScriptLoader("spell_systems_shutdown") { }
1586
1588 {
1589 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1590 {
1591 Creature* owner = GetOwner()->ToCreature();
1592 if (!owner)
1593 return;
1594
1599 }
1600
1601 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1602 {
1603 Creature* owner = GetOwner()->ToCreature();
1604 if (!owner)
1605 return;
1606
1608 }
1609
1610 void Register() override
1611 {
1614 }
1615 };
1616
1617 AuraScript* GetAuraScript() const override
1618 {
1620 }
1621};
1622
1624{
1625 enum Area
1626 {
1628 };
1629
1630 public:
1632
1633 bool operator()(WorldObject* target) const
1634 {
1636 Creature* creatureTarget = target->ToCreature();
1637 if (!creatureTarget)
1638 return false;
1639
1641 if (creatureTarget->GetEntry() != NPC_SALVAGED_DEMOLISHER && creatureTarget->GetEntry() != NPC_SALVAGED_SIEGE_ENGINE)
1642 return false;
1643
1645 Vehicle* vehicle = creatureTarget->GetVehicleKit();
1646 if (!vehicle)
1647 return false;
1648
1650 if (target->GetAreaId() != AREA_FORMATION_GROUNDS)
1651 return false;
1652
1654 for (SeatMap::const_iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end(); ++itr)
1655 if (itr->second.Passenger.Guid.IsPlayer())
1656 return true;
1657
1658 return false;
1659 }
1660};
1661
1662// 62374 - Pursued
1664{
1665 public:
1666 spell_pursue() : SpellScriptLoader("spell_pursue") { }
1667
1669 {
1670 private:
1671 // EFFECT #0 - select target
1672 void FilterTargets(std::list<WorldObject*>& targets)
1673 {
1675 if (targets.empty())
1676 {
1677 if (Unit* caster = GetCaster())
1678 if (Creature* cCaster = caster->ToCreature())
1679 cCaster->AI()->EnterEvadeMode(EvadeReason::NoHostiles);
1680 }
1681 else
1682 _target = targets.front();
1683 }
1684
1685 // EFFECT #1 - copy target from effect #0
1686 void FilterTargetsSubsequently(std::list<WorldObject*>& targets)
1687 {
1688 targets.clear();
1689 if (_target)
1690 targets.push_back(_target);
1691 }
1692
1693 void Register() override
1694 {
1697 }
1698
1700 };
1701
1702 SpellScript* GetSpellScript() const override
1703 {
1704 return new spell_pursue_SpellScript();
1705 }
1706};
1707
1708// 62324 - Throw Passenger
1710{
1711 public:
1712 spell_vehicle_throw_passenger() : SpellScriptLoader("spell_vehicle_throw_passenger") { }
1713
1715 {
1716 void HandleScript(SpellEffIndex /*effIndex*/)
1717 {
1718 Spell* baseSpell = GetSpell();
1719 SpellCastTargets targets = baseSpell->m_targets;
1720 int32 damage = GetEffectValue();
1721 if (targets.HasTraj())
1722 if (Vehicle* vehicle = GetCaster()->GetVehicleKit())
1723 if (Unit* passenger = vehicle->GetPassenger(damage - 1))
1724 {
1725 // use 99 because it is 3d search
1726 std::list<WorldObject*> targetList;
1729 Cell::VisitAllObjects(GetCaster(), searcher, 99.0f);
1730 float minDist = 99 * 99;
1731 Unit* target = nullptr;
1732 for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
1733 {
1734 if (Unit* unit = (*itr)->ToUnit())
1735 if (unit->GetEntry() == NPC_SEAT)
1736 if (Vehicle* seat = unit->GetVehicleKit())
1737 if (!seat->GetPassenger(0))
1738 if (Unit* device = seat->GetPassenger(2))
1739 if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
1740 {
1741 float dist = unit->GetExactDistSq(targets.GetDstPos());
1742 if (dist < minDist)
1743 {
1744 minDist = dist;
1745 target = unit;
1746 }
1747 }
1748 }
1749 if (target && target->IsWithinDist2d(targets.GetDstPos(), GetEffectInfo().CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
1750 passenger->EnterVehicle(target, 0);
1751 else
1752 {
1753 passenger->ExitVehicle();
1754 passenger->GetMotionMaster()->MoveJump(*targets.GetDstPos(), targets.GetSpeedXY(), targets.GetSpeedZ());
1755 }
1756 }
1757 }
1758
1759 void Register() override
1760 {
1762 }
1763 };
1764
1765 SpellScript* GetSpellScript() const override
1766 {
1768 }
1769};
1770
1772{
1779 new npc_mechanolift();
1780 new npc_pool_of_tar();
1781 new npc_colossus();
1782 new npc_thorims_hammer();
1784 new npc_hodirs_fury();
1785 new npc_freyas_ward();
1788 new npc_lorekeeper();
1789 new go_ulduar_tower();
1790
1794 new achievement_shutout();
1796
1800 new spell_auto_repair();
1802 new spell_pursue();
1804}
@ IN_MILLISECONDS
Definition: Common.h:35
uint8_t uint8
Definition: Define.h:144
int8_t int8
Definition: Define.h:140
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
#define ASSERT_NOTNULL(pointer)
Definition: Errors.h:84
#define ASSERT
Definition: Errors.h:68
@ POINT_MOTION_TYPE
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: ObjectDefines.h:68
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
@ STATE_ESCORT_ESCORTING
void CloseGossipMenuFor(Player *player)
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
SpellMissInfo
@ SPELL_MISS_NONE
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_SCHOOL_MASK_FIRE
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ LOOT_MODE_HARD_MODE_3
Definition: SharedDefines.h:80
@ LOOT_MODE_HARD_MODE_1
Definition: SharedDefines.h:78
@ LOOT_MODE_HARD_MODE_2
Definition: SharedDefines.h:79
@ LOOT_MODE_DEFAULT
Definition: SharedDefines.h:77
@ LOOT_MODE_HARD_MODE_4
Definition: SharedDefines.h:81
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_PERIODIC_DUMMY
@ TARGET_CHECK_DEFAULT
Definition: SpellInfo.h:82
@ TARGET_OBJECT_TYPE_UNIT
Definition: SpellInfo.h:69
#define BeforeSpellHitFn(F)
Definition: SpellScript.h:847
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
@ REACT_DEFENSIVE
Definition: UnitDefines.h:507
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
@ UNIT_NPC_FLAG_SPELLCLICK
Definition: UnitDefines.h:321
DamageEffectType
Definition: UnitDefines.h:131
UnitFlags
Definition: UnitDefines.h:143
@ UNIT_FLAG_STUNNED
Definition: UnitDefines.h:162
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
@ CURRENT_CHANNELED_SPELL
Definition: Unit.h:591
@ UNIT_STATE_ROOT
Definition: Unit.h:265
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ UNIT_STATE_STUNNED
Definition: Unit.h:258
@ GO_TOWER_OF_LIFE
@ GO_TOWER_OF_STORMS
@ GO_TOWER_OF_FLAMES
@ GO_TOWER_OF_FROST
@ NPC_MIMIRON_BEACON
@ NPC_FREYA_TARGET_BEACON
@ NPC_HODIR_TARGET_BEACON
@ NPC_THORIM_BEACON
@ NPC_FREYA_BEACON
@ NPC_HODIR_BEACON
@ NPC_THORIM_TARGET_BEACON
@ NPC_ULDUAR_GAUNTLET_GENERATOR
@ NPC_MECHANOLIFT
@ NPC_MIMIRON_TARGET_BEACON
@ NPC_CONTAINER
BrannBronzebeardGossips
@ GOSSIP_MENU_BRANN_BRONZEBEARD
@ GOSSIP_OPTION_BRANN_BRONZEBEARD
@ VEHICLE_SPAWNS
@ SAY_PLAYER_RIDING
@ SAY_TOWER_NATURE
@ SAY_TOWER_NONE
@ SAY_TOWER_STORM
@ SAY_TOWER_FLAME
@ SAY_TOWER_FROST
@ EMOTE_OVERLOAD
Position const InfernoStart
@ VEHICLE_CHOPPER
@ VEHICLE_DEMOLISHER
@ GOSSIP_OPTION_LORE_KEEPER
@ GOSSIP_MENU_LORE_KEEPER
@ SPELL_BUFF_TOWER_OF_FLAMES
@ SPELL_TAR_PASSIVE
@ SPELL_FLAME_VENTS
@ SPELL_THORIM_S_HAMMER
@ SPELL_BATTERING_RAM
@ SPELL_GATHERING_SPEED
@ SPELL_DUSTY_EXPLOSION
@ SPELL_RIDE_VEHICLE
@ SPELL_SMOKE_TRAIL
@ AURA_DUMMY_BLUE
@ SPELL_START_THE_ENGINE
@ SPELL_BUFF_TOWER_OF_FR0ST
@ SPELL_SYSTEMS_SHUTDOWN
@ SPELL_FREYA_S_WARD_EFFECT_2
@ SPELL_DUST_CLOUD_IMPACT
@ SPELL_HODIR_S_FURY
@ SPELL_ELECTROSHOCK
@ SPELL_OVERLOAD_CIRCUIT
@ SPELL_MISSILE_BARRAGE
@ SPELL_PURSUED
@ SPELL_FREYA_S_WARD_EFFECT_1
@ AURA_STEALTH_DETECTION
@ SPELL_BUFF_TOWER_OF_LIFE
@ AURA_DUMMY_YELLOW
@ SPELL_BUFF_TOWER_OF_STORMS
@ SPELL_SEARING_FLAME
@ SPELL_AUTO_REPAIR
@ SPELL_MIMIRON_S_INFERNO
@ SPELL_NAPALM
@ AURA_DUMMY_GREEN
@ SPELL_INVIS_AND_STEALTH_DETECT
@ SPELL_FREYA_SUMMONS
@ SPELL_LIQUID_PYRITE
@ SPELL_FREYA_S_WARD
Position const PosSiege[VEHICLE_SPAWNS]
Position const FreyaBeacons[FREYA_SPAWNS]
Position const Center
static constexpr uint32 PATH_ESCORT_MIMIRONS_INFERNO
void AddSC_boss_flame_leviathan()
@ ACTION_START_HARD_MODE
@ ACTION_SPAWN_VEHICLES
Position const PosDemolisher[VEHICLE_SPAWNS]
@ EVENT_FREYA_S_WARD
@ EVENT_MIMIRON_S_INFERNO
@ EVENT_THORIM_S_HAMMER
@ EVENT_SHUTDOWN
@ EVENT_HODIR_S_FURY
Position const PosChopper[VEHICLE_SPAWNS]
Yells
SpellEffectInfo const & GetSpellEffectInfo() const
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
WorldObject * GetOwner() const
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:2035
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
uint32 GetId() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
void _JustDied()
Creature * DoSummonFlyer(uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:475
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
Creature * DoSummon(uint32 entry, Position const &pos, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:464
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
void RemoveLootMode(uint16 lootMode)
Definition: Creature.h:299
bool HasLootMode(uint16 lootMode) const
Definition: Creature.h:296
void SetCanMelee(bool canMelee, bool fleeFromMelee=false)
Definition: Creature.cpp:2822
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:373
bool HasReactState(ReactStates state) const
Definition: Creature.h:162
void SetDisplayFromModel(uint32 modelIdx)
Definition: Creature.cpp:3413
bool IsEngaged() const override
Definition: Creature.cpp:3601
void SetReactState(ReactStates st)
Definition: Creature.h:160
void SetLootMode(uint16 lootMode)
Definition: Creature.h:297
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void DelayEvents(Milliseconds delay)
Definition: EventMap.cpp:96
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:131
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:52
bool operator()(WorldObject *target) const
GameObject *const me
Definition: GameObjectAI.h:50
Creature * GetCreature(uint32 type)
void DoUpdateWorldState(int32 worldStateId, int32 value)
void LoadGrid(float x, float y)
Definition: Map.cpp:405
float GetHeight(PhaseShift const &phaseShift, float x, float y, float z, bool vmap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH)
Definition: Map.h:290
void MoveRandom(float wanderDistance=0.0f, Optional< Milliseconds > duration={}, MovementSlot slot=MOTION_SLOT_DEFAULT)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
void MoveTargetedHome()
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
void Clear()
Definition: ObjectGuid.h:286
static Creature * ToCreature(Object *o)
Definition: Object.h:219
static Unit * ToUnit(Object *o)
Definition: Object.h:225
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
bool HasTraj() const
Definition: SpellDefines.h:387
float GetSpeedZ() const
Definition: SpellDefines.h:396
float GetSpeedXY() const
Definition: SpellDefines.h:395
WorldLocation const * GetDstPos() const
Definition: Spell.cpp:368
uint32 TriggerSpell
Definition: SpellInfo.h:237
uint32 const Id
Definition: SpellInfo.h:325
uint32 SchoolMask
Definition: SpellInfo.h:413
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
Definition: SpellScript.h:173
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
void PreventHitEffect(SpellEffIndex effIndex)
Spell * GetSpell() const
Definition: SpellScript.h:987
HookList< BeforeHitHandler > BeforeHit
Definition: SpellScript.h:846
WorldLocation const * GetExplTargetDest() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
Definition: Spell.h:255
SpellCastTargets m_targets
Definition: Spell.h:607
size_type size() const
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition: Unit.cpp:12118
void ClearUnitState(uint32 f)
Definition: Unit.h:733
bool IsVehicle() const
Definition: Unit.h:743
Vehicle * GetVehicle() const
Definition: Unit.h:1713
void SetVisible(bool x)
Definition: Unit.cpp:8351
void SetFullHealth()
Definition: Unit.h:790
bool IsWithinCombatRange(Unit const *obj, float dist2compare) const
Definition: Unit.cpp:635
Creature * GetVehicleCreatureBase() const
Definition: Unit.cpp:11501
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
Unit * GetVehicleBase() const
Definition: Unit.cpp:11480
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:11618
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
void AddUnitState(uint32 f)
Definition: Unit.h:731
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:12392
uint32 GetFaction() const override
Definition: Unit.h:858
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:13572
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:833
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:690
Vehicle * GetVehicleKit() const
Definition: Unit.h:1711
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition: Unit.cpp:630
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
bool IsInCombat() const
Definition: Unit.h:1043
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition: Unit.cpp:3017
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:834
bool isDead() const
Definition: Unit.h:1166
Unit * GetBase() const
Definition: Vehicle.h:49
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition: Vehicle.cpp:291
bool HasEmptySeat(int8 seatId) const
Checks if vehicle's seat specified by 'seatId' is empty.
Definition: Vehicle.cpp:270
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Definition: Vehicle.h:67
bool IsWithinDist2d(float x, float y, float dist) const
Definition: Object.cpp:1132
Map * GetMap() const
Definition: Object.h:624
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
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:2025
PhaseShift & GetPhaseShift()
Definition: Object.h:523
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
Definition: Object.cpp:1238
uint32 GetAreaId() const
Definition: Object.h:546
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
virtual void ProcessEvent(WorldObject *, uint32, WorldObject *)
Definition: ZoneScript.h:95
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *source, Unit *) override
bool OnCheck(Player *source, Unit *) override
bool OnCheck(Player *source, Unit *) override
bool OnCheck(Player *, Unit *target) 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
CreatureAI * GetAI(Creature *creature) const override
GameObjectAI * GetAI(GameObject *go) 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
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
SpellScript * GetSpellScript() const override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
AuraScript * GetAuraScript() const override
void PeriodicTick(AuraEffect const *)
bool Validate(SpellInfo const *) override
void FilterTargetsSubsequently(std::list< WorldObject * > &targets)
void FilterTargets(std::list< WorldObject * > &targets)
SpellScript * GetSpellScript() const override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
AuraScript * GetAuraScript() const override
bool Validate(SpellInfo const *spellInfo) override
void PeriodicTick(AuraEffect const *aurEff)
void Register() override
SpellScript * GetSpellScript() const override
void apply(T *val)
Definition: ByteConverter.h:41
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:203
void Start(bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false)
bool HasEscortState(uint32 escortState)
void LoadPath(uint32 pathId)
void UpdateAI(uint32 diff) override
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:81
constexpr float GetExactDistSq(float x, float y, float z) const
Definition: Position.h:110
constexpr float GetPositionZ() const
Definition: Position.h:78
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
T const & RAID_MODE(T const &normal10, T const &normal25) const
uint32 GetData(uint32 type) const override
void SpellHitTarget(WorldObject *target, SpellInfo const *spellInfo) override
void MovementInform(uint32, uint32 id) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void SetData(uint32 id, uint32 data) override
void DamageTaken(Unit *who, uint32 &damage, DamageEffectType, SpellInfo const *) override
void PassengerBoarded(Unit *who, int8 seatId, bool apply) override
== Fields =======================================
void Destroyed(WorldObject *attacker, uint32) override
bool OnGossipSelect(Player *player, uint32 menuId, uint32 gossipListId) override
void DoAction(int32 action) override
bool OnGossipSelect(Player *player, uint32 menuId, uint32 gossipListId) override
void MovementInform(uint32 type, uint32 id) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
@ DATA_FLAME_LEVIATHAN
Definition: ulduar.h:37
@ DATA_UNBROKEN
Definition: ulduar.h:479
@ DATA_DELLORAH
Definition: ulduar.h:464
@ DATA_BRANN_BRONZEBEARD_INTRO
Definition: ulduar.h:462
@ DATA_LORE_KEEPER_OF_NORGANNON
Definition: ulduar.h:463
@ DATA_COLOSSUS
Definition: ulduar.h:395
@ EVENT_TOWER_OF_STORM_DESTROYED
Definition: ulduar.h:330
@ EVENT_TOWER_OF_LIFE_DESTROYED
Definition: ulduar.h:333
@ EVENT_TOWER_OF_FLAMES_DESTROYED
Definition: ulduar.h:332
@ EVENT_TOWER_OF_FROST_DESTROYED
Definition: ulduar.h:331
@ ACTION_TOWER_OF_FLAMES_DESTROYED
Definition: ulduar.h:342
@ ACTION_TOWER_OF_STORM_DESTROYED
Definition: ulduar.h:340
@ ACTION_MOVE_TO_CENTER_POSITION
Definition: ulduar.h:344
@ ACTION_TOWER_OF_LIFE_DESTROYED
Definition: ulduar.h:343
@ ACTION_TOWER_OF_FROST_DESTROYED
Definition: ulduar.h:341
@ WORLD_STATE_FLAME_LEVIATHAN_DESTROYED_TOWERS
Definition: ulduar.h:470
@ NPC_SALVAGED_SIEGE_ENGINE
Definition: ulduar.h:61
@ NPC_SALVAGED_DEMOLISHER
Definition: ulduar.h:60