TrinityCore
boss_razorscale.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "G3DPosition.hpp"
20#include "GameObject.h"
21#include "GameObjectAI.h"
22#include "InstanceScript.h"
23#include "MotionMaster.h"
24#include "MoveSplineInit.h"
25#include "ObjectAccessor.h"
26#include "Player.h"
27#include "ScriptedCreature.h"
28#include "ScriptedGossip.h"
29#include "SpellInfo.h"
30#include "SpellScript.h"
31#include "TemporarySummon.h"
32#include "ulduar.h"
33
34enum Says
35{
36 // Expedition Commander
40
41 // Expedition Engineer
45
46 // Razorscale Controller
48
49 // Razorscale
53};
54
56{
65
66 // Razorscale Harpoon Fire State
68
69 // Harpoon
75
76 // Razorscale Spawner
84
85 // Dark Rune Guardian
87
88 // Dark Rune Sentinel
92
93 // Expedition Defender
94 SPELL_THREAT = 65146,
95
96 // Expedition Trapper
97 SPELL_SHACKLE = 62646
98};
99
100#define DEVOURING_FLAME_GROUND RAID_MODE<uint32>(64709, 64734)
101#define FLAME_BREATH RAID_MODE<uint32>(63317, 64021)
102#define CHAIN_LIGHTNING RAID_MODE<uint32>(64758, 64759)
103#define LIGHTNING_BOLT RAID_MODE<uint32>(63809, 64696)
104
106{
122
124{
137
138 // Expedition Commander
144
145 // Dark Rune Sentinel
150
151 // Dark Rune Watcher
154
155 // Dark Rune Guardian
158
160{
161 DATA_QUICK_SHAVE = 29192921, // 2919, 2921 are achievement IDs
177
179{
196
198{
223
225{
232
234{
235 { 571.9465f, -136.0118f, 391.5171f, 2.286379f }, // 1
236 { 589.9233f, -133.6223f, 391.8968f, 3.298687f }, // 2
237 { 559.1199f, -140.5058f, 391.1803f, 4.049168f }, // 0
238 { 606.2297f, -136.7212f, 391.1803f, 5.131269f } // 3
239};
240
241constexpr Position PosHarpoon[4] =
242{
243 { 571.9012f, -136.5541f, 391.5171f, 4.921829f }, // GO_RAZOR_HARPOON_1
244 { 589.9233f, -133.6223f, 391.8968f, 4.81711f }, // GO_RAZOR_HARPOON_2
245 { 559.1199f, -140.5058f, 391.1803f, 5.061456f }, // GO_RAZOR_HARPOON_3
246 { 606.2297f, -136.7212f, 391.1803f, 4.537859f } // GO_RAZOR_HARPOON_4
247};
248
250{
251 { 624.3065f, -154.4163f, 391.6442f },
252 { 611.6274f, -170.9375f, 391.8087f },
253 { 572.1548f, -167.4471f, 391.8087f },
254 { 558.4640f, -165.0114f, 391.8087f },
255 { 603.3345f, -164.4297f, 391.8087f },
256 { 549.1727f, -159.1180f, 391.8087f }
257};
258
260{
261 { 574.9293f, -184.5150f, 391.8921f },
262 { 539.7838f, -178.5337f, 391.3053f },
263 { 627.1754f, -177.9638f, 391.5553f }
264};
265
267{
272};
273
275{
276 { 657.0227f, -361.1278f, 519.5406f },
277 { 698.9319f, -340.9654f, 520.4857f },
278 { 713.8673f, -290.2219f, 518.4573f },
279 { 711.1782f, -259.6798f, 524.6802f },
280 { 695.5101f, -234.6734f, 529.1528f },
281 { 666.9619f, -220.7599f, 531.4860f },
282 { 629.2765f, -219.7951f, 528.9301f },
283 { 597.4018f, -233.7745f, 526.6508f },
284 { 577.5307f, -275.4489f, 528.1241f },
285 { 583.1092f, -319.5873f, 527.9302f },
286 { 611.5800f, -353.1930f, 526.2653f }
287};
288
289constexpr Position RazorFlightPosition = { 585.3610f, -173.5592f, 456.8430f, 1.526665f };
290constexpr Position RazorFlightPositionPhase2 = { 619.1450f, -238.0780f, 475.1800f, 1.423917f };
291constexpr Position RazorscaleLand = { 585.4010f, -173.5430f, 408.5080f, 1.570796f };
292constexpr Position RazorscaleGroundPosition = { 585.4010f, -173.5430f, 391.6421f, 1.570796f };
293
294struct boss_razorscale : public BossAI
295{
297 {
298 Initialize();
299 }
300
302 {
303 _engineersCount = 3;
304 _defendersCount = 0;
307 _trappersCount = 0;
308 _permaGround = false;
309 _flyCount = 0;
310 me->SetDisableGravity(true);
311 }
312
313 void Reset() override
314 {
315 _Reset();
316 Initialize();
320 if (Is25ManRaid())
322 // @Developer remove this comment when someone create a way to change view distance for objects
323 // me->GetMotionMaster()->MovePoint(POINT_START_WAYPOINT, RazorscaleFirstPoint);
324 // And apply it on DB: UPDATE `creature` SET `position_x`=699.7847, `position_y`=-424.8246, `position_z`=589.2745, `orientation`=1.972222 WHERE `guid`=137611; -- Razorscale
325 SetCombatMovement(false);
326 }
327
329 {
330 std::function<void(Movement::MoveSplineInit&)> initializer = [](Movement::MoveSplineInit& init)
331 {
333 std::transform(std::begin(RazorscalePath), std::end(RazorscalePath), path.begin(), [](Position pos) { return PositionToVector3(pos); });
334 init.MovebyPath(path, 0);
335 init.SetCyclic();
336 init.SetFly();
337 };
339 }
340
341 bool CanAIAttack(Unit const* target) const override
342 {
343 switch (target->GetEntry())
344 {
349 return false;
350 default:
351 return BossAI::CanAIAttack(target);
352 }
353 }
354
355 void JustEngagedWith(Unit* who) override
356 {
362 HandleMusic(true);
363 }
364
366 {
370 }
371
373 {
378 }
379
380 void DoAction(int32 actionId) override
381 {
382 switch (actionId)
383 {
385 me->SetImmuneToPC(false);
386 me->SetSpeedRate(MOVE_RUN, 3.0f);
387 me->StopMoving();
389 break;
394 me->SetSpeedRate(MOVE_RUN, 3.0f);
396 break;
398 {
399 me->SetDisableGravity(false);
407 break;
408 }
409 default:
410 break;
411 }
412 }
413
414 void MovementInform(uint32 type, uint32 pointId) override
415 {
416 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
417 return;
418
419 switch (pointId)
420 {
423 break;
428 break;
430 me->SetDisableGravity(false);
431 if (!_permaGround)
432 {
437 commander->AI()->DoAction(ACTION_GROUND_PHASE);
439 }
440 break;
442 me->SetSpeedRate(MOVE_RUN, 3.0f);
444 break;
449 ++_flyCount;
451 break;
456 break;
457 default:
458 break;
459 }
460 }
461
462 void JustSummoned(Creature* summon) override
463 {
464 BossAI::JustSummoned(summon);
465
466 switch (summon->GetEntry())
467 {
471 break;
475 break;
479 break;
480 default:
481 break;
482 }
483 }
484
485 void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
486 {
487 if (summon->GetEntry() == NPC_EXPEDITION_ENGINEER)
488 {
490 if (_engineersCount == 0)
492 commander->AI()->DoAction(ACTION_ENGINEER_DEAD);
493 }
494 }
495
496 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
497 {
498 if (spellInfo->Id == SPELL_HARPOON_TRIGGER)
499 {
501 if (_harpoonHitCount == RAID_MODE(2, 4))
503 }
504 }
505
506 uint32 GetData(uint32 type) const override
507 {
508 if (type == DATA_QUICK_SHAVE && _flyCount <= 1)
509 return 1;
510 return 0;
511 }
512
513 void EnterEvadeMode(EvadeReason why) override
514 {
516 return;
517
520 HandleMusic(false);
523 }
524
525 void JustDied(Unit* /*killer*/) override
526 {
527 _JustDied();
529 HandleMusic(false);
530 }
531
532 void HandleMusic(bool active)
533 {
534 int32 enabled = active ? 1 : 0;
536 }
537
539 {
540 float x = frand(540.0f, 640.0f); // Safe range is between 500 and 650
541 float y = frand(-230.0f, -195.0f); // Safe range is between -235 and -145
542 float z = 391.517f; // Ground level
544 }
545
546 void DamageTaken(Unit* /*done_by*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
547 {
549 {
550 _permaGround = true;
554 }
555 }
556
557 void UpdateAI(uint32 diff) override
558 {
559 if (!UpdateVictim())
560 return;
561
562 events.Update(diff);
563
565 return;
566
567 while (uint32 eventId = events.ExecuteEvent())
568 {
569 switch (eventId)
570 {
571 case EVENT_BERSERK:
574 break;
575 case EVENT_FIREBALL:
577 DoCast(target, SPELL_FIREBALL);
579 break;
583 if (_permaGround)
584 events.Repeat(Seconds(10), Seconds(12));
585 else
586 events.Repeat(Seconds(6), Seconds(12));
587 break;
589 {
590 uint8 random = RAID_MODE<uint8>(2, urand(2, 4));
591 uint8 time = 5;
592 for (uint8 n = 0; n < random; ++n)
593 {
595 time += urand(2, 5);
596 }
597 events.Repeat(Seconds(40));
598 break;
599 }
602 break;
608 break;
612 events.Repeat(Seconds(15), Seconds(18));
613 break;
615 {
621 break;
622 }
624 {
625 me->SetDisableGravity(true);
628 Position pos = me->GetPosition();
629 pos.m_positionZ += 10.0f;
633 break;
634 }
635 case EVENT_FIREBOLT:
637 break;
638 case EVENT_FUSE_ARMOR:
639 if (Unit* victim = me->GetVictim())
640 if (!victim->HasAura(SPELL_FUSED_ARMOR))
641 DoCast(victim, SPELL_FUSE_ARMOR);
642 events.Repeat(Seconds(10), Seconds(15));
643 break;
645 SetCombatMovement(true);
646 if (Unit* victim = me->GetVictim())
647 me->GetMotionMaster()->MoveChase(victim);
648 break;
649 default:
650 break;
651 }
652
654 return;
655 }
656 }
657
658private:
666};
667
669{
670 npc_expedition_commander(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()),
671 _is25Man(Is25ManRaid()), _building(false), _destroy(false), _stopControllers(false) { }
672
673 void Reset() override
674 {
675 _events.Reset();
678 }
679
680 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
681 {
682 if (gossipListId == GOSSIP_START_ENCOUNTER)
683 {
684 CloseGossipMenuFor(player);
687 if (Creature* razorscale = _instance->GetCreature(DATA_RAZORSCALE))
688 razorscale->AI()->DoAction(ACTION_START_FIGHT);
689 return true;
690 }
691 return false;
692 }
693
695 {
696 uint8 harpoonNumber = _is25Man ? 4 : 2;
697 for (uint8 i = 0; i < harpoonNumber; ++i)
698 me->SummonGameObject(GO_RAZOR_BROKEN_HARPOON, PosBrokenHarpoon[i], QuaternionData(0.0f, 0.0f, -0.8987932f, 0.4383728f), 7_days);
699 }
700
702 {
703 for (ObjectGuid harpoonGuid : _harpoons)
704 if (GameObject* harpoon = ObjectAccessor::GetGameObject(*me, harpoonGuid))
705 harpoon->RemoveFromWorld();
706
707 _harpoons.clear();
710 }
711
713 {
714 std::list<Creature*> Controllers;
716
717 for (Creature* controller : Controllers)
718 controller->InterruptNonMeleeSpells(false);
719
720 _stopControllers = false;
721 }
722
723 void BuildHarpoon(uint8 harpoonNumber)
724 {
725
726 if (_is25Man)
727 {
728 switch (harpoonNumber)
729 {
730 case HARPOON_1:
731 if (GameObject* harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_3, PosHarpoon[2], QuaternionData(0.0f, 0.0f, -0.573576f, 0.8191524f), 7_days))
732 _harpoons.emplace_back(harpoon->GetGUID());
733 break;
734 case HARPOON_2:
735 if (GameObject* harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[0], QuaternionData(0.0f, 0.0f, -0.6293201f, 0.7771462f), 7_days))
736 _harpoons.emplace_back(harpoon->GetGUID());
737 break;
738 case HARPOON_3:
739 if (GameObject* harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[1], QuaternionData(0.0f, 0.0f, -0.6691303f, 0.743145f), 7_days))
740 _harpoons.emplace_back(harpoon->GetGUID());
741 break;
742 case HARPOON_4:
743 if (GameObject* harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_4, PosHarpoon[3], QuaternionData(0.0f, 0.0f, -0.7660437f, 0.6427886f), 7_days))
744 _harpoons.emplace_back(harpoon->GetGUID());
745 break;
746 default:
747 break;
748 }
749 }
750 else
751 {
752 switch (harpoonNumber)
753 {
754 case HARPOON_1:
755 if (GameObject* harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_1, PosHarpoon[harpoonNumber], QuaternionData(0.0f, 0.0f, -0.6293201f, 0.7771462f), 0s))
756 _harpoons.emplace_back(harpoon->GetGUID());
757 break;
758 case HARPOON_2:
759 if (GameObject* harpoon = me->SummonGameObject(GO_RAZOR_HARPOON_2, PosHarpoon[harpoonNumber], QuaternionData(0.0f, 0.0f, -0.6691303f, 0.743145f), 0s))
760 _harpoons.emplace_back(harpoon->GetGUID());
761 break;
762 default:
763 break;
764 }
765 }
766 }
767
768 void DoAction(int32 actionId) override
769 {
770 if (_building && actionId != ACTION_ENGINEER_DEAD)
771 return;
772
773 switch (actionId)
774 {
777 break;
780 break;
783 _events.Reset();
784 _building = false;
785 break;
787 _building = true;
789 break;
791 _building = true;
793 break;
795 _building = true;
797 break;
799 _building = true;
801 break;
803 if (_destroy)
804 return;
805 _destroy = true;
807 break;
810 return;
811 _stopControllers = true;
813 break;
814 default:
815 break;
816 }
817 }
818
819 void UpdateAI(uint32 diff) override
820 {
822 return;
823
824 _events.Update(diff);
825
826 while (uint32 eventId = _events.ExecuteEvent())
827 {
828 switch (eventId)
829 {
832 _building = false;
833 break;
836 _building = false;
837 break;
840 _building = false;
841 break;
844 _building = false;
845 break;
847 _destroy = false;
848 break;
849 default:
850 break;
851 }
852 }
853 }
854
855private:
863};
864
866{
867 npc_expedition_defender(Creature* creature) : ScriptedAI(creature), _myPositionNumber(0), _instance(creature->GetInstanceScript())
868 {
869 me->SetRegenerateHealth(false);
870 }
871
872 void Reset() override
873 {
875 }
876
877 bool CanAIAttack(Unit const* target) const override
878 {
879 if (target->GetEntry() == NPC_RAZORSCALE || target->GetEntry() == NPC_RAZORSCALE_SPAWNER)
880 return false;
881
882 return ScriptedAI::CanAIAttack(target);
883 }
884
885 void SetData(uint32 type, uint32 value) override
886 {
887 if (type == DATA_EXPEDITION_NUMBER)
888 _myPositionNumber = value;
889 }
890
891 void DoAction(int32 actionId) override
892 {
893 if (actionId == ACTION_START_FIGHT)
895 }
896
897 void MovementInform(uint32 type, uint32 pointId) override
898 {
899 if (type != POINT_MOTION_TYPE && pointId != POINT_DEFENDER_ATTACK)
900 return;
901
903 me->SetImmuneToNPC(false);
904 }
905
906private:
909};
910
912{
913 npc_expedition_trapper(Creature* creature) : ScriptedAI(creature), _myPositionNumber(0), _instance(creature->GetInstanceScript())
914 {
915 SetCombatMovement(false);
917 }
918
919 void DoAction(int32 actionId) override
920 {
921 if (!me->IsAlive())
922 return;
923
924 switch (actionId)
925 {
928 break;
931 break;
933 me->SetImmuneToNPC(false);
934 break;
935 case ACTION_STOP_CAST:
937 _scheduler.Schedule(Seconds(2), [this](TaskContext /*context*/)
938 {
939 me->GetMotionMaster()->MoveTargetedHome();
940 });
942 commander->AI()->DoAction(ACTION_STOP_CONTROLLERS);
943 break;
944 default:
945 break;
946 }
947 }
948
949 void SetData(uint32 type, uint32 value) override
950 {
951 if (type == DATA_EXPEDITION_NUMBER)
952 _myPositionNumber = value;
953 }
954
955 void MovementInform(uint32 type, uint32 pointId) override
956 {
957 if (type != POINT_MOTION_TYPE && pointId != POINT_SHACKLE_RAZORSCALE)
958 return;
959
961 }
962
963 void UpdateAI(uint32 diff) override
964 {
965 _scheduler.Update(diff);
966 }
967
968private:
972};
973
975{
976 npc_expedition_engineer(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _myPositionNumber(0), _canUpdateAI(false) { }
977
978 void Reset() override
979 {
982 }
983
984 void DoAction(int32 actionId) override
985 {
986 if (!me->IsAlive())
987 return;
988
989 if (actionId == ACTION_START_FIGHT)
990 {
991 _canUpdateAI = true;
994 _scheduler.Schedule(Seconds(28), [this](TaskContext /*context*/)
995 {
997 me->SetImmuneToNPC(false);
998 });
999 }
1000 else if (actionId == ACTION_FIX_HARPOONS)
1001 {
1003 Talk(SAY_AGGRO);
1004 _scheduler.Schedule(Seconds(28), [this](TaskContext /*context*/)
1005 {
1007 });
1008 }
1009 }
1010
1011 void ChangeOrientation(float orientation)
1012 {
1013 _scheduler.Schedule(Milliseconds(1), [this, orientation](TaskContext /*context*/)
1014 {
1015 me->SetFacingTo(orientation);
1016 });
1017 }
1018
1020 {
1021 switch (_myPositionNumber)
1022 {
1023 case ENGINEER_NORTH:
1024 if (Is25ManRaid())
1026 else
1028 break;
1029 case ENGINEER_EAST:
1031 if (Is25ManRaid())
1033 else
1035 break;
1036 case ENGINEER_WEST:
1037 if (Is25ManRaid())
1039 else
1041 break;
1042 default:
1043 break;
1044 }
1045 }
1046
1048 {
1049 switch (_myPositionNumber)
1050 {
1051 case ENGINEER_NORTH:
1052 if (Is25ManRaid())
1054 else
1056 break;
1057 case ENGINEER_EAST:
1058 if (Is25ManRaid())
1060 else
1062 break;
1063 case ENGINEER_WEST:
1064 if (Is25ManRaid())
1066 else
1068 break;
1069 default:
1070 break;
1071 }
1072 }
1073
1075 {
1076 switch (_myPositionNumber)
1077 {
1078 case ENGINEER_NORTH:
1079 if (Is25ManRaid())
1081 else
1083 break;
1084 case ENGINEER_EAST:
1085 if (Is25ManRaid())
1087 else
1089 break;
1090 case ENGINEER_WEST:
1091 if (Is25ManRaid())
1093 else
1095 break;
1096 default:
1097 break;
1098 }
1099 }
1100
1102 {
1103 switch (_myPositionNumber)
1104 {
1105 case ENGINEER_NORTH:
1106 if (Is25ManRaid())
1108 break;
1109 case ENGINEER_EAST:
1110 if (Is25ManRaid())
1112 break;
1113 case ENGINEER_WEST:
1114 if (Is25ManRaid())
1116 break;
1117 default:
1118 break;
1119 }
1120 }
1121
1123 {
1124 switch (_myPositionNumber)
1125 {
1126 case ENGINEER_NORTH:
1127 if (Is25ManRaid())
1129 break;
1130 case ENGINEER_EAST:
1131 if (Is25ManRaid())
1133 break;
1134 case ENGINEER_WEST:
1135 if (Is25ManRaid())
1137 break;
1138 default:
1139 break;
1140 }
1141 }
1142
1143 void UpdateAI(uint32 diff) override
1144 {
1145 if (!_canUpdateAI)
1146 return;
1147
1148 _scheduler.Update(diff);
1149 }
1150
1151 void SetData(uint32 type, uint32 value) override
1152 {
1153 if (type == DATA_EXPEDITION_NUMBER)
1154 _myPositionNumber = value;
1155 }
1156
1157 void MovementInform(uint32 type, uint32 pointId) override
1158 {
1159 if (type != POINT_MOTION_TYPE && type != SPLINE_CHAIN_MOTION_TYPE)
1160 return;
1161
1162 switch (pointId)
1163 {
1164 case POINT_HARPOON_1:
1165 case POINT_HARPOON_1_25:
1167 commander->AI()->DoAction(ACTION_BUILD_HARPOON_1);
1168
1169 _scheduler.
1170 Schedule(Seconds(3), [this](TaskContext /*context*/)
1171 {
1173 })
1174 .Schedule(Seconds(18), [this](TaskContext /*context*/)
1175 {
1177 });
1178 break;
1179 case POINT_HARPOON_2:
1180 case POINT_HARPOON_2_25:
1182 commander->AI()->DoAction(ACTION_BUILD_HARPOON_2);
1183 _scheduler.Schedule(Seconds(18), [this](TaskContext /*context*/)
1184 {
1186 });
1187 break;
1188 case POINT_HARPOON_3:
1190 commander->AI()->DoAction(ACTION_BUILD_HARPOON_3);
1191 _scheduler.Schedule(Seconds(18), [this](TaskContext /*context*/)
1192 {
1194 });
1195 break;
1196 case POINT_HARPOON_4:
1198 commander->AI()->DoAction(ACTION_BUILD_HARPOON_4);
1199 _scheduler.Schedule(Seconds(18), [this](TaskContext /*context*/)
1200 {
1202 });
1203 break;
1204 case POINT_BASE:
1205 ChangeOrientation(4.61684f);
1206 break;
1207 default:
1208 break;
1209 }
1210 }
1211
1212private:
1217};
1218
1220{
1221 npc_razorscale_spawner(Creature* creature) : ScriptedAI(creature) { }
1222
1223 void Reset() override
1224 {
1225 me->setActive(true);
1226 me->SetFarVisible(true);
1228 _scheduler.
1229 Schedule(Seconds(1), [this](TaskContext /*context*/)
1230 {
1232 }).Schedule(Seconds(6), [this](TaskContext /*context*/)
1233 {
1235 });
1236 }
1237
1238 void UpdateAI(uint32 diff) override
1239 {
1240 _scheduler.Update(diff);
1241 }
1242
1243private:
1245};
1246
1248{
1249 npc_darkrune_watcher(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
1250
1251 void Reset() override
1252 {
1253 _events.Reset();
1256 if (Creature* razorscale = _instance->GetCreature(DATA_RAZORSCALE))
1257 razorscale->AI()->JustSummoned(me);
1258 }
1259
1260 void JustEngagedWith(Unit* /*who*/) override
1261 {
1264 }
1265
1266 void UpdateAI(uint32 diff) override
1267 {
1268 if (!UpdateVictim())
1269 return;
1270
1271 _events.Update(diff);
1272
1274 return;
1275
1276 while (uint32 eventId = _events.ExecuteEvent())
1277 {
1278 switch (eventId)
1279 {
1280 case EVENT_START_COMBAT:
1283 break;
1287 break;
1290 _events.Repeat(Seconds(9), Seconds(15));
1291 break;
1292 default:
1293 break;
1294 }
1295
1297 return;
1298 }
1299 }
1300
1301private:
1304};
1305
1307{
1308 npc_darkrune_guardian(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _killedByBreath(false) { }
1309
1310 void Reset() override
1311 {
1312 _events.Reset();
1315 if (Creature* razorscale = _instance->GetCreature(DATA_RAZORSCALE))
1316 razorscale->AI()->JustSummoned(me);
1317 }
1318
1319 void JustEngagedWith(Unit* /*who*/) override
1320 {
1322 }
1323
1324 uint32 GetData(uint32 type) const override
1325 {
1326 return type == DATA_IRON_DWARF_MEDIUM_RARE ? _killedByBreath : 0;
1327 }
1328
1329 void SetData(uint32 type, uint32 value) override
1330 {
1331 if (type == DATA_IRON_DWARF_MEDIUM_RARE)
1332 _killedByBreath = value != 0;
1333 }
1334
1335 void UpdateAI(uint32 diff) override
1336 {
1337 if (!UpdateVictim())
1338 return;
1339
1340 _events.Update(diff);
1341
1343 return;
1344
1345 while (uint32 eventId = _events.ExecuteEvent())
1346 {
1347 switch (eventId)
1348 {
1349 case EVENT_START_COMBAT:
1352 break;
1353 case EVENT_STORMSTRIKE:
1355 _events.Repeat(Seconds(13), Seconds(25));
1356 break;
1357 default:
1358 break;
1359 }
1360
1362 return;
1363 }
1364 }
1365
1366private:
1370};
1371
1373{
1374 npc_darkrune_sentinel(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
1375
1376 void Reset() override
1377 {
1378 _events.Reset();
1381 if (Creature* razorscale = _instance->GetCreature(DATA_RAZORSCALE))
1382 razorscale->AI()->JustSummoned(me);
1383 }
1384
1385 void JustEngagedWith(Unit* /*who*/) override
1386 {
1390 }
1391
1392 void UpdateAI(uint32 diff) override
1393 {
1394 if (!UpdateVictim())
1395 return;
1396
1397 _events.Update(diff);
1398
1400 return;
1401
1402 while (uint32 eventId = _events.ExecuteEvent())
1403 {
1404 switch (eventId)
1405 {
1406 case EVENT_START_COMBAT:
1409 break;
1412 _events.Repeat(Seconds(5), Seconds(9));
1413 break;
1414 case EVENT_BATTLE_SHOUT:
1416 _events.Repeat(Seconds(25));
1417 break;
1418 case EVENT_WHIRLWIND:
1420 _events.Repeat(Seconds(10), Seconds(13));
1421 break;
1422 default:
1423 break;
1424 }
1425
1427 return;
1428 }
1429 }
1430
1431private:
1434};
1435
1437{
1438 npc_razorscale_harpoon_fire_state(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
1439
1440 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
1441 {
1442 if (spellInfo->Id == SPELL_FIREBOLT)
1443 {
1446 commander->AI()->DoAction(ACTION_DESTROY_HARPOONS);
1447 }
1448 }
1449
1450private:
1452};
1453
1455{
1457
1458 void Reset() override
1459 {
1462 }
1463
1464 // Evade caused by Spell::SummonGuardian. Creature dont need evade at all, is despawned if razorscale enter in evade
1465 void EnterEvadeMode(EvadeReason /*why*/) override { }
1466};
1467
1469{
1470public:
1471 go_razorscale_harpoon() : GameObjectScript("go_razorscale_harpoon") { }
1472
1474 {
1476
1477 void Reset() override
1478 {
1479 _scheduler.Schedule(Seconds(1), [this](TaskContext /*context*/)
1480 {
1481 if (Creature* controller = me->FindNearestCreature(NPC_RAZORSCALE_CONTROLLER, 5.0f))
1482 controller->AI()->Talk(EMOTE_HARPOON);
1483
1485 brokenHarpoon->RemoveFromWorld();
1486 });
1487 }
1488
1490 {
1491 switch (me->GetEntry())
1492 {
1493 case GO_RAZOR_HARPOON_1:
1494 return SPELL_HARPOON_SHOT_1;
1495 case GO_RAZOR_HARPOON_2:
1496 return SPELL_HARPOON_SHOT_2;
1497 case GO_RAZOR_HARPOON_3:
1498 return SPELL_HARPOON_SHOT_3;
1499 case GO_RAZOR_HARPOON_4:
1500 return SPELL_HARPOON_SHOT_4;
1501 default:
1502 return 0;
1503 }
1504 }
1505
1506 bool OnGossipHello(Player* /*player*/) override
1507 {
1509 if (Creature* controller = me->FindNearestCreature(NPC_RAZORSCALE_CONTROLLER, 5.0f))
1510 {
1511 // Prevent 2 players clicking at "same time"
1512 if (controller->HasUnitState(UNIT_STATE_CASTING))
1513 return true;
1514
1515 uint32 spellId = SelectRightSpell();
1516 controller->CastSpell(nullptr, spellId, true);
1517 }
1518
1519 return true;
1520 }
1521
1522 void UpdateAI(uint32 diff) override
1523 {
1524 _scheduler.Update(diff);
1525 }
1526
1527 private:
1529 };
1530
1531 GameObjectAI* GetAI(GameObject* go) const override
1532 {
1533 return GetUlduarAI<go_razorscale_harpoonAI>(go);
1534 }
1535};
1536
1538{
1539public:
1540 go_razorscale_mole_machine() : GameObjectScript("go_razorscale_mole_machine") { }
1541
1543 {
1545
1546 void Reset() override
1547 {
1549 _scheduler.Schedule(Seconds(1), [this](TaskContext /*context*/)
1550 {
1552 });
1553 _scheduler.Schedule(Seconds(10), [this](TaskContext /*context*/)
1554 {
1555 me->Delete();
1556 });
1557 }
1558
1559 void UpdateAI(uint32 diff) override
1560 {
1561 _scheduler.Update(diff);
1562 }
1563
1564 private:
1566 };
1567 GameObjectAI* GetAI(GameObject* go) const override
1568 {
1569 return GetUlduarAI<go_razorscale_mole_machineAI>(go);
1570 }
1571};
1572
1573/* 63317 - Flame Breath
1574 64021 - Flame Breath */
1576{
1578 {
1579 Creature* target = GetHitCreature();
1580 if (!target || target->GetEntry() != NPC_DARK_RUNE_GUARDIAN || !target->IsAlive())
1581 return;
1582
1583 if (GetHitDamage() >= int32(target->GetHealth()))
1584 target->AI()->SetData(DATA_IRON_DWARF_MEDIUM_RARE, 1);
1585 }
1586
1587 void FilterTargets(std::list<WorldObject*>& targets)
1588 {
1589 targets.remove_if([](WorldObject* obj)
1590 {
1591 if (Creature* target = obj->ToCreature())
1592 if (target->IsTrigger())
1593 return true;
1594
1595 return false;
1596 });
1597 }
1598
1599 void Register() override
1600 {
1603 }
1604};
1605
1606/* 63968 - Summon Iron Dwarves
1607 63970 - Summon Iron Dwarves
1608 63969 - Summon Iron Dwarves */
1610{
1611 bool Validate(SpellInfo const* /*spellInfo*/) override
1612 {
1613 return ValidateSpellInfo(
1614 {
1617 });
1618 }
1619
1621 {
1622 Unit* caster = GetCaster();
1623 switch (GetSpellInfo()->Id)
1624 {
1626 caster->CastSpell(caster, SPELL_SUMMON_IRON_DWARF_GUARDIAN, true);
1627 caster->CastSpell(caster, SPELL_SUMMON_IRON_DWARF_GUARDIAN, true);
1628 caster->CastSpell(caster, SPELL_SUMMON_IRON_DWARF_WATCHER, true);
1629 break;
1632 caster->CastSpell(caster, SPELL_SUMMON_IRON_DWARF_GUARDIAN, true);
1633 caster->CastSpell(caster, SPELL_SUMMON_IRON_DWARF_WATCHER, true);
1634 caster->CastSpell(caster, SPELL_SUMMON_IRON_DWARF_WATCHER, true);
1635 break;
1636 default:
1637 break;
1638 }
1639 }
1640
1641 void Register() override
1642 {
1644 }
1645};
1646
1647// 64821 - Fuse Armor
1649{
1650 bool Validate(SpellInfo const* /*spellInfo*/) override
1651 {
1653 }
1654
1655 void HandleFused(AuraEffect const* /*aurEff*/)
1656 {
1657 if (GetStackAmount() != GetSpellInfo()->StackAmount)
1658 return;
1659
1660 GetTarget()->CastSpell(nullptr, SPELL_FUSED_ARMOR, true);
1661 Remove();
1662 }
1663
1664 void Register() override
1665 {
1667 }
1668};
1669
1670// 62669 - Firebolt
1672{
1673 void FilterTargets(std::list<WorldObject*>& targets)
1674 {
1675 targets.remove_if([](WorldObject* obj) { return obj->GetEntry() != NPC_RAZORSCALE_HARPOON_FIRE_STATE; });
1676 }
1677
1678 void Register() override
1679 {
1681 }
1682};
1683
1685{
1686 public:
1687 achievement_iron_dwarf_medium_rare() : AchievementCriteriaScript("achievement_iron_dwarf_medium_rare") { }
1688
1689 bool OnCheck(Player* /*player*/, Unit* target) override
1690 {
1691 return target && target->GetAI() && target->GetAI()->GetData(DATA_IRON_DWARF_MEDIUM_RARE);
1692 }
1693};
1694
1696{
1697 public:
1698 achievement_quick_shave() : AchievementCriteriaScript("achievement_quick_shave") { }
1699
1700 bool OnCheck(Player* /*source*/, Unit* target) override
1701 {
1702 if (target)
1703 if (Creature* razorscale = target->ToCreature())
1704 if (razorscale->AI()->GetData(DATA_QUICK_SHAVE))
1705 return true;
1706
1707 return false;
1708 }
1709};
1710
1712{
1732}
Actions
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ MOTION_PRIORITY_NORMAL
@ SPLINE_CHAIN_MOTION_TYPE
@ POINT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:395
Spells
Definition: PlayerAI.cpp:32
float frand(float min, float max)
Definition: Random.cpp:55
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
void CloseGossipMenuFor(Player *player)
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ TARGET_UNIT_CONE_ENTRY
@ TARGET_UNIT_SRC_AREA_ENTRY
@ EMOTE_STATE_USE_STANDING
@ SPELL_EFFECT_SCRIPT_EFFECT
@ GO_FLAG_NOT_SELECTABLE
@ SPELL_AURA_PERIODIC_DUMMY
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define SpellHitFn(F)
Definition: SpellScript.h:854
EvadeReason
Definition: UnitAICommon.h:30
@ MOVE_RUN
Definition: UnitDefines.h:118
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
DamageEffectType
Definition: UnitDefines.h:131
@ UNIT_STATE_CASTING
Definition: Unit.h:270
Says
constexpr Position RazorFlightPositionPhase2
@ EMOTE_PERMA_GROUND
@ SAY_COMMANDER_AGGRO
@ SAY_COMMANDER_GROUND_PHASE
@ SAY_START_REPAIR
@ SAY_AGGRO
@ EMOTE_HARPOON
@ EMOTE_BREATH
@ SAY_REBUILD_TURRETS
@ EMOTE_BERSERK
@ SAY_COMMANDER_ENGINEERS_DEAD
constexpr Position RazorscaleLand
@ ACTION_START_PERMA_GROUND
@ ACTION_STOP_CONTROLLERS
@ ACTION_BUILD_HARPOON_1
@ ACTION_BUILD_HARPOON_4
@ ACTION_SHACKLE_RAZORSCALE
@ ACTION_BUILD_HARPOON_2
@ ACTION_RETURN_TO_BASE
@ ACTION_BUILD_HARPOON_3
@ ACTION_DESTROY_HARPOONS
@ ACTION_GROUND_PHASE
@ ACTION_ENGINEER_DEAD
@ ACTION_STOP_CAST
@ ACTION_FIX_HARPOONS
@ ACTION_START_FIGHT
constexpr Position PosHarpoon[4]
@ HARPOON_4
@ RAZORSCALE_FIRE_STATE_10_GROUP
@ DATA_EXPEDITION_NUMBER
@ WORLD_STATE_RAZORSCALE_MUSIC
@ ENGINEER_EAST
@ DATA_IRON_DWARF_MEDIUM_RARE
@ HARPOON_3
@ HARPOON_1
@ DATA_QUICK_SHAVE
@ ENGINEER_NORTH
@ GOSSIP_START_ENCOUNTER
@ HARPOON_2
@ RAZORSCALE_FIRE_STATE_25_GROUP
@ ENGINEER_WEST
@ RAZORSCALE_EXPEDITION_GROUP
constexpr Position TrapperPosition[3]
#define CHAIN_LIGHTNING
constexpr Position PosBrokenHarpoon[4]
@ SPELL_TRIGGER_SUMMON_IRON_VRYKUL
@ SPELL_WING_BUFFET
@ SPELL_STORMSTRIKE
@ SPELL_SUMMON_MOLE_MACHINE
@ SPELL_HARPOON_FIRE_STATE
@ SPELL_BATTLE_SHOUT
@ SPELL_HARPOON_SHOT_1
@ SPELL_SHACKLE
@ SPELL_TRIGGER_SUMMON_IRON_DWARVES
@ SPELL_FIREBOLT
@ SPELL_FIREBALL
@ SPELL_SUMMON_IRON_DWARF_GUARDIAN
@ SPELL_HARPOON_SHOT_3
@ SPELL_HEROIC_STRIKE
@ SPELL_FUSED_ARMOR
@ SPELL_FUSE_ARMOR
@ SPELL_HARPOON_SHOT_4
@ SPELL_TRIGGER_SUMMON_IRON_DWARVES_2
@ SPELL_THREAT
@ SPELL_BERSERK
@ SPELL_DEVOURING_FLAME
@ SPELL_WHIRLWIND
@ SPELL_TRIGGER_SUMMON_IRON_DWARVES_3
@ SPELL_SUMMON_IRON_DWARF_WATCHER
@ SPELL_HARPOON_TRIGGER
@ SPELL_STUN_SELF
@ SPELL_HARPOON_SHOT_2
@ POINT_RAZORSCALE_TAKEOFF
@ POINT_RAZORSCALE_FLIGHT_2
@ POINT_SHACKLE_RAZORSCALE
@ POINT_HARPOON_2_25
@ POINT_START_WAYPOINT
@ POINT_RAZORSCALE_LAND
@ POINT_BASE
@ POINT_DEFENDER_ATTACK
@ POINT_HARPOON_2
@ POINT_HARPOON_1_25
@ POINT_RAZORSCALE_FLIGHT
@ POINT_HARPOON_3
@ POINT_HARPOON_1
@ POINT_HARPOON_4
@ POINT_RAZORSCALE_GROUND
EngineersSplineMovements
@ SPLINE_ENGINEER_WEST_25_HARPOON_1
@ SPLINE_ENGINEER_NORTH_25_HARPOON_2
@ SPLINE_ENGINEER_EAST_25_HARPOON_1
@ SPLINE_ENGINEER_EAST_10_BASE
@ SPLINE_ENGINEER_NORTH_25_HARPOON_1
@ SPLINE_ENGINEER_EAST_10_HARPOON_1
@ SPLINE_ENGINEER_NORTH_10_BASE
@ SPLINE_ENGINEER_WEST_10_HARPOON_1
@ SPLINE_ENGINEER_EAST_25_HARPOON_3
@ SPLINE_ENGINEER_NORTH_10_HARPOON_1
@ SPLINE_ENGINEER_WEST_25_HARPOON_3
@ SPLINE_ENGINEER_EAST_25_HARPOON_4
@ SPLINE_ENGINEER_WEST_10_BASE
@ SPLINE_ENGINEER_NORTH_25_HARPOON_3
@ SPLINE_ENGINEER_NORTH_10_HARPOON_2
@ SPLINE_ENGINEER_WEST_25_HARPOON_4
@ SPLINE_ENGINEER_NORTH_25_BASE
@ SPLINE_ENGINEER_WEST_10_HARPOON_2
@ SPLINE_ENGINEER_EAST_25_HARPOON_2
@ SPLINE_ENGINEER_WEST_25_HARPOON_2
@ SPLINE_ENGINEER_NORTH_25_HARPOON_4
@ SPLINE_ENGINEER_WEST_25_BASE
@ SPLINE_ENGINEER_EAST_10_HARPOON_2
#define FLAME_BREATH
RazorscalePhases
@ PHASE_NONE
@ PHASE_PERMA_GROUND
@ PHASE_GROUND
@ PHASE_AIR
@ PHASE_COMBAT
#define LIGHTNING_BOLT
constexpr uint32 SummonMinionsSpells[4]
#define DEVOURING_FLAME_GROUND
void AddSC_boss_razorscale()
constexpr Position DefendersPosition[6]
constexpr Position RazorscaleGroundPosition
constexpr Position RazorscalePath[]
constexpr Position RazorFlightPosition
@ EVENT_CHAIN_LIGHTNING
@ EVENT_BUILD_HARPOON_2
@ EVENT_SUMMON_MINIONS
@ EVENT_FLAME_BREATH
@ EVENT_START_COMBAT
@ EVENT_FIREBALL
@ EVENT_BUILD_HARPOON_3
@ EVENT_WHIRLWIND
@ EVENT_BUILD_HARPOON_4
@ EVENT_WING_BUFFET
@ EVENT_SUMMON_MINIONS_2
@ EVENT_HANDLE_DESTROY_HARPOON
@ EVENT_STORMSTRIKE
@ EVENT_RESUME_MOVE_CHASE
@ EVENT_FLAME_BREATH_GROUND
@ EVENT_BUILD_HARPOON_1
@ EVENT_LIGHTNING_BOLT
@ EVENT_BERSERK
@ EVENT_BATTLE_SHOUT
@ EVENT_RESUME_AIR_PHASE
@ EVENT_DEVOURING_FLAME
@ EVENT_FUSE_ARMOR
@ EVENT_HEROIC_STRIKE
@ EVENT_FIREBOLT
MovePoints
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
SpellInfo const * GetSpellInfo() const
Unit * GetTarget() const
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
uint8 GetStackAmount() const
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void JustSummoned(Creature *summon) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
bool CanAIAttack(Unit const *target) const override
SummonList summons
EventMap events
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:299
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:373
void SetReactState(ReactStates st)
Definition: Creature.h:160
void SetRegenerateHealth(bool value)
Definition: Creature.h:358
void SetImmuneToNPC(bool apply) override
Definition: Creature.h:173
CreatureAI * AI() const
Definition: Creature.h:214
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
bool IsInPhase(uint8 phase) const
Definition: EventMap.h:217
void SetPhase(uint8 phase)
Definition: EventMap.cpp:28
void Reset()
Definition: EventMap.cpp:21
GameObject *const me
Definition: GameObjectAI.h:50
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
void Delete()
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:274
Creature * GetCreature(uint32 type)
void DoUpdateWorldState(int32 worldStateId, int32 value)
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
void LaunchMoveSpline(std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE)
void MoveChase(Unit *target, Optional< ChaseRange > dist={}, Optional< ChaseAngle > angle={})
void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk)
void MoveTakeoff(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveLand(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
void MoveTargetedHome()
static Creature * ToCreature(Object *o)
Definition: Object.h:219
uint32 GetEntry() const
Definition: Object.h:161
uint32 const Id
Definition: SpellInfo.h:325
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
Creature * GetHitCreature() const
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > OnHit
Definition: SpellScript.h:850
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
virtual void SetData(uint32, uint32)
Definition: UnitAI.h:74
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
virtual bool CanAIAttack(Unit const *) const
Definition: UnitAI.h:57
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:73
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:8361
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
bool IsAlive() const
Definition: Unit.h:1164
void StopMoving()
Definition: Unit.cpp:10049
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
UnitAI * GetAI() const
Definition: Unit.h:660
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition: Unit.cpp:12725
void SetEmoteState(Emote emote)
Definition: Unit.h:852
uint64 GetHealth() const
Definition: Unit.h:776
Unit * GetVictim() const
Definition: Unit.h:715
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.cpp:8525
void SetFacingTo(float const ori, bool force=true)
Definition: Unit.cpp:12653
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:781
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
GameObject * FindNearestGameObject(uint32 entry, float range, bool spawnedOnly=true) const
Definition: Object.cpp:2170
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
Definition: Object.cpp:3312
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
void setActive(bool isActiveObject)
Definition: Object.cpp:922
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2065
void SetFarVisible(bool on)
Definition: Object.cpp:973
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition: Object.cpp:2131
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
GameObjectAI * GetAI(GameObject *go) const override
GameObjectAI * GetAI(GameObject *go) const override
void FilterTargets(std::list< WorldObject * > &targets)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void HandleFused(AuraEffect const *)
bool Validate(SpellInfo const *) override
std::vector< Vector3 > PointsArray
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
constexpr std::size_t size()
Definition: UpdateField.h:796
float m_positionZ
Definition: Position.h:55
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:81
constexpr float GetOrientation() const
Definition: Position.h:79
void SetCombatMovement(bool allowMovement)
T const & RAID_MODE(T const &normal10, T const &normal25) const
bool Is25ManRaid() const
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void ScheduleGroundPhaseEvents()
void JustSummoned(Creature *summon) override
void DoAction(int32 actionId) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void Reset() override
uint32 GetData(uint32 type) const override
void SummonedCreatureDies(Creature *summon, Unit *) override
void MovementInform(uint32 type, uint32 pointId) override
bool CanAIAttack(Unit const *target) const override
void HandleMusic(bool active)
boss_razorscale(Creature *creature)
void UpdateAI(uint32 diff) override
void EnterEvadeMode(EvadeReason why) override
void JustDied(Unit *) override
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
uint32 GetData(uint32 type) const override
npc_darkrune_guardian(Creature *creature)
void SetData(uint32 type, uint32 value) override
InstanceScript * _instance
InstanceScript * _instance
void JustEngagedWith(Unit *) override
void UpdateAI(uint32 diff) override
npc_darkrune_sentinel(Creature *creature)
void JustEngagedWith(Unit *) override
InstanceScript * _instance
npc_darkrune_watcher(Creature *creature)
void UpdateAI(uint32 diff) override
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
void DoAction(int32 actionId) override
npc_expedition_commander(Creature *creature)
void UpdateAI(uint32 diff) override
void BuildHarpoon(uint8 harpoonNumber)
void SetData(uint32 type, uint32 value) override
InstanceScript * _instance
bool CanAIAttack(Unit const *target) const override
npc_expedition_defender(Creature *creature)
void MovementInform(uint32 type, uint32 pointId) override
void DoAction(int32 actionId) override
void UpdateAI(uint32 diff) override
npc_expedition_engineer(Creature *creature)
void ChangeOrientation(float orientation)
void MovementInform(uint32 type, uint32 pointId) override
void SetData(uint32 type, uint32 value) override
void DoAction(int32 actionId) override
void UpdateAI(uint32 diff) override
void SetData(uint32 type, uint32 value) override
void DoAction(int32 actionId) override
npc_expedition_trapper(Creature *creature)
InstanceScript * _instance
void MovementInform(uint32 type, uint32 pointId) override
void EnterEvadeMode(EvadeReason) override
npc_razorscale_devouring_flame(Creature *creature)
npc_razorscale_harpoon_fire_state(Creature *creature)
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void UpdateAI(uint32 diff) override
npc_razorscale_spawner(Creature *creature)
@ DATA_RAZORSCALE
Definition: ulduar.h:39
@ DATA_EXPEDITION_COMMANDER
Definition: ulduar.h:398
@ GO_RAZOR_HARPOON_4
Definition: ulduar.h:255
@ GO_RAZOR_BROKEN_HARPOON
Definition: ulduar.h:256
@ GO_RAZOR_HARPOON_3
Definition: ulduar.h:254
@ GO_RAZOR_HARPOON_2
Definition: ulduar.h:253
@ GO_RAZOR_HARPOON_1
Definition: ulduar.h:252
#define RegisterUlduarCreatureAI(ai_name)
Definition: ulduar.h:524
@ NPC_RAZORSCALE_HARPOON_FIRE_STATE
Definition: ulduar.h:96
@ NPC_DARK_RUNE_GUARDIAN
Definition: ulduar.h:87
@ NPC_EXPEDITION_COMMANDER
Definition: ulduar.h:91
@ NPC_EXPEDITION_TRAPPER
Definition: ulduar.h:94
@ NPC_RAZORSCALE_CONTROLLER
Definition: ulduar.h:95
@ NPC_RAZORSCALE_SPAWNER
Definition: ulduar.h:90
@ NPC_EXPEDITION_ENGINEER
Definition: ulduar.h:92
@ NPC_RAZORSCALE
Definition: ulduar.h:64
@ NPC_EXPEDITION_DEFENDER
Definition: ulduar.h:93