Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_flame_leviathan.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/*
7 * Comment: there is missing code on triggers,
8 * brann bronzebeard needs correct gossip info.
9 * requires more work involving area triggers.
10 * if reached brann speaks through his radio..
11 */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "ScriptedGossip.h"
16#include "ScriptedEscortAI.h"
17#include "Cell.h"
18#include "CellImpl.h"
19#include "GridNotifiers.h"
20#include "GridNotifiersImpl.h"
21#include "CombatAI.h"
22#include "PassiveAI.h"
23#include "ObjectMgr.h"
24#include "SpellInfo.h"
25#include "SpellScript.h"
26#include "Vehicle.h"
27#include "VehicleDefines.h"
28#include "ulduar.h"
29#include "Spell.h"
30
32{
42 SPELL_BLAZE = 62292,
46 SPELL_NAPALM = 63666,
48 //TOWER Additional SPELLS
49 SPELL_THORIM_S_HAMMER = 62911, // Tower of Storms
50 SPELL_MIMIRON_S_INFERNO = 62909, // Tower of Flames
51 SPELL_HODIR_S_FURY = 62533, // Tower of Frost
52 SPELL_FREYA_S_WARD = 62906, // Tower of Nature
53 SPELL_FREYA_SUMMONS = 62947, // Tower of Nature
54 //TOWER ap & health spells
59 //Additional Spells
60 SPELL_LASH = 65062,
72};
73
93
95{
100};
101
103{
111 EVENT_THORIM_S_HAMMER = 8, // Tower of Storms
112 EVENT_MIMIRON_S_INFERNO = 9, // Tower of Flames
113 EVENT_HODIR_S_FURY = 10, // Tower of Frost
114 EVENT_FREYA_S_WARD = 11, // Tower of Nature
115};
116
124
126{
130};
131
133{
134 DATA_SHUTOUT = 29112912, // 2911, 2912 are achievement IDs
138};
139
158
160{
161 // Other Actions are in Ulduar.h
164 // Amount of seats depending on Raid mode
167};
168
169Position const Center = { 354.8771f, -12.90240f, 409.803650f, 0.0f };
170Position const InfernoStart = { 390.93f, -13.91f, 409.81f, 0.0f };
171
173{
174 {-814.59f, -64.54f, 429.92f, 5.969f},
175 {-784.37f, -33.31f, 429.92f, 5.096f},
176 {-808.99f, -52.10f, 429.92f, 5.668f},
177 {-798.59f, -44.00f, 429.92f, 5.663f},
178 {-812.83f, -77.71f, 429.92f, 0.046f},
179};
180
182{
183 {-717.83f, -106.56f, 430.02f, 0.122f},
184 {-717.83f, -114.23f, 430.44f, 0.122f},
185 {-717.83f, -109.70f, 430.22f, 0.122f},
186 {-718.45f, -118.24f, 430.26f, 0.052f},
187 {-718.45f, -123.58f, 430.41f, 0.085f},
188};
189
191{
192 {-724.12f, -176.64f, 430.03f, 2.543f},
193 {-766.70f, -225.03f, 430.50f, 1.710f},
194 {-729.54f, -186.26f, 430.12f, 1.902f},
195 {-756.01f, -219.23f, 430.50f, 2.369f},
196 {-798.01f, -227.24f, 429.84f, 1.446f},
197};
198
200{
201 {377.02f, -119.10f, 409.81f, 0.0f},
202 {185.62f, -119.10f, 409.81f, 0.0f},
203 {377.02f, 54.78f, 409.81f, 0.0f},
204 {185.62f, 54.78f, 409.81f, 0.0f},
205};
206
208{
209 public:
210 boss_flame_leviathan() : CreatureScript("boss_flame_leviathan") { }
211
213 {
214 boss_flame_leviathanAI(Creature* creature) : BossAI(creature, BOSS_LEVIATHAN), vehicle(creature->GetVehicleKit())
215 {
216 }
217
219 {
221 if (!me->isDead())
222 Reset();
223
225 Shutdown = 0;
226 ActiveTowers = false;
227 towerOfStorms = false;
228 towerOfLife = false;
229 towerOfFlames = false;
230 towerOfFrost = false;
231 Shutout = true;
232 Unbroken = true;
233
235
237 me->SetReactState(REACT_PASSIVE);
238 }
239
250
252 {
253 _Reset();
254 //resets shutdown counter to 0. 2 or 4 depending on raid mode
255 Shutdown = 0;
256 _pursueTarget = 0;
257
258 me->SetReactState(REACT_DEFENSIVE);
259 }
260
261 void EnterCombat(Unit* /*who*/) OVERRIDE
262 {
263 _EnterCombat();
264 me->SetReactState(REACT_PASSIVE);
265 events.ScheduleEvent(EVENT_PURSUE, 1);
266 events.ScheduleEvent(EVENT_MISSILE, std::rand() % 4000 + 1500);
267 events.ScheduleEvent(EVENT_VENT, 20*IN_MILLISECONDS);
268 events.ScheduleEvent(EVENT_SHUTDOWN, 150*IN_MILLISECONDS);
269 events.ScheduleEvent(EVENT_SPEED, 15*IN_MILLISECONDS);
270 events.ScheduleEvent(EVENT_SUMMON, 1*IN_MILLISECONDS);
271 ActiveTower(); //void ActiveTower
272 }
273
275 {
276 if (ActiveTowers)
277 {
278 if (towerOfStorms)
279 {
282 }
283
284 if (towerOfFlames)
285 {
288 }
289
290 if (towerOfFrost)
291 {
293 events.ScheduleEvent(EVENT_HODIR_S_FURY, 105*IN_MILLISECONDS);
294 }
295
296 if (towerOfLife)
297 {
298 me->AddAura(SPELL_BUFF_TOWER_OF_LIFE, me);
299 events.ScheduleEvent(EVENT_FREYA_S_WARD, 140*IN_MILLISECONDS);
300 }
301
304 else
306 }
307 else
309 }
310
311 void JustDied(Unit* /*killer*/) OVERRIDE
312 {
313 _JustDied();
314 // Set Field Flags 67108928 = 64 | 67108864 = UNIT_FLAG_UNK_6 | UNIT_FLAG_SKINNABLE
315 // Set DynFlags 12
316 // Set NPCFlags 0
318 }
319
320 void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE
321 {
322 if (spell->Id == SPELL_START_THE_ENGINE)
323 vehicle->InstallAllAccessories(false);
324
325 if (spell->Id == SPELL_ELECTROSHOCK)
326 me->InterruptSpell(CURRENT_CHANNELED_SPELL);
327
328 if (spell->Id == SPELL_OVERLOAD_CIRCUIT)
329 ++Shutdown;
330 }
331
333 {
334 switch (type)
335 {
336 case DATA_SHUTOUT:
337 return Shutout ? 1 : 0;
338 case DATA_UNBROKEN:
339 return Unbroken ? 1 : 0;
341 if (ActiveTowers) // Only on HardMode
342 return ActiveTowersCount;
343 default:
344 break;
345 }
346
347 return 0;
348 }
349
351 {
352 if (id == DATA_UNBROKEN)
353 Unbroken = data ? true : false;
354 }
355
357 {
358 if (!UpdateVictim() || !CheckInRoom())
359 return;
360
361 events.Update(diff);
362
364 {
365 Shutdown = 0;
366 events.ScheduleEvent(EVENT_SHUTDOWN, 4000);
367 me->RemoveAurasDueToSpell(SPELL_OVERLOAD_CIRCUIT);
368 me->InterruptNonMeleeSpells(true);
369 return;
370 }
371
372 if (me->HasUnitState(UNIT_STATE_CASTING))
373 return;
374
375 while (uint32 eventId = events.ExecuteEvent())
376 {
377 switch (eventId)
378 {
379 case EVENT_PURSUE:
381 DoCast(SPELL_PURSUED); // Will select target in spellscript
382 events.ScheduleEvent(EVENT_PURSUE, 35*IN_MILLISECONDS);
383 break;
384 case EVENT_MISSILE:
386 events.ScheduleEvent(EVENT_MISSILE, 2*IN_MILLISECONDS);
387 break;
388 case EVENT_VENT:
390 events.ScheduleEvent(EVENT_VENT, 20*IN_MILLISECONDS);
391 break;
392 case EVENT_SPEED:
394 events.ScheduleEvent(EVENT_SPEED, 15*IN_MILLISECONDS);
395 break;
396 case EVENT_SUMMON:
397 if (summons.size() < 15)
398 if (Creature* lift = DoSummonFlyer(NPC_MECHANOLIFT, me, 30.0f, 50.0f, 0))
399 lift->GetMotionMaster()->MoveRandom(100);
400 events.ScheduleEvent(EVENT_SUMMON, 2*IN_MILLISECONDS);
401 break;
402 case EVENT_SHUTDOWN:
405 me->CastSpell(me, SPELL_SYSTEMS_SHUTDOWN, true);
406 if (Shutout)
407 Shutout = false;
408 events.ScheduleEvent(EVENT_REPAIR, 4000);
409 events.DelayEvents(20 * IN_MILLISECONDS, 0);
410 break;
411 case EVENT_REPAIR:
413 me->ClearUnitState(UNIT_STATE_STUNNED | UNIT_STATE_ROOT);
414 events.ScheduleEvent(EVENT_SHUTDOWN, 150*IN_MILLISECONDS);
415 events.CancelEvent(EVENT_REPAIR);
416 break;
417 case EVENT_THORIM_S_HAMMER: // Tower of Storms
418 for (uint8 i = 0; i < 7; ++i)
419 {
420 if (Creature* thorim = DoSummon(NPC_THORIM_BEACON, me, float(std::rand() % 60 + 20), 20000, TempSummonType::TEMPSUMMON_TIMED_DESPAWN))
421 thorim->GetMotionMaster()->MoveRandom(100);
422 }
424 events.CancelEvent(EVENT_THORIM_S_HAMMER);
425 break;
426 case EVENT_MIMIRON_S_INFERNO: // Tower of Flames
427 me->SummonCreature(NPC_MIMIRON_BEACON, InfernoStart);
429 events.CancelEvent(EVENT_MIMIRON_S_INFERNO);
430 break;
431 case EVENT_HODIR_S_FURY: // Tower of Frost
432 for (uint8 i = 0; i < 7; ++i)
433 {
434 if (Creature* hodir = DoSummon(NPC_HODIR_BEACON, me, 50, 0))
435 hodir->GetMotionMaster()->MoveRandom(100);
436 }
438 events.CancelEvent(EVENT_HODIR_S_FURY);
439 break;
440 case EVENT_FREYA_S_WARD: // Tower of Nature
442 for (int32 i = 0; i < 4; ++i)
443 me->SummonCreature(NPC_FREYA_BEACON, FreyaBeacons[i]);
444
446 DoCast(target, SPELL_FREYA_S_WARD);
447 events.CancelEvent(EVENT_FREYA_S_WARD);
448 break;
449 }
450 }
451
453 }
454
455 void SpellHitTarget(Unit* target, SpellInfo const* spell) OVERRIDE
456 {
457 if (spell->Id == SPELL_PURSUED)
458 _pursueTarget = target->GetGUID();
459 }
460
462 {
463 if (action && action <= 4) // Tower destruction, debuff leviathan loot and reduce active tower count
464 {
466 {
467 me->RemoveLootMode(LOOT_MODE_HARD_MODE_4);
469 }
471 {
472 me->RemoveLootMode(LOOT_MODE_HARD_MODE_3);
474 }
476 {
477 me->RemoveLootMode(LOOT_MODE_HARD_MODE_2);
479 }
481 {
482 me->RemoveLootMode(LOOT_MODE_HARD_MODE_1);
484 }
485 }
486
487 switch (action)
488 {
490 towerOfStorms = false;
491 break;
493 towerOfFrost = false;
494 break;
496 towerOfFlames = false;
497 break;
499 towerOfLife = false;
500 break;
501 case ACTION_START_HARD_MODE: // Activate hard-mode enable all towers, apply buffs on leviathan
502 ActiveTowers = true;
503 towerOfStorms = true;
504 towerOfLife = true;
505 towerOfFlames = true;
506 towerOfFrost = true;
508 break;
509 case ACTION_MOVE_TO_CENTER_POSITION: // Triggered by 2 Collossus near door
510 if (!me->isDead())
511 {
512 me->SetHomePosition(Center);
513 me->GetMotionMaster()->MoveCharge(Center.GetPositionX(), Center.GetPositionY(), Center.GetPositionZ()); // position center
514 me->SetReactState(REACT_AGGRESSIVE);
516 return;
517 }
518 break;
519 default:
520 break;
521 }
522 }
523
524 private:
528 {
529 if (me->isAttackReady())
530 {
532 if (me->IsWithinCombatRange(target, 30.0f))
533 {
535 me->resetAttackTimer();
536 }
537 }
538 }
539
541 };
542
544 {
546 }
547};
548
550{
551 public:
552 boss_flame_leviathan_seat() : CreatureScript("boss_flame_leviathan_seat") { }
553
555 {
556 boss_flame_leviathan_seatAI(Creature* creature) : ScriptedAI(creature), vehicle(creature->GetVehicleKit())
557 {
559 me->SetReactState(REACT_PASSIVE);
560 me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
561 instance = creature->GetInstanceScript();
562 }
563
566
567 void PassengerBoarded(Unit* who, int8 seatId, bool apply) OVERRIDE
568 {
569 if (!me->GetVehicle())
570 return;
571
572 if (seatId == SEAT_PLAYER)
573 {
574 if (!apply)
575 return;
576 else if (Creature* leviathan = me->GetVehicleCreatureBase())
577 leviathan->AI()->Talk(SAY_PLAYER_RIDING);
578
579 if (Creature* turret = me->GetVehicleKit()->GetPassenger(SEAT_TURRET)->ToCreature())
580 {
581 turret->setFaction(me->GetVehicleBase()->getFaction());
582 turret->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable
583 turret->AI()->AttackStart(who);
584 }
585 if (Creature* device = me->GetVehicleKit()->GetPassenger(SEAT_DEVICE)->ToCreature())
586 {
588 device->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
589 }
590
592 }
593 else if (seatId == SEAT_TURRET)
594 {
595 if (apply)
596 return;
597
598 if (Unit* device = vehicle->GetPassenger(SEAT_DEVICE))
599 {
601 device->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable
602 }
603 }
604 }
605 };
606
608 {
609 return new boss_flame_leviathan_seatAI(creature);
610 }
611};
612
614{
615 public:
616 boss_flame_leviathan_defense_cannon() : CreatureScript("boss_flame_leviathan_defense_cannon") { }
617
619 {
623
625
631
633 {
634 if (!UpdateVictim())
635 return;
636
637 if (NapalmTimer <= diff)
638 {
639 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
640 if (CanAIAttack(target))
641 DoCast(target, SPELL_NAPALM, true);
642
643 NapalmTimer = 5000;
644 }
645 else
646 NapalmTimer -= diff;
647 }
648
649 bool CanAIAttack(Unit const* who) const OVERRIDE
650 {
651 if (who->GetTypeId() != TypeID::TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() == NPC_SEAT)
652 return false;
653 return true;
654 }
655 };
656
658 {
659 return new boss_flame_leviathan_defense_cannonAI(creature);
660 }
661};
662
664{
665 public:
666 boss_flame_leviathan_defense_turret() : CreatureScript("boss_flame_leviathan_defense_turret") { }
667
669 {
671
672 void DamageTaken(Unit* who, uint32 &damage) OVERRIDE
673 {
674 if (!CanAIAttack(who))
675 damage = 0;
676 }
677
678 bool CanAIAttack(Unit const* who) const OVERRIDE
679 {
680 if (who->GetTypeId() != TypeID::TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() != NPC_SEAT)
681 return false;
682 return true;
683 }
684 };
685
687 {
688 return new boss_flame_leviathan_defense_turretAI(creature);
689 }
690};
691
693{
694 public:
695 boss_flame_leviathan_overload_device() : CreatureScript("boss_flame_leviathan_overload_device") { }
696
698 {
702
703 void OnSpellClick(Unit* /*clicker*/, bool& result) OVERRIDE
704 {
705 if (!result)
706 return;
707
708 if (me->GetVehicle())
709 {
712
713 if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
714 {
715 me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
716 player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30);
717 player->ExitVehicle();
718 }
719 }
720 }
721 };
722
724 {
725 return new boss_flame_leviathan_overload_deviceAI(creature);
726 }
727};
728
730{
731 public:
732 boss_flame_leviathan_safety_container() : CreatureScript("boss_flame_leviathan_safety_container") { }
733
735 {
739
740 void JustDied(Unit* /*killer*/) OVERRIDE
741 {
742 float x, y, z;
743 me->GetPosition(x, y, z);
744 z = me->GetMap()->GetHeight(me->GetPhaseMask(), x, y, z);
745 me->GetMotionMaster()->MovePoint(0, x, y, z);
746 me->SetPosition(x, y, z, 0);
747 }
748
749 void UpdateAI(uint32 /*diff*/) OVERRIDE
750 {
751 }
752 };
753
755 {
756 return new boss_flame_leviathan_safety_containerAI(creature);
757 }
758};
759
761{
762 public:
763 npc_mechanolift() : CreatureScript("npc_mechanolift") { }
764
766 {
767 npc_mechanoliftAI(Creature* creature) : PassiveAI(creature)
768 {
769 ASSERT(me->GetVehicleKit());
770 }
771
773
775 {
776 MoveTimer = 0;
777 me->GetMotionMaster()->MoveRandom(50);
778 }
779
780 void JustDied(Unit* /*killer*/) OVERRIDE
781 {
782 me->GetMotionMaster()->MoveTargetedHome();
784 Creature* liquid = DoSummon(NPC_LIQUID, me, 0);
785 if (liquid)
786 {
787 liquid->CastSpell(liquid, SPELL_LIQUID_PYRITE, true);
788 liquid->CastSpell(liquid, SPELL_DUST_CLOUD_IMPACT, true);
789 }
790 }
791
793 {
794 if (type == POINT_MOTION_TYPE && id == 1)
795 if (Creature* container = me->FindNearestCreature(NPC_CONTAINER, 5, true))
796 container->EnterVehicle(me);
797 }
798
800 {
801 if (MoveTimer <= diff)
802 {
803 if (me->GetVehicleKit()->HasEmptySeat(-1))
804 {
805 Creature* container = me->FindNearestCreature(NPC_CONTAINER, 50, true);
806 if (container && !container->GetVehicle())
807 me->GetMotionMaster()->MovePoint(1, container->GetPositionX(), container->GetPositionY(), container->GetPositionZ());
808 }
809
810 MoveTimer = 30000; //check next 30 seconds
811 }
812 else
813 MoveTimer -= diff;
814 }
815 };
816
818 {
819 return new npc_mechanoliftAI(creature);
820 }
821};
822
824{
825 public:
826 npc_pool_of_tar() : CreatureScript("npc_pool_of_tar") { }
827
829 {
830 npc_pool_of_tarAI(Creature* creature) : ScriptedAI(creature)
831 {
833 me->SetReactState(REACT_PASSIVE);
834 me->CastSpell(me, SPELL_TAR_PASSIVE, true);
835 }
836
837 void DamageTaken(Unit* /*who*/, uint32& damage) OVERRIDE
838 {
839 damage = 0;
840 }
841
842 void SpellHit(Unit* /*caster*/, SpellInfo const* spell) OVERRIDE
843 {
844 if (spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !me->HasAura(SPELL_BLAZE))
845 me->CastSpell(me, SPELL_BLAZE, true);
846 }
847
848 void UpdateAI(uint32 /*diff*/) OVERRIDE { }
849 };
850
852 {
853 return new npc_pool_of_tarAI(creature);
854 }
855};
856
858{
859 public:
860 npc_colossus() : CreatureScript("npc_colossus") { }
861
863 {
864 npc_colossusAI(Creature* creature) : ScriptedAI(creature)
865 {
866 instance = creature->GetInstanceScript();
867 }
868
870
871 void JustDied(Unit* /*killer*/) OVERRIDE
872 {
873 if (me->GetHomePosition().IsInDist(&Center, 50.f))
874 instance->SetData(DATA_COLOSSUS, instance->GetData(DATA_COLOSSUS)+1);
875 }
876
877 void UpdateAI(uint32 /*diff*/) OVERRIDE
878 {
879 if (!UpdateVictim())
880 return;
881
883 }
884 };
885
887 {
888 return new npc_colossusAI(creature);
889 }
890};
891
893{
894 public:
895 npc_thorims_hammer() : CreatureScript("npc_thorims_hammer") { }
896
898 {
900 {
902 me->CastSpell(me, AURA_DUMMY_BLUE, true);
903 }
904
906
907 {
908 if (who->GetTypeId() == TypeID::TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who, 0, 10, false))
909 {
911 trigger->CastSpell(who, SPELL_THORIM_S_HAMMER, true);
912 }
913 }
914
915 void UpdateAI(uint32 /*diff*/) OVERRIDE
916 {
917 if (!me->HasAura(AURA_DUMMY_BLUE))
918 me->CastSpell(me, AURA_DUMMY_BLUE, true);
919
920 UpdateVictim();
921 }
922 };
923
925 {
926 return new npc_thorims_hammerAI(creature);
927 }
928};
929
931{
932public:
933 npc_mimirons_inferno() : CreatureScript("npc_mimirons_inferno") { }
934
936 {
937 return new npc_mimirons_infernoAI(creature);
938 }
939
941 {
943 {
945 me->CastSpell(me, AURA_DUMMY_YELLOW, true);
946 me->SetReactState(REACT_PASSIVE);
947 }
948
949 void WaypointReached(uint32 /*waypointId*/) OVERRIDE { }
950
952 {
953 infernoTimer = 2000;
954 }
955
957
959 {
961
963 Start(false, true, 0, NULL, false, true);
964 else
965 {
966 if (infernoTimer <= diff)
967 {
969 {
970 trigger->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), SPELL_MIMIRON_S_INFERNO, true);
971 infernoTimer = 2000;
972 }
973 }
974 else
975 infernoTimer -= diff;
976
977 if (!me->HasAura(AURA_DUMMY_YELLOW))
978 me->CastSpell(me, AURA_DUMMY_YELLOW, true);
979 }
980 }
981 };
982};
983
985{
986 public:
987 npc_hodirs_fury() : CreatureScript("npc_hodirs_fury") { }
988
990 {
991 npc_hodirs_furyAI(Creature* creature) : ScriptedAI(creature)
992 {
994 me->CastSpell(me, AURA_DUMMY_GREEN, true);
995 }
996
998
999 {
1000 if (who->GetTypeId() == TypeID::TYPEID_PLAYER && who->IsVehicle() && me->IsInRange(who, 0, 5, false))
1001 {
1003 trigger->CastSpell(who, SPELL_HODIR_S_FURY, true);
1004 }
1005 }
1006
1007 void UpdateAI(uint32 /*diff*/) OVERRIDE
1008 {
1009 if (!me->HasAura(AURA_DUMMY_GREEN))
1010 me->CastSpell(me, AURA_DUMMY_GREEN, true);
1011
1012 UpdateVictim();
1013 }
1014 };
1015
1017 {
1018 return new npc_hodirs_furyAI(creature);
1019 }
1020};
1021
1023{
1024 public:
1025 npc_freyas_ward() : CreatureScript("npc_freyas_ward") { }
1026
1028 {
1030 {
1031 me->CastSpell(me, AURA_DUMMY_GREEN, true);
1032 }
1033
1035
1037 {
1038 summonTimer = 5000;
1039 }
1040
1042 {
1043 if (summonTimer <= diff)
1044 {
1047 summonTimer = 20000;
1048 }
1049 else
1050 summonTimer -= diff;
1051
1052 if (!me->HasAura(AURA_DUMMY_GREEN))
1053 me->CastSpell(me, AURA_DUMMY_GREEN, true);
1054
1055 UpdateVictim();
1056 }
1057 };
1058
1060 {
1061 return new npc_freyas_wardAI(creature);
1062 }
1063};
1064
1066{
1067 public:
1068 npc_freya_ward_summon() : CreatureScript("npc_freya_ward_summon") { }
1069
1071 {
1073 {
1074 creature->GetMotionMaster()->MoveRandom(100);
1075 }
1076
1078
1080 {
1081 lashTimer = 5000;
1082 }
1083
1085 {
1086 if (!UpdateVictim())
1087 return;
1088
1089 if (lashTimer <= diff)
1090 {
1092 lashTimer = 20000;
1093 }
1094 else
1095 lashTimer -= diff;
1096
1098 }
1099 };
1100
1102 {
1103 return new npc_freya_ward_summonAI(creature);
1104 }
1105};
1106
1107//npc lore keeper
1108#define GOSSIP_ITEM_1 "Activate secondary defensive systems"
1109#define GOSSIP_ITEM_2 "Confirmed"
1110
1112{
1113 public:
1114 npc_lorekeeper() : CreatureScript("npc_lorekeeper") { }
1115
1117 {
1118 npc_lorekeeperAI(Creature* creature) : ScriptedAI(creature)
1119 {
1120 }
1121
1123 {
1124 // Start encounter
1125 if (action == ACTION_SPAWN_VEHICLES)
1126 {
1127 for (int32 i = 0; i < RAID_MODE(2, 5); ++i)
1129 for (int32 i = 0; i < RAID_MODE(2, 5); ++i)
1131 for (int32 i = 0; i < RAID_MODE(2, 5); ++i)
1133 return;
1134 }
1135 }
1136 };
1137
1138 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
1139 {
1140 player->CLOSE_GOSSIP_MENU();
1141 InstanceScript* instance = creature->GetInstanceScript();
1142 if (!instance)
1143 return true;
1144
1145 switch (action)
1146 {
1148 player->PrepareGossipMenu(creature);
1149 instance->instance->LoadGrid(364, -16); //make sure leviathan is loaded
1150
1152 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1153 break;
1155 if (Creature* leviathan = instance->instance->GetCreature(instance->GetData64(BOSS_LEVIATHAN)))
1156 {
1157 leviathan->AI()->DoAction(ACTION_START_HARD_MODE);
1158 creature->SetVisible(false);
1159 creature->AI()->DoAction(ACTION_SPAWN_VEHICLES); // spawn the vehicles
1160 if (Creature* Delorah = creature->FindNearestCreature(NPC_DELORAH, 1000, true))
1161 {
1162 if (Creature* Branz = creature->FindNearestCreature(NPC_BRANZ_BRONZBEARD, 1000, true))
1163 {
1164 Delorah->GetMotionMaster()->MovePoint(0, Branz->GetPositionX()-4, Branz->GetPositionY(), Branz->GetPositionZ());
1166 }
1167 }
1168 }
1169 break;
1170 }
1171
1172 return true;
1173 }
1174
1175 bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
1176 {
1177 InstanceScript* instance = creature->GetInstanceScript();
1178 if (instance && instance->GetData(BOSS_LEVIATHAN) !=DONE && player)
1179 {
1180 player->PrepareGossipMenu(creature);
1181
1183 player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1184 }
1185 return true;
1186 }
1187
1189 {
1190 return new npc_lorekeeperAI(creature);
1191 }
1192};
1193
1194//enable hardmode
1196//#define GOSSIP_ITEM_1 "xxxxx"
1197//#define GOSSIP_ITEM_2 "xxxxx"
1198//
1199/*
1200class npc_brann_bronzebeard : public CreatureScript
1201{
1202public:
1203 npc_brann_bronzebeard() : CreatureScript("npc_brann_bronzebeard") { }
1204
1205 //bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) OVERRIDE
1206 //{
1207 // player->PlayerTalkClass->ClearMenus();
1208 // switch (action)
1209 // {
1210 // case GOSSIP_ACTION_INFO_DEF+1:
1211 // if (player)
1212 // {
1213 // player->PrepareGossipMenu(creature);
1214 //
1215 // player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
1216 // player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1217 // }
1218 // break;
1219 // case GOSSIP_ACTION_INFO_DEF+2:
1220 // if (player)
1221 // player->CLOSE_GOSSIP_MENU();
1222 // if (Creature* Lorekeeper = creature->FindNearestCreature(NPC_LOREKEEPER, 1000, true)) //lore keeper of lorgannon
1223 // Lorekeeper->RemoveFlag(UNIT_FIELD_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
1224 // break;
1225 // }
1226 // return true;
1227 //}
1228 //bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
1229 //{
1230 // InstanceScript* instance = creature->GetInstanceScript();
1231 // if (instance && instance->GetData(BOSS_LEVIATHAN) !=DONE)
1232 // {
1233 // player->PrepareGossipMenu(creature);
1234 //
1235 // player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
1236 // player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
1237 // }
1238 // return true;
1239 //}
1240 //
1241}
1242*/
1243
1245{
1246 public:
1247 go_ulduar_tower() : GameObjectScript("go_ulduar_tower") { }
1248
1249 void OnDestroyed(GameObject* go, Player* /*player*/) OVERRIDE
1250 {
1251 InstanceScript* instance = go->GetInstanceScript();
1252 if (!instance)
1253 return;
1254
1255 switch (go->GetEntry())
1256 {
1257 case GO_TOWER_OF_STORMS:
1259 break;
1260 case GO_TOWER_OF_FLAMES:
1262 break;
1263 case GO_TOWER_OF_FROST:
1265 break;
1266 case GO_TOWER_OF_LIFE:
1268 break;
1269 }
1270
1271 Creature* trigger = go->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true);
1272 if (trigger)
1273 trigger->DisappearAndDie();
1274 }
1275};
1276
1278{
1279 public:
1280 achievement_three_car_garage_demolisher() : AchievementCriteriaScript("achievement_three_car_garage_demolisher") { }
1281
1282 bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE
1283 {
1284 if (Creature* vehicle = source->GetVehicleCreatureBase())
1285 {
1286 if (vehicle->GetEntry() == VEHICLE_DEMOLISHER)
1287 return true;
1288 }
1289
1290 return false;
1291 }
1292};
1293
1295{
1296 public:
1297 achievement_three_car_garage_chopper() : AchievementCriteriaScript("achievement_three_car_garage_chopper") { }
1298
1299 bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE
1300 {
1301 if (Creature* vehicle = source->GetVehicleCreatureBase())
1302 {
1303 if (vehicle->GetEntry() == VEHICLE_CHOPPER)
1304 return true;
1305 }
1306
1307 return false;
1308 }
1309};
1310
1312{
1313 public:
1314 achievement_three_car_garage_siege() : AchievementCriteriaScript("achievement_three_car_garage_siege") { }
1315
1316 bool OnCheck(Player* source, Unit* /*target*/) OVERRIDE
1317 {
1318 if (Creature* vehicle = source->GetVehicleCreatureBase())
1319 {
1320 if (vehicle->GetEntry() == VEHICLE_SIEGE)
1321 return true;
1322 }
1323
1324 return false;
1325 }
1326};
1327
1329{
1330 public:
1331 achievement_shutout() : AchievementCriteriaScript("achievement_shutout") { }
1332
1333 bool OnCheck(Player* /*source*/, Unit* target) OVERRIDE
1334 {
1335 if (target)
1336 if (Creature* leviathan = target->ToCreature())
1337 if (leviathan->AI()->GetData(DATA_SHUTOUT))
1338 return true;
1339
1340 return false;
1341 }
1342};
1343
1345{
1346 public:
1347 achievement_unbroken() : AchievementCriteriaScript("achievement_unbroken") { }
1348
1349 bool OnCheck(Player* /*source*/, Unit* target) OVERRIDE
1350 {
1351 if (target)
1352 if (InstanceScript* instance = target->GetInstanceScript())
1353 return instance->GetData(DATA_UNBROKEN);
1354
1355 return false;
1356 }
1357};
1358
1360{
1361 public:
1362 achievement_orbital_bombardment() : AchievementCriteriaScript("achievement_orbital_bombardment") { }
1363
1364 bool OnCheck(Player* /*source*/, Unit* target) OVERRIDE
1365 {
1366 if (!target)
1367 return false;
1368
1369 if (Creature* Leviathan = target->ToCreature())
1370 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) >= 1)
1371 return true;
1372
1373 return false;
1374 }
1375};
1376
1378{
1379 public:
1380 achievement_orbital_devastation() : AchievementCriteriaScript("achievement_orbital_devastation") { }
1381
1382 bool OnCheck(Player* /*source*/, Unit* target) OVERRIDE
1383 {
1384 if (!target)
1385 return false;
1386
1387 if (Creature* Leviathan = target->ToCreature())
1388 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) >= 2)
1389 return true;
1390
1391 return false;
1392 }
1393};
1394
1396{
1397 public:
1398 achievement_nuked_from_orbit() : AchievementCriteriaScript("achievement_nuked_from_orbit") { }
1399
1400 bool OnCheck(Player* /*source*/, Unit* target) OVERRIDE
1401 {
1402 if (!target)
1403 return false;
1404
1405 if (Creature* Leviathan = target->ToCreature())
1406 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) >= 3)
1407 return true;
1408
1409 return false;
1410 }
1411};
1412
1414{
1415 public:
1416 achievement_orbit_uary() : AchievementCriteriaScript("achievement_orbit_uary") { }
1417
1418 bool OnCheck(Player* /*source*/, Unit* target) OVERRIDE
1419 {
1420 if (!target)
1421 return false;
1422
1423 if (Creature* Leviathan = target->ToCreature())
1424 if (Leviathan->AI()->GetData(DATA_ORBIT_ACHIEVEMENTS) == 4)
1425 return true;
1426
1427 return false;
1428 }
1429};
1430
1432{
1434 {
1436 };
1437
1438 public:
1439 spell_load_into_catapult() : SpellScriptLoader("spell_load_into_catapult") { }
1440
1469
1474};
1475
1477{
1479 {
1481 };
1482
1483 public:
1484 spell_auto_repair() : SpellScriptLoader("spell_auto_repair") { }
1485
1487 {
1489
1491 {
1492 if (GetHitUnit()->HasAuraEffect(SPELL_AUTO_REPAIR, EFFECT_2)) // Check presence of dummy aura indicating cooldown
1493 {
1502 //PreventHitAura();
1503 }
1504 }
1505
1507 {
1508 Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
1509 if (!vehicle)
1510 return;
1511
1512 Player* driver = vehicle->GetPassenger(0) ? vehicle->GetPassenger(0)->ToPlayer() : NULL;
1513 if (!driver)
1514 return;
1515
1516 driver->MonsterTextEmote(EMOTE_REPAIR, driver, true);
1517
1518 InstanceScript* instance = driver->GetInstanceScript();
1519 if (!instance)
1520 return;
1521
1522 // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
1523 vehicle->GetBase()->SetFullHealth();
1524
1525 // For achievement
1526 instance->SetData(DATA_UNBROKEN, 0);
1527 }
1528
1534 };
1535
1537 {
1538 return new spell_auto_repair_SpellScript();
1539 }
1540};
1541
1584
1586{
1587 enum Area
1588 {
1590 };
1591
1592 public:
1593 explicit FlameLeviathanPursuedTargetSelector(Unit* unit) : _me(unit) { };
1594
1595 bool operator()(WorldObject* target) const
1596 {
1598 Creature* creatureTarget = target->ToCreature();
1599 if (!creatureTarget)
1600 return true;
1601
1603 if (creatureTarget->GetEntry() != NPC_SALVAGED_DEMOLISHER && creatureTarget->GetEntry() != NPC_SALVAGED_SIEGE_ENGINE)
1604 return true;
1605
1607 Vehicle* vehicle = creatureTarget->GetVehicleKit();
1608 if (!vehicle)
1609 return true;
1610
1612 if (target->GetAreaId() != AREA_FORMATION_GROUNDS)
1613 return true;
1614
1616 bool playerFound = false;
1617 for (SeatMap::const_iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end() && !playerFound; ++itr)
1618 if (IS_PLAYER_GUID(itr->second.Passenger.Guid))
1619 playerFound = true;
1620
1621 return !playerFound;
1622 }
1623
1624 private:
1625 Unit const* _me;
1626};
1627
1629{
1630 public:
1631 spell_pursue() : SpellScriptLoader("spell_pursue") { }
1632
1634 {
1636
1638 {
1639 _target = NULL;
1640 return true;
1641 }
1642
1643 void FilterTargets(std::list<WorldObject*>& targets)
1644 {
1645 targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster()));
1646 if (targets.empty())
1647 {
1648 if (Creature* caster = GetCaster()->ToCreature())
1649 caster->AI()->EnterEvadeMode();
1650 }
1651 else
1652 {
1656 }
1657 }
1658
1659 void FilterTargetsSubsequently(std::list<WorldObject*>& targets)
1660 {
1661 targets.clear();
1662 if (_target)
1663 targets.push_back(_target);
1664 }
1665
1667 {
1668 Creature* caster = GetCaster()->ToCreature();
1669 if (!caster)
1670 return;
1671
1672 caster->AI()->AttackStart(GetHitUnit()); // Chase target
1673
1674 for (SeatMap::const_iterator itr = caster->GetVehicleKit()->Seats.begin(); itr != caster->GetVehicleKit()->Seats.end(); ++itr)
1675 {
1676 if (IS_PLAYER_GUID(itr->second.Passenger.Guid))
1677 {
1678 caster->AI()->Talk(EMOTE_PURSUE, sObjectAccessor->GetWorldObject(*caster, itr->second.Passenger.Guid));
1679 return;
1680 }
1681 }
1682 }
1683
1690
1692 };
1693
1695 {
1696 return new spell_pursue_SpellScript();
1697 }
1698};
1699
1701{
1702 public:
1703 spell_vehicle_throw_passenger() : SpellScriptLoader("spell_vehicle_throw_passenger") { }
1704
1706 {
1709 {
1710 Spell* baseSpell = GetSpell();
1711 SpellCastTargets targets = baseSpell->m_targets;
1712 int32 damage = GetEffectValue();
1713 if (targets.HasTraj())
1714 if (Vehicle* vehicle = GetCaster()->GetVehicleKit())
1715 if (Unit* passenger = vehicle->GetPassenger(damage - 1))
1716 {
1717 // use 99 because it is 3d search
1718 std::list<WorldObject*> targetList;
1721 GetCaster()->GetMap()->VisitAll(GetCaster()->m_positionX, GetCaster()->m_positionY, 99, searcher);
1722 float minDist = 99 * 99;
1723 Unit* target = NULL;
1724 for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
1725 {
1726 if (Unit* unit = (*itr)->ToUnit())
1727 if (unit->GetEntry() == NPC_SEAT)
1728 if (Vehicle* seat = unit->GetVehicleKit())
1729 if (!seat->GetPassenger(0))
1730 if (Unit* device = seat->GetPassenger(2))
1731 if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
1732 {
1733 float dist = unit->GetExactDistSq(targets.GetDstPos());
1734 if (dist < minDist)
1735 {
1736 minDist = dist;
1737 target = unit;
1738 }
1739 }
1740 }
1741 if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
1742 passenger->EnterVehicle(target, 0);
1743 else
1744 {
1745 passenger->ExitVehicle();
1746 float x, y, z;
1747 targets.GetDstPos()->GetPosition(x, y, z);
1748 passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ());
1749 }
1750 }
1751 }
1752
1757 };
1758
1763};
1764
@ IN_MILLISECONDS
Definition Common.h:125
std::int32_t int32
Definition Define.h:73
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
std::int8_t int8
Definition Define.h:75
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
#define ASSERT
Definition Errors.h:29
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:46
@ DONE
@ POINT_MOTION_TYPE
@ TYPEID_PLAYER
Definition Object.h:55
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:73
#define sObjectAccessor
bool IS_PLAYER_GUID(uint64 guid)
@ STATE_ESCORT_ESCORTING
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_APPLY_AURA
@ TARGET_UNIT_SRC_AREA_ENEMY
@ LOOT_MODE_HARD_MODE_3
@ LOOT_MODE_HARD_MODE_1
@ LOOT_MODE_HARD_MODE_2
@ LOOT_MODE_DEFAULT
@ LOOT_MODE_HARD_MODE_4
@ SPELL_SCHOOL_MASK_FIRE
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAL
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ TARGET_CHECK_DEFAULT
@ UNIT_NPC_FLAG_SPELLCLICK
Definition Unit.h:711
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:1110
@ UNIT_STATE_ROOT
Definition Unit.h:522
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ UNIT_STATE_STUNNED
Definition Unit.h:515
@ REACT_DEFENSIVE
Definition Unit.h:1157
@ REACT_PASSIVE
Definition Unit.h:1156
@ REACT_AGGRESSIVE
Definition Unit.h:1158
@ UNIT_FLAG_STUNNED
Definition Unit.h:643
@ UNIT_FLAG_NON_ATTACKABLE
Definition Unit.h:626
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ UNIT_FIELD_NPC_FLAGS
@ UNIT_FIELD_FLAGS
Creatures
@ SAY_SLAY
@ SPELL_LASH
@ SPELL_GATHERING_SPEED
Definition boss_buru.cpp:19
#define SAY_DEATH
#define SAY_AGGRO
@ SPELL_BLAZE
@ 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_BRANZ_BRONZBEARD
@ NPC_THORIM_BEACON
@ NPC_FREYA_BEACON
@ NPC_HODIR_BEACON
@ NPC_THORIM_TARGET_BEACON
@ NPC_ULDUAR_GAUNTLET_GENERATOR
@ NPC_MECHANOLIFT
@ NPC_MIMIRON_TARGET_BEACON
#define GOSSIP_ITEM_2
@ DATA_ORBIT_ACHIEVEMENTS
@ SAY_PLAYER_RIDING
Position const InfernoStart
@ VEHICLE_DEMOLISHER
#define GOSSIP_ITEM_1
@ 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_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
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]
@ EVENT_SUMMON
@ SAY_OVERLOAD
AchievementCriteriaScript(const char *name)
WorldObject * GetOwner() const
HookList< EffectApplyHandler > OnEffectRemove
HookList< EffectApplyHandler > OnEffectApply
bool CheckInRoom()
SummonList summons
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Creature * DoSummonFlyer(uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:56
CreatureAI * AI() const
Definition Creature.h:483
void DisappearAndDie()
Definition Creature.cpp:206
CreatureScript(const char *name)
bool operator()(WorldObject *target) const
GameObjectScript(const char *name)
void LoadGrid(float x, float y)
Definition Map.cpp:455
void VisitAll(const float &x, const float &y, float radius, NOTIFIER &notifier)
Definition Map.h:701
Creature * GetCreature(uint64 guid)
Definition Map.cpp:3179
static Unit * GetUnit(WorldObject const &, uint64 guid)
Player * ToPlayer()
Definition Object.h:204
void SetFlag(uint16 index, uint32 newFlag)
Definition Object.cpp:1261
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:1280
uint32 GetEntry() const
Definition Object.h:125
Creature * ToCreature()
Definition Object.h:207
Unit * ToUnit()
Definition Object.h:210
PassiveAI(Creature *c)
Definition PassiveAI.cpp:10
bool HasTraj() const
Definition Spell.h:218
float GetSpeedZ() const
Definition Spell.h:227
float GetSpeedXY() const
Definition Spell.h:226
WorldLocation const * GetDstPos() const
Definition Spell.cpp:383
Definition Spell.h:289
SpellCastTargets m_targets
Definition Spell.h:535
WorldLocation const * GetExplTargetDest()
SpellInfo const * GetSpellInfo()
void PreventHitDefaultEffect(SpellEffIndex effIndex)
HookList< EffectHandler > OnEffectHitTarget
void PreventHitEffect(SpellEffIndex effIndex)
Unit * GetHitUnit()
int32 GetEffectValue()
Spell * GetSpell()
Unit * GetCaster()
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
HookList< HitHandler > BeforeHit
SpellScriptLoader(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:16
Definition Unit.h:1367
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition Unit.cpp:8234
Vehicle * GetVehicle() const
Definition Unit.h:2743
void SetFullHealth()
Definition Unit.h:1644
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Creature * GetVehicleCreatureBase() const
Definition Unit.cpp:7208
MotionMaster * GetMotionMaster()
Definition Unit.h:2605
void AddUnitState(uint32 f)
Definition Unit.h:1481
Vehicle * GetVehicleKit() const
Definition Unit.h:2739
Unit * GetBase() const
May be called from scripts.
Definition Vehicle.h:38
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition Vehicle.cpp:306
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
Definition Vehicle.h:56
bool IsWithinDist2d(float x, float y, float dist) const
Definition Object.cpp:1720
Map * GetMap() const
Definition Object.h:740
InstanceScript * GetInstanceScript()
Definition Object.cpp:1612
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2801
void MonsterTextEmote(const char *text, WorldObject const *target, bool IsBossEmote=false)
Definition Object.cpp:2440
uint32 GetAreaId() const
Definition Object.cpp:1602
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:36
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:37
virtual void ProcessEvent(WorldObject *, uint32)
Definition ZoneScript.h:39
virtual uint64 GetData64(uint32) const
Definition ZoneScript.h:32
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
void OnDestroyed(GameObject *go, Player *) 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
bool OnGossipHello(Player *player, Creature *creature) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnGossipSelect(Player *player, Creature *creature, uint32, uint32 action) 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 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
SpellScript * GetSpellScript() const OVERRIDE
C::value_type const & SelectRandomContainerElement(C const &container)
Definition Containers.h:48
float GetPositionZ() const
Definition Object.h:330
float GetPositionX() const
Definition Object.h:328
void GetPosition(float &x, float &y) const
Definition Object.h:333
float GetPositionY() const
Definition Object.h:329
Creature * me
const T & RAID_MODE(const T &normal10, const T &normal25) const
ScriptedAI(Creature *creature)
TurretAI(Creature *c)
Definition CombatAI.cpp:224
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SetData(uint32 id, uint32 data) OVERRIDE
void SpellHit(Unit *, SpellInfo const *spell) OVERRIDE
void SpellHitTarget(Unit *target, SpellInfo const *spell) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void PassengerBoarded(Unit *who, int8 seatId, bool apply) OVERRIDE
== Fields =======================================
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
bool HasEscortState(uint32 escortState) const
npc_escortAI(Creature *creature)
void Start(bool isActiveAttacker=true, bool run=false, uint64 playerGUID=0, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void MovementInform(uint32 type, uint32 id) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SpellHit(Unit *, SpellInfo const *spell) OVERRIDE
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
@ BOSS_LEVIATHAN
Definition ulduar.h:20
@ DATA_UNBROKEN
Definition ulduar.h:316
@ DATA_COLOSSUS
Definition ulduar.h:263
@ ACTION_TOWER_OF_FLAMES_DESTROYED
Definition ulduar.h:232
@ ACTION_TOWER_OF_STORM_DESTROYED
Definition ulduar.h:230
@ ACTION_MOVE_TO_CENTER_POSITION
Definition ulduar.h:234
@ ACTION_TOWER_OF_LIFE_DESTROYED
Definition ulduar.h:233
@ ACTION_TOWER_OF_FROST_DESTROYED
Definition ulduar.h:231
AI * GetUlduarAI(T *obj)
Definition ulduar.h:336
@ NPC_SALVAGED_SIEGE_ENGINE
Definition ulduar.h:44
@ NPC_SALVAGED_DEMOLISHER
Definition ulduar.h:43
@ EVENT_TOWER_OF_STORM_DESTROYED
Definition ulduar.h:220
@ EVENT_TOWER_OF_LIFE_DESTROYED
Definition ulduar.h:223
@ EVENT_TOWER_OF_FLAMES_DESTROYED
Definition ulduar.h:222
@ EVENT_TOWER_OF_FROST_DESTROYED
Definition ulduar.h:221