TrinityCore
Loading...
Searching...
No Matches
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 "CellImpl.h"
27#include "CombatAI.h"
28#include "Containers.h"
29#include "GameObjectAI.h"
30#include "GridNotifiersImpl.h"
31#include "InstanceScript.h"
32#include "MotionMaster.h"
33#include "ObjectAccessor.h"
34#include "PassiveAI.h"
35#include "ScriptedEscortAI.h"
36#include "ScriptedGossip.h"
37#include "Spell.h"
38#include "SpellAuraEffects.h"
39#include "SpellInfo.h"
40#include "SpellScript.h"
41#include "ulduar.h"
42#include "Vehicle.h"
43
45{
55 SPELL_BLAZE = 62292,
59 SPELL_NAPALM = 63666,
61 //TOWER Additional SPELLS
62 SPELL_THORIM_S_HAMMER = 62911, // Tower of Storms
63 SPELL_MIMIRON_S_INFERNO = 62909, // Tower of Flames
64 SPELL_HODIR_S_FURY = 62533, // Tower of Frost
65 SPELL_FREYA_S_WARD = 62906, // Tower of Nature
66 SPELL_FREYA_SUMMONS = 62947, // Tower of Nature
67 //TOWER ap & health spells
72 //Additional Spells
73 SPELL_LASH = 65062,
85};
86
103
111
113{
121 EVENT_THORIM_S_HAMMER = 8, // Tower of Storms
122 EVENT_MIMIRON_S_INFERNO = 9, // Tower of Flames
123 EVENT_HODIR_S_FURY = 10, // Tower of Frost
124 EVENT_FREYA_S_WARD = 11, // Tower of Nature
125};
126
134
136{
140};
141
143{
144 DATA_SHUTOUT = 29112912, // 2911, 2912 are achievement IDs
147 FREYA_SPAWNS = 4
148
150
169
171{
172 // Other Actions are in Ulduar.h
175 // Amount of seats depending on Raid mode
178};
179
180Position const Center = { 354.8771f, -12.90240f, 409.803650f, 0.0f };
181Position const InfernoStart = { 390.93f, -13.91f, 409.81f, 0.0f };
182
184{
185 {-814.59f, -64.54f, 429.92f, 5.969f},
186 {-784.37f, -33.31f, 429.92f, 5.096f},
187 {-808.99f, -52.10f, 429.92f, 5.668f},
188 {-798.59f, -44.00f, 429.92f, 5.663f},
189 {-812.83f, -77.71f, 429.92f, 0.046f},
190};
191
193{
194 {-717.83f, -106.56f, 430.02f, 0.122f},
195 {-717.83f, -114.23f, 430.44f, 0.122f},
196 {-717.83f, -109.70f, 430.22f, 0.122f},
197 {-718.45f, -118.24f, 430.26f, 0.052f},
198 {-718.45f, -123.58f, 430.41f, 0.085f},
199};
200
202{
203 {-724.12f, -176.64f, 430.03f, 2.543f},
204 {-766.70f, -225.03f, 430.50f, 1.710f},
205 {-729.54f, -186.26f, 430.12f, 1.902f},
206 {-756.01f, -219.23f, 430.50f, 2.369f},
207 {-798.01f, -227.24f, 429.84f, 1.446f},
208};
209
211{
212 {377.02f, -119.10f, 409.81f, 0.0f},
213 {185.62f, -119.10f, 409.81f, 0.0f},
214 {377.02f, 54.78f, 409.81f, 0.0f},
215 {185.62f, 54.78f, 409.81f, 0.0f},
216};
217
219{
220 public:
221 boss_flame_leviathan() : CreatureScript("boss_flame_leviathan") { }
222
224 {
226 {
227 Initialize();
228 }
229
231 {
233 Shutdown = 0;
234 ActiveTowers = false;
235 towerOfStorms = false;
236 towerOfLife = false;
237 towerOfFlames = false;
238 towerOfFrost = false;
239 Shutout = true;
240 Unbroken = true;
241 }
242
255
265
266 void Reset() override
267 {
268 _Reset();
269 //resets shutdown counter to 0. 2 or 4 depending on raid mode
270 Shutdown = 0;
272
274 }
275
288
290 {
291 if (ActiveTowers)
292 {
293 if (towerOfStorms)
294 {
297 }
298
299 if (towerOfFlames)
300 {
303 }
304
305 if (towerOfFrost)
306 {
309 }
310
311 if (towerOfLife)
312 {
315 }
316
319 else
321 }
322 else
324 }
325
326 void JustDied(Unit* /*killer*/) override
327 {
328 _JustDied();
330 }
331
332 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
333 {
334 if (spellInfo->Id == SPELL_START_THE_ENGINE)
335 if (Vehicle* vehicleKit = me->GetVehicleKit())
336 vehicleKit->InstallAllAccessories(false);
337
338 if (spellInfo->Id == SPELL_ELECTROSHOCK)
340
341 if (spellInfo->Id == SPELL_OVERLOAD_CIRCUIT)
342 ++Shutdown;
343 }
344
345 uint32 GetData(uint32 type) const override
346 {
347 switch (type)
348 {
349 case DATA_SHUTOUT:
350 return Shutout ? 1 : 0;
351 case DATA_UNBROKEN:
352 return Unbroken ? 1 : 0;
354 if (ActiveTowers) // Only on HardMode
355 return ActiveTowersCount;
356 break;
357 default:
358 break;
359 }
360
361 return 0;
362 }
363
364 void SetData(uint32 id, uint32 data) override
365 {
366 if (id == DATA_UNBROKEN)
367 Unbroken = data ? true : false;
368 }
369
370 void UpdateAI(uint32 diff) override
371 {
372 if (!me->IsEngaged())
373 return;
374
375 if (!me->IsInCombat())
376 {
378 return;
379 }
380
381 events.Update(diff);
382
384 {
385 Shutdown = 0;
389 return;
390 }
391
393 return;
394
395 while (uint32 eventId = events.ExecuteEvent())
396 {
397 switch (eventId)
398 {
399 case EVENT_PURSUE:
401 DoCast(SPELL_PURSUED); // Will select target in spellscript
403 break;
404 case EVENT_MISSILE:
407 break;
408 case EVENT_VENT:
411 break;
412 case EVENT_SPEED:
415 break;
416 case EVENT_SUMMON:
417 if (summons.size() < 15)
418 if (Creature* lift = DoSummonFlyer(NPC_MECHANOLIFT, me, 30.0f, 50.0f, 0s))
419 lift->GetMotionMaster()->MoveRandom(100);
421 break;
422 case EVENT_SHUTDOWN:
426 if (Shutout)
427 Shutout = false;
429 events.DelayEvents(20s, 0);
430 break;
431 case EVENT_REPAIR:
436 break;
437 case EVENT_THORIM_S_HAMMER: // Tower of Storms
438 for (uint8 i = 0; i < 7; ++i)
439 {
440 if (Creature* thorim = DoSummon(NPC_THORIM_BEACON, me, float(urand(20, 60)), 20s, TEMPSUMMON_TIMED_DESPAWN))
441 thorim->GetMotionMaster()->MoveRandom(100);
442 }
445 break;
446 case EVENT_MIMIRON_S_INFERNO: // Tower of Flames
450 break;
451 case EVENT_HODIR_S_FURY: // Tower of Frost
452 for (uint8 i = 0; i < 7; ++i)
453 {
454 if (Creature* hodir = DoSummon(NPC_HODIR_BEACON, me, 50, 0s))
455 hodir->GetMotionMaster()->MoveRandom(100);
456 }
459 break;
460 case EVENT_FREYA_S_WARD: // Tower of Nature
462 for (int32 i = 0; i < 4; ++i)
464
466 DoCast(target, SPELL_FREYA_S_WARD);
468 break;
469 }
470
472 return;
473 }
474
476 }
477
478 void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
479 {
480 Unit* unitTarget = target->ToUnit();
481 if (!unitTarget)
482 return;
483
484 if (spellInfo->Id != SPELL_PURSUED)
485 return;
486
487 _pursueTarget = unitTarget->GetGUID();
488 AttackStart(unitTarget);
489
490 for (SeatMap::const_iterator itr = unitTarget->GetVehicleKit()->Seats.begin(); itr != unitTarget->GetVehicleKit()->Seats.end(); ++itr)
491 {
492 if (Player* passenger = ObjectAccessor::GetPlayer(*me, itr->second.Passenger.Guid))
493 {
494 Talk(EMOTE_PURSUE, passenger);
495 return;
496 }
497 }
498 }
499
500 void DoAction(int32 action) override
501 {
502 if (action && action <= 4) // Tower destruction, debuff leviathan loot and reduce active tower count
503 {
506
509
512
515 }
516
517 switch (action)
518 {
520 if (towerOfStorms)
521 {
522 towerOfStorms = false;
524 }
525 break;
527 if (towerOfFrost)
528 {
529 towerOfFrost = false;
531 }
532 break;
534 if (towerOfFlames)
535 {
536 towerOfFlames = false;
538 }
539 break;
541 if (towerOfLife)
542 {
543 towerOfLife = false;
545 }
546 break;
547 case ACTION_START_HARD_MODE: // Activate hard-mode enable all towers, apply buffs on leviathan
548 ActiveTowers = true;
549 towerOfStorms = true;
550 towerOfLife = true;
551 towerOfFlames = true;
552 towerOfFrost = true;
554 break;
555 case ACTION_MOVE_TO_CENTER_POSITION: // Triggered by 2 Collossus near door
557 {
560 }
561 break;
562 default:
563 break;
564 }
565 }
566
574
575 private:
579 {
580 if (me->isAttackReady())
581 {
583
584 if (!target)
585 {
587 return;
588 }
589
590 if (me->IsWithinCombatRange(target, 30.0f))
591 {
594 }
595 }
596 }
597
599 };
600
601 CreatureAI* GetAI(Creature* creature) const override
602 {
603 return GetUlduarAI<boss_flame_leviathanAI>(creature);
604 }
605};
606
608{
609 public:
610 boss_flame_leviathan_seat() : CreatureScript("boss_flame_leviathan_seat") { }
611
613 {
620
622
623 void PassengerBoarded(Unit* who, int8 seatId, bool apply) override
624 {
625 if (!me->GetVehicle())
626 return;
627
628 if (seatId == SEAT_PLAYER)
629 {
630 if (!apply)
631 return;
632 else if (Creature* leviathan = me->GetVehicleCreatureBase())
633 leviathan->AI()->Talk(SAY_PLAYER_RIDING);
634
635 if (Unit* turretPassenger = me->GetVehicleKit()->GetPassenger(SEAT_TURRET))
636 if (Creature* turret = turretPassenger->ToCreature())
637 {
638 turret->SetFaction(me->GetVehicleBase()->GetFaction());
639 turret->ReplaceAllUnitFlags(UnitFlags(0)); // unselectable
640 turret->AI()->AttackStart(who);
641 }
642 if (Unit* devicePassenger = me->GetVehicleKit()->GetPassenger(SEAT_DEVICE))
643 if (Creature* device = devicePassenger->ToCreature())
644 {
645 device->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
646 device->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
647 }
648
650 }
651 else if (seatId == SEAT_TURRET)
652 {
653 if (apply)
654 return;
655
656 if (Unit* device = ASSERT_NOTNULL(me->GetVehicleKit())->GetPassenger(SEAT_DEVICE))
657 {
658 device->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
659 device->ReplaceAllUnitFlags(UnitFlags(0)); // unselectable
660 }
661 }
662 }
663 };
664
665 CreatureAI* GetAI(Creature* creature) const override
666 {
667 return GetUlduarAI<boss_flame_leviathan_seatAI>(creature);
668 }
669};
670
672{
673 public:
674 boss_flame_leviathan_defense_cannon() : CreatureScript("boss_flame_leviathan_defense_cannon") { }
675
677 {
679 {
680 Initialize();
681 }
682
684 {
686 }
687
689
690 void Reset() override
691 {
692 Initialize();
694 }
695
696 void UpdateAI(uint32 diff) override
697 {
698 if (!UpdateVictim())
699 return;
700
701 if (NapalmTimer <= diff)
702 {
704 if (CanAIAttack(target))
705 DoCast(target, SPELL_NAPALM, true);
706
707 NapalmTimer = 5000;
708 }
709 else
710 NapalmTimer -= diff;
711 }
712
713 bool CanAIAttack(Unit const* who) const override
714 {
715 if (who->GetTypeId() != TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() == NPC_SEAT)
716 return false;
717 return true;
718 }
719 };
720
721 CreatureAI* GetAI(Creature* creature) const override
722 {
723 return GetUlduarAI<boss_flame_leviathan_defense_cannonAI>(creature);
724 }
725};
726
728{
729 public:
730 boss_flame_leviathan_defense_turret() : CreatureScript("boss_flame_leviathan_defense_turret") { }
731
733 {
735
736 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
737 {
738 if (!CanAIAttack(who))
739 damage = 0;
740 }
741
742 bool CanAIAttack(Unit const* who) const override
743 {
744 if (!who || who->GetTypeId() != TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() != NPC_SEAT)
745 return false;
746 return true;
747 }
748 };
749
750 CreatureAI* GetAI(Creature* creature) const override
751 {
752 return GetUlduarAI<boss_flame_leviathan_defense_turretAI>(creature);
753 }
754};
755
757{
758 public:
759 boss_flame_leviathan_overload_device() : CreatureScript("boss_flame_leviathan_overload_device") { }
760
762 {
766
767 void OnSpellClick(Unit* /*clicker*/, bool spellClickHandled) override
768 {
769 if (!spellClickHandled)
770 return;
771
772 if (me->GetVehicle())
773 {
776
777 if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
778 {
779 me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
780 player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30);
781 player->ExitVehicle();
782 }
783 }
784 }
785 };
786
787 CreatureAI* GetAI(Creature* creature) const override
788 {
789 return GetUlduarAI<boss_flame_leviathan_overload_deviceAI>(creature);
790 }
791};
792
794{
795 public:
796 boss_flame_leviathan_safety_container() : CreatureScript("boss_flame_leviathan_safety_container") { }
797
799 {
803
804 void JustDied(Unit* /*killer*/) override
805 {
806 float x, y, z;
807 me->GetPosition(x, y, z);
808 z = me->GetMap()->GetHeight(me->GetPhaseMask(), x, y, z);
809 me->GetMotionMaster()->MovePoint(0, x, y, z);
810 me->UpdatePosition(x, y, z, 0);
811 }
812
813 void UpdateAI(uint32 /*diff*/) override
814 {
815 }
816 };
817
818 CreatureAI* GetAI(Creature* creature) const override
819 {
820 return GetUlduarAI<boss_flame_leviathan_safety_containerAI>(creature);
821 }
822};
823
825{
826 public:
827 npc_mechanolift() : CreatureScript("npc_mechanolift") { }
828
830 {
831 npc_mechanoliftAI(Creature* creature) : PassiveAI(creature)
832 {
833 Initialize();
835 }
836
838 {
839 MoveTimer = 0;
840 }
841
843
844 void Reset() override
845 {
846 Initialize();
848 }
849
850 void JustDied(Unit* /*killer*/) override
851 {
854 Creature* liquid = DoSummon(NPC_LIQUID, me, 0);
855 if (liquid)
856 {
857 liquid->CastSpell(liquid, SPELL_LIQUID_PYRITE, true);
858 liquid->CastSpell(liquid, SPELL_DUST_CLOUD_IMPACT, true);
859 }
860 }
861
862 void MovementInform(uint32 type, uint32 id) override
863 {
864 if (type == POINT_MOTION_TYPE && id == 1)
865 if (Creature* container = me->FindNearestCreature(NPC_CONTAINER, 5, true))
866 container->EnterVehicle(me);
867 }
868
869 void UpdateAI(uint32 diff) override
870 {
871 if (MoveTimer <= diff)
872 {
873 if (me->GetVehicleKit()->HasEmptySeat(-1))
874 {
875 Creature* container = me->FindNearestCreature(NPC_CONTAINER, 50, true);
876 if (container && !container->GetVehicle())
877 me->GetMotionMaster()->MovePoint(1, container->GetPositionX(), container->GetPositionY(), container->GetPositionZ());
878 }
879
880 MoveTimer = 30000; //check next 30 seconds
881 }
882 else
883 MoveTimer -= diff;
884 }
885 };
886
887 CreatureAI* GetAI(Creature* creature) const override
888 {
889 return GetUlduarAI<npc_mechanoliftAI>(creature);
890 }
891};
892
894{
895 public:
896 npc_pool_of_tar() : CreatureScript("npc_pool_of_tar") { }
897
899 {
906
907 void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
908 {
909 damage = 0;
910 }
911
912 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
913 {
915 me->CastSpell(me, SPELL_BLAZE, true);
916 }
917
918 void UpdateAI(uint32 /*diff*/) override { }
919 };
920
921 CreatureAI* GetAI(Creature* creature) const override
922 {
923 return GetUlduarAI<npc_pool_of_tarAI>(creature);
924 }
925};
926
928{
929 public:
930 npc_colossus() : CreatureScript("npc_colossus") { }
931
933 {
934 npc_colossusAI(Creature* creature) : ScriptedAI(creature)
935 {
936 instance = creature->GetInstanceScript();
937 }
938
940
941 void JustDied(Unit* /*killer*/) override
942 {
943 if (me->GetHomePosition().IsInDist(&Center, 50.f))
945 }
946
947 void UpdateAI(uint32 /*diff*/) override
948 {
949 if (!UpdateVictim())
950 return;
951
953 }
954 };
955
956 CreatureAI* GetAI(Creature* creature) const override
957 {
958 return GetUlduarAI<npc_colossusAI>(creature);
959 }
960};
961
963{
964 public:
965 npc_thorims_hammer() : CreatureScript("npc_thorims_hammer") { }
966
968 {
974
975 void MoveInLineOfSight(Unit* who) override
976
977 {
978 if (who->GetTypeId() == TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who, 0, 10, false))
979 {
981 trigger->CastSpell(who, SPELL_THORIM_S_HAMMER, true);
982 }
983 }
984
985 void UpdateAI(uint32 /*diff*/) override
986 {
989
990 UpdateVictim();
991 }
992 };
993
994 CreatureAI* GetAI(Creature* creature) const override
995 {
996 return GetUlduarAI<npc_thorims_hammerAI>(creature);
997 }
998};
999
1000static constexpr uint32 PATH_ESCORT_MIMIRONS_INFERNO = 266962;
1001
1003{
1004public:
1005 npc_mimirons_inferno() : CreatureScript("npc_mimirons_inferno") { }
1006
1008 {
1016
1018 {
1019 infernoTimer = 2000;
1020 }
1021
1022 void Reset() override
1023 {
1024 Initialize();
1025 }
1026
1028
1029 void UpdateAI(uint32 diff) override
1030 {
1031 EscortAI::UpdateAI(diff);
1032
1034 {
1036 Start(false, ObjectGuid::Empty, nullptr, false, true);
1037 }
1038 else
1039 {
1040 if (infernoTimer <= diff)
1041 {
1043 {
1044 trigger->CastSpell(me->GetPosition(), SPELL_MIMIRON_S_INFERNO, true);
1045 infernoTimer = 2000;
1046 }
1047 }
1048 else
1049 infernoTimer -= diff;
1050
1053 }
1054 }
1055 };
1056
1057 CreatureAI* GetAI(Creature* creature) const override
1058 {
1059 return GetUlduarAI<npc_mimirons_infernoAI>(creature);
1060 }
1061};
1062
1064{
1065 public:
1066 npc_hodirs_fury() : CreatureScript("npc_hodirs_fury") { }
1067
1069 {
1071 {
1074 }
1075
1076 void MoveInLineOfSight(Unit* who) override
1077
1078 {
1079 if (who->GetTypeId() == TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who, 0, 5, false))
1080 {
1082 trigger->CastSpell(who, SPELL_HODIR_S_FURY, true);
1083 }
1084 }
1085
1086 void UpdateAI(uint32 /*diff*/) override
1087 {
1090
1091 UpdateVictim();
1092 }
1093 };
1094
1095 CreatureAI* GetAI(Creature* creature) const override
1096 {
1097 return GetUlduarAI<npc_hodirs_furyAI>(creature);
1098 }
1099};
1100
1102{
1103 public:
1104 npc_freyas_ward() : CreatureScript("npc_freyas_ward") { }
1105
1107 {
1109 {
1110 Initialize();
1112 }
1113
1115 {
1116 summonTimer = 5000;
1117 }
1118
1120
1121 void Reset() override
1122 {
1123 Initialize();
1124 }
1125
1126 void UpdateAI(uint32 diff) override
1127 {
1128 if (summonTimer <= diff)
1129 {
1132 summonTimer = 20000;
1133 }
1134 else
1135 summonTimer -= diff;
1136
1139
1140 UpdateVictim();
1141 }
1142 };
1143
1144 CreatureAI* GetAI(Creature* creature) const override
1145 {
1146 return GetUlduarAI<npc_freyas_wardAI>(creature);
1147 }
1148};
1149
1151{
1152 public:
1153 npc_freya_ward_summon() : CreatureScript("npc_freya_ward_summon") { }
1154
1156 {
1158 {
1159 Initialize();
1160 creature->GetMotionMaster()->MoveRandom(100);
1161 }
1162
1164 {
1165 lashTimer = 5000;
1166 }
1167
1169
1170 void Reset() override
1171 {
1172 Initialize();
1173 }
1174
1175 void UpdateAI(uint32 diff) override
1176 {
1177 if (!UpdateVictim())
1178 return;
1179
1180 if (lashTimer <= diff)
1181 {
1183 lashTimer = 20000;
1184 }
1185 else
1186 lashTimer -= diff;
1187
1189 }
1190 };
1191
1192 CreatureAI* GetAI(Creature* creature) const override
1193 {
1194 return GetUlduarAI<npc_freya_ward_summonAI>(creature);
1195 }
1196};
1197
1203
1205{
1206 public:
1207 npc_brann_bronzebeard_ulduar_intro() : CreatureScript("npc_brann_bronzebeard_ulduar_intro") { }
1208
1210 {
1212 {
1213 _instance = creature->GetInstanceScript();
1214 }
1215
1216 bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
1217 {
1218 if (menuId == GOSSIP_MENU_BRANN_BRONZEBEARD && gossipListId == GOSSIP_OPTION_BRANN_BRONZEBEARD)
1219 {
1223 loreKeeper->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1224 }
1225 return false;
1226 }
1227
1228 private:
1230 };
1231
1232 CreatureAI* GetAI(Creature* creature) const override
1233 {
1234 return GetUlduarAI<npc_brann_bronzebeard_ulduar_introAI>(creature);
1235 }
1236};
1237
1243
1245{
1246 public:
1247 npc_lorekeeper() : CreatureScript("npc_lorekeeper") { }
1248
1250 {
1251 npc_lorekeeperAI(Creature* creature) : ScriptedAI(creature)
1252 {
1253 _instance = creature->GetInstanceScript();
1254 }
1255
1256 void DoAction(int32 action) override
1257 {
1258 // Start encounter
1259 if (action == ACTION_SPAWN_VEHICLES)
1260 {
1261 for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
1263 for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
1265 for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
1267 }
1268 }
1269
1270 bool OnGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
1271 {
1272 if (menuId == GOSSIP_MENU_LORE_KEEPER && gossipListId == GOSSIP_OPTION_LORE_KEEPER)
1273 {
1276 _instance->instance->LoadGrid(364, -16); // make sure leviathan is loaded
1277
1279 {
1280 leviathan->AI()->DoAction(ACTION_START_HARD_MODE);
1281 me->SetVisible(false);
1282 DoAction(ACTION_SPAWN_VEHICLES); // spawn the vehicles
1284 {
1286 {
1287 brann->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1288 delorah->GetMotionMaster()->MovePoint(0, brann->GetPositionX() - 4, brann->GetPositionY(), brann->GetPositionZ());
1290 }
1291 }
1292 }
1293 }
1294 return false;
1295 }
1296
1297 private:
1299 };
1300
1301 CreatureAI* GetAI(Creature* creature) const override
1302 {
1303 return GetUlduarAI<npc_lorekeeperAI>(creature);
1304 }
1305};
1306
1308{
1309 public:
1310 go_ulduar_tower() : GameObjectScript("go_ulduar_tower") { }
1311
1313 {
1314 go_ulduar_towerAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
1315
1317
1318 void Destroyed(WorldObject* /*attacker*/, uint32 /*eventId*/) override
1319 {
1320 switch (me->GetEntry())
1321 {
1322 case GO_TOWER_OF_STORMS:
1324 break;
1325 case GO_TOWER_OF_FLAMES:
1327 break;
1328 case GO_TOWER_OF_FROST:
1330 break;
1331 case GO_TOWER_OF_LIFE:
1333 break;
1334 }
1335
1336 if (Creature* trigger = me->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true))
1337 trigger->DisappearAndDie();
1338 }
1339 };
1340
1341 GameObjectAI* GetAI(GameObject* go) const override
1342 {
1343 return GetUlduarAI<go_ulduar_towerAI>(go);
1344 }
1345};
1346
1348{
1349 public:
1350 achievement_three_car_garage_demolisher() : AchievementCriteriaScript("achievement_three_car_garage_demolisher") { }
1351
1352 bool OnCheck(Player* source, Unit* /*target*/) override
1353 {
1354 if (Creature* vehicle = source->GetVehicleCreatureBase())
1355 {
1356 if (vehicle->GetEntry() == VEHICLE_DEMOLISHER)
1357 return true;
1358 }
1359
1360 return false;
1361 }
1362};
1363
1365{
1366 public:
1367 achievement_three_car_garage_chopper() : AchievementCriteriaScript("achievement_three_car_garage_chopper") { }
1368
1369 bool OnCheck(Player* source, Unit* /*target*/) override
1370 {
1371 if (Creature* vehicle = source->GetVehicleCreatureBase())
1372 {
1373 if (vehicle->GetEntry() == VEHICLE_CHOPPER)
1374 return true;
1375 }
1376
1377 return false;
1378 }
1379};
1380
1382{
1383 public:
1384 achievement_three_car_garage_siege() : AchievementCriteriaScript("achievement_three_car_garage_siege") { }
1385
1386 bool OnCheck(Player* source, Unit* /*target*/) override
1387 {
1388 if (Creature* vehicle = source->GetVehicleCreatureBase())
1389 {
1390 if (vehicle->GetEntry() == VEHICLE_SIEGE)
1391 return true;
1392 }
1393
1394 return false;
1395 }
1396};
1397
1399{
1400 public:
1401 achievement_shutout() : AchievementCriteriaScript("achievement_shutout") { }
1402
1403 bool OnCheck(Player* /*source*/, Unit* target) override
1404 {
1405 if (target)
1406 if (Creature* leviathan = target->ToCreature())
1407 if (leviathan->AI()->GetData(DATA_SHUTOUT))
1408 return true;
1409
1410 return false;
1411 }
1412};
1413
1415{
1416 public:
1417 achievement_unbroken() : AchievementCriteriaScript("achievement_unbroken") { }
1418
1419 bool OnCheck(Player* /*source*/, Unit* target) override
1420 {
1421 if (target)
1422 if (InstanceScript* instance = target->GetInstanceScript())
1423 return instance->GetData(DATA_UNBROKEN) != 0;
1424
1425 return false;
1426 }
1427};
1428
1430{
1431 public:
1432 achievement_orbital_bombardment() : AchievementCriteriaScript("achievement_orbital_bombardment") { }
1433
1434 bool OnCheck(Player* /*source*/, Unit* target) override
1435 {
1436 if (!target)
1437 return false;
1438
1439 if (Creature* Leviathan = target->ToCreature())
1440 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) >= 1)
1441 return true;
1442
1443 return false;
1444 }
1445};
1446
1448{
1449 public:
1450 achievement_orbital_devastation() : AchievementCriteriaScript("achievement_orbital_devastation") { }
1451
1452 bool OnCheck(Player* /*source*/, Unit* target) override
1453 {
1454 if (!target)
1455 return false;
1456
1457 if (Creature* Leviathan = target->ToCreature())
1458 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) >= 2)
1459 return true;
1460
1461 return false;
1462 }
1463};
1464
1466{
1467 public:
1468 achievement_nuked_from_orbit() : AchievementCriteriaScript("achievement_nuked_from_orbit") { }
1469
1470 bool OnCheck(Player* /*source*/, Unit* target) override
1471 {
1472 if (!target)
1473 return false;
1474
1475 if (Creature* Leviathan = target->ToCreature())
1476 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) >= 3)
1477 return true;
1478
1479 return false;
1480 }
1481};
1482
1484{
1485 public:
1486 achievement_orbit_uary() : AchievementCriteriaScript("achievement_orbit_uary") { }
1487
1488 bool OnCheck(Player* /*source*/, Unit* target) override
1489 {
1490 if (!target)
1491 return false;
1492
1493 if (Creature* Leviathan = target->ToCreature())
1494 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) == 4)
1495 return true;
1496
1497 return false;
1498 }
1499};
1500
1501// 62399 - Overload Circuit
1503{
1505
1506 bool Validate(SpellInfo const* /*spellInfo*/) override
1507 {
1509 }
1510
1511 void PeriodicTick(AuraEffect const* /*aurEff*/)
1512 {
1513 if (!GetTarget()->GetMap()->IsDungeon() || int32(GetTarget()->GetAppliedAuras().count(GetId())) < (GetTarget()->GetMap()->Is25ManRaid() ? 4 : 2))
1514 return;
1515
1516 GetTarget()->CastSpell(nullptr, SPELL_SYSTEMS_SHUTDOWN, true);
1517 if (Unit* veh = GetTarget()->GetVehicleBase())
1518 veh->CastSpell(nullptr, SPELL_SYSTEMS_SHUTDOWN, true);
1519 }
1520
1525};
1526
1527// 62292 - Blaze
1529{
1531
1532 bool Validate(SpellInfo const* spellInfo) override
1533 {
1534 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
1535 }
1536
1537 void PeriodicTick(AuraEffect const* aurEff)
1538 {
1539 // should we use custom damage?
1540 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, true);
1541 }
1542
1547};
1548
1549// 64414 - Load into Catapult
1551{
1553 {
1555 };
1556
1557 public:
1558 spell_load_into_catapult() : SpellScriptLoader("spell_load_into_catapult") { }
1559
1588
1589 AuraScript* GetAuraScript() const override
1590 {
1592 }
1593};
1594
1595// 62705 - Auto-repair
1597{
1599 {
1601 };
1602
1603 public:
1604 spell_auto_repair() : SpellScriptLoader("spell_auto_repair") { }
1605
1607 {
1609
1611 {
1612 if (missInfo != SPELL_MISS_NONE)
1613 return;
1614
1615 if (GetHitUnit()->HasAuraEffect(SPELL_AUTO_REPAIR, EFFECT_2)) // Check presence of dummy aura indicating cooldown
1616 {
1625 //PreventHitAura();
1626 }
1627 }
1628
1630 {
1631 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
1632 if (!vehicle)
1633 return;
1634
1635 Unit* driver = vehicle->GetPassenger(0);
1636 if (!driver)
1637 return;
1638
1639 driver->TextEmote(EMOTE_REPAIR, driver, true);
1640
1641 InstanceScript* instance = driver->GetInstanceScript();
1642 if (!instance)
1643 return;
1644
1645 // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
1646 vehicle->GetBase()->SetFullHealth();
1647
1648 // For achievement
1649 instance->SetData(DATA_UNBROKEN, 0);
1650 }
1651
1657 };
1658
1659 SpellScript* GetSpellScript() const override
1660 {
1661 return new spell_auto_repair_SpellScript();
1662 }
1663};
1664
1665// 62475 - Systems Shutdown
1708
1710{
1711 enum Area
1712 {
1714 };
1715
1716 public:
1718
1719 bool operator()(WorldObject* target) const
1720 {
1722 Creature* creatureTarget = target->ToCreature();
1723 if (!creatureTarget)
1724 return false;
1725
1727 if (creatureTarget->GetEntry() != NPC_SALVAGED_DEMOLISHER && creatureTarget->GetEntry() != NPC_SALVAGED_SIEGE_ENGINE)
1728 return false;
1729
1731 Vehicle* vehicle = creatureTarget->GetVehicleKit();
1732 if (!vehicle)
1733 return false;
1734
1736 if (target->GetAreaId() != AREA_FORMATION_GROUNDS)
1737 return false;
1738
1740 for (SeatMap::const_iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end(); ++itr)
1741 if (itr->second.Passenger.Guid.IsPlayer())
1742 return true;
1743
1744 return false;
1745 }
1746};
1747
1748// 62374 - Pursued
1750{
1751 public:
1752 spell_pursue() : SpellScriptLoader("spell_pursue") { }
1753
1755 {
1757
1758 private:
1759 // EFFECT #0 - select target
1760 void FilterTargets(std::list<WorldObject*>& targets)
1761 {
1763 if (targets.empty())
1764 {
1765 if (Unit* caster = GetCaster())
1766 if (Creature* cCaster = caster->ToCreature())
1767 cCaster->AI()->EnterEvadeMode(CreatureAI::EVADE_REASON_NO_HOSTILES);
1768 }
1769 else
1770 _target = targets.front();
1771 }
1772
1773 // EFFECT #1 - copy target from effect #0
1774 void FilterTargetsSubsequently(std::list<WorldObject*>& targets)
1775 {
1776 targets.clear();
1777 if (_target)
1778 targets.push_back(_target);
1779 }
1780
1786
1788 };
1789
1790 SpellScript* GetSpellScript() const override
1791 {
1792 return new spell_pursue_SpellScript();
1793 }
1794};
1795
1796// 62324 - Throw Passenger
1798{
1799 public:
1800 spell_vehicle_throw_passenger() : SpellScriptLoader("spell_vehicle_throw_passenger") { }
1801
1803 {
1805 void HandleScript(SpellEffIndex /*effIndex*/)
1806 {
1807 Spell* baseSpell = GetSpell();
1808 SpellCastTargets targets = baseSpell->m_targets;
1809 int32 damage = GetEffectValue();
1810 if (targets.HasTraj())
1811 if (Vehicle* vehicle = GetCaster()->GetVehicleKit())
1812 if (Unit* passenger = vehicle->GetPassenger(damage - 1))
1813 {
1814 // use 99 because it is 3d search
1815 std::list<WorldObject*> targetList;
1818 Cell::VisitAllObjects(GetCaster(), searcher, 99.0f);
1819 float minDist = 99 * 99;
1820 Unit* target = nullptr;
1821 for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
1822 {
1823 if (Unit* unit = (*itr)->ToUnit())
1824 if (unit->GetEntry() == NPC_SEAT)
1825 if (Vehicle* seat = unit->GetVehicleKit())
1826 if (!seat->GetPassenger(0))
1827 if (Unit* device = seat->GetPassenger(2))
1828 if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
1829 {
1830 float dist = unit->GetExactDistSq(targets.GetDstPos());
1831 if (dist < minDist)
1832 {
1833 minDist = dist;
1834 target = unit;
1835 }
1836 }
1837 }
1838 if (target && target->IsWithinDist2d(targets.GetDstPos(), GetEffectInfo().CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
1839 passenger->EnterVehicle(target, 0);
1840 else
1841 {
1842 passenger->ExitVehicle();
1843 passenger->GetMotionMaster()->MoveJump(*targets.GetDstPos(), targets.GetSpeedXY(), targets.GetSpeedZ());
1844 }
1845 }
1846 }
1847
1852 };
1853
1854 SpellScript* GetSpellScript() const override
1855 {
1857 }
1858};
1859
@ IN_MILLISECONDS
Definition Common.h:35
uint8_t uint8
Definition Define.h:135
int8_t int8
Definition Define.h:131
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define ASSERT_NOTNULL(pointer)
Definition Errors.h:84
#define ASSERT
Definition Errors.h:68
@ POINT_MOTION_TYPE
@ TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
Spells
Definition PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ STATE_ESCORT_ESCORTING
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_SCHOOL_MASK_FIRE
@ LOOT_MODE_HARD_MODE_3
@ LOOT_MODE_HARD_MODE_1
@ LOOT_MODE_HARD_MODE_2
@ LOOT_MODE_DEFAULT
@ LOOT_MODE_HARD_MODE_4
SpellMissInfo
@ SPELL_MISS_NONE
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:79
#define BeforeSpellHitFn(F)
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraEffectRemoveFn(F, I, N, M)
@ REACT_DEFENSIVE
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_NPC_FLAG_GOSSIP
@ UNIT_NPC_FLAG_SPELLCLICK
UnitFlags
@ UNIT_FLAG_STUNNED
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_UNINTERACTIBLE
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:608
@ UNIT_STATE_ROOT
Definition Unit.h:230
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ UNIT_STATE_STUNNED
Definition Unit.h:223
DamageEffectType
Definition Unit.h:352
Creatures
@ 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
@ GOSSIP_MENU_BRANN_BRONZEBEARD
@ GOSSIP_OPTION_BRANN_BRONZEBEARD
@ DATA_ORBIT_ACHIEVEMENTS
@ SAY_PLAYER_RIDING
Position const InfernoStart
@ 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_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
@ 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_HODIR_S_FURY
Position const PosChopper[VEHICLE_SPAWNS]
Yells
SpellEffectInfo const & GetSpellEffectInfo() const
HookList< EffectPeriodicHandler > OnEffectPeriodic
WorldObject * GetOwner() const
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
HookList< EffectApplyHandler > OnEffectApply
uint32 GetId() const
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:94
Creature * DoSummonFlyer(uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
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 RemoveLootMode(uint16 lootMode)
Definition Creature.h:226
void SetDisplayId(uint32 modelId) override
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:295
bool HasReactState(ReactStates state) const
Definition Creature.h:121
bool IsEngaged() const override
void SetReactState(ReactStates st)
Definition Creature.h:119
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:186
bool HasLootMode(uint16 lootMode)
Definition Creature.h:223
void SetLootMode(uint16 lootMode)
Definition Creature.h:224
void Update(uint32 time)
Definition EventMap.h:67
void DelayEvents(Milliseconds delay)
Definition EventMap.cpp:95
EventId ExecuteEvent()
Definition EventMap.cpp:73
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:52
void CancelEvent(EventId eventId)
Definition EventMap.cpp:151
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
bool operator()(WorldObject *target) const
GameObject *const me
Creature * GetCreature(uint32 type)
InstanceMap * instance
void LoadGrid(float x, float y)
Definition Map.cpp:578
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition Map.cpp:2484
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false)
void MoveTargetedHome()
void MoveRandom(float wanderDistance=0.0f)
static ObjectGuid const Empty
Definition ObjectGuid.h:140
void Clear()
Definition ObjectGuid.h:150
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
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
void SendCloseGossip()
PlayerMenu * PlayerTalkClass
Definition Player.h:1969
bool HasTraj() const
float GetSpeedZ() const
float GetSpeedXY() const
WorldLocation const * GetDstPos() const
Definition Spell.cpp:379
uint32 TriggerSpell
Definition SpellInfo.h:228
uint32 Id
Definition SpellInfo.h:289
uint32 SchoolMask
Definition SpellInfo.h:361
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
void PreventHitEffect(SpellEffIndex effIndex)
Spell * GetSpell() const
HookList< BeforeHitHandler > BeforeHit
WorldLocation const * GetExplTargetDest() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition Spell.h:152
SpellCastTargets m_targets
Definition Spell.h:402
size_type size() const
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition Unit.cpp:12569
void ClearUnitState(uint32 f)
Definition Unit.h:877
bool IsVehicle() const
Definition Unit.h:887
Vehicle * GetVehicle() const
Definition Unit.h:1737
void SetVisible(bool x)
Definition Unit.cpp:8513
void SetFullHealth()
Definition Unit.h:927
bool IsWithinCombatRange(Unit const *obj, float dist2compare) const
Definition Unit.cpp:603
Creature * GetVehicleCreatureBase() const
Definition Unit.cpp:11847
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3093
Unit * GetVehicleBase() const
Definition Unit.cpp:11826
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:11964
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1098
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
void AddUnitState(uint32 f)
Definition Unit.h:875
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:12890
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={})
Definition Unit.cpp:3021
uint32 GetFaction() const override
Definition Unit.h:973
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition Unit.cpp:13844
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 SetUnitFlag(UnitFlags flags)
Definition Unit.h:954
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition Unit.h:835
Vehicle * GetVehicleKit() const
Definition Unit.h:1735
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition Unit.cpp:598
bool IsInCombat() const
Definition Unit.h:1144
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
bool isDead() const
Definition Unit.h:1236
Unit * GetBase() const
May be called from scripts.
Definition Vehicle.h:45
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition Vehicle.cpp:296
bool HasEmptySeat(int8 seatId) const
Checks if vehicle's seat specified by 'seatId' is empty.
Definition Vehicle.cpp:275
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Definition Vehicle.h:63
uint32 GetPhaseMask() const
Definition Object.h:368
bool IsWithinDist2d(float x, float y, float dist) const
Definition Object.cpp:1177
Map * GetMap() const
Definition Object.h:449
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
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
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2099
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
Definition Object.cpp:1283
uint32 GetAreaId() const
Definition Object.h:374
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:55
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:56
virtual void ProcessEvent(WorldObject *, uint32)
Definition ZoneScript.h:58
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
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
PrepareSpellScript(spell_auto_repair_SpellScript)
SpellScript * GetSpellScript() const override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_load_into_catapult_AuraScript)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
AuraScript * GetAuraScript() const override
void PeriodicTick(AuraEffect const *)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_overload_circuit)
void FilterTargetsSubsequently(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_pursue_SpellScript)
void FilterTargets(std::list< WorldObject * > &targets)
SpellScript * GetSpellScript() const override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_systems_shutdown_AuraScript)
AuraScript * GetAuraScript() const override
PrepareAuraScript(spell_tar_blaze)
bool Validate(SpellInfo const *spellInfo) override
void PeriodicTick(AuraEffect const *aurEff)
SpellScript * GetSpellScript() const override
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:66
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:192
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
float GetPositionZ() const
Definition Position.h:81
float GetPositionX() const
Definition Position.h:79
void GetPosition(float &x, float &y) const
Definition Position.h:84
float GetPositionY() const
Definition Position.h:80
float GetExactDistSq(float x, float y, float z) const
Definition Position.h:113
void AttackStart(Unit *) override
T const & RAID_MODE(T const &normal10, T const &normal25) const
void SpellHitTarget(WorldObject *target, SpellInfo const *spellInfo) 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 *, uint32) override
bool OnGossipSelect(Player *player, uint32 menuId, uint32 gossipListId) 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:36
@ DATA_UNBROKEN
Definition ulduar.h:494
@ DATA_DELLORAH
Definition ulduar.h:476
@ DATA_BRANN_BRONZEBEARD_INTRO
Definition ulduar.h:474
@ DATA_LORE_KEEPER_OF_NORGANNON
Definition ulduar.h:475
@ DATA_COLOSSUS
Definition ulduar.h:410
@ EVENT_TOWER_OF_STORM_DESTROYED
Definition ulduar.h:329
@ EVENT_TOWER_OF_LIFE_DESTROYED
Definition ulduar.h:332
@ EVENT_TOWER_OF_FLAMES_DESTROYED
Definition ulduar.h:331
@ EVENT_TOWER_OF_FROST_DESTROYED
Definition ulduar.h:330
@ NPC_SALVAGED_SIEGE_ENGINE
Definition ulduar.h:60
@ NPC_SALVAGED_DEMOLISHER
Definition ulduar.h:59
@ ACTION_TOWER_OF_FLAMES_DESTROYED
Definition ulduar.h:344
@ ACTION_TOWER_OF_STORM_DESTROYED
Definition ulduar.h:342
@ ACTION_MOVE_TO_CENTER_POSITION
Definition ulduar.h:346
@ ACTION_TOWER_OF_LIFE_DESTROYED
Definition ulduar.h:345
@ ACTION_TOWER_OF_FROST_DESTROYED
Definition ulduar.h:343