TrinityCore
chapter5.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 "Map.h"
20#include "MotionMaster.h"
21#include "ObjectAccessor.h"
22#include "Player.h"
23#include "ScriptedEscortAI.h"
24#include "ScriptedGossip.h"
25#include "TemporarySummon.h"
26#include "WorldStateMgr.h"
27
28#define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell
29//Light of Dawn
31{
32#ifdef LESS_MOB
33 ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest, or -
34 ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data
35 ENCOUNTER_DEFENDER_NUMBER = 10, // how many of defender
36 ENCOUNTER_EARTHSHATTER_NUMBER = 1, // how many of earthshatter
37 ENCOUNTER_ABOMINATION_NUMBER = 2, // how many of abomination
38 ENCOUNTER_BEHEMOTH_NUMBER = 1, // how many of behemoth
39 ENCOUNTER_GHOUL_NUMBER = 5, // how many of ghoul
40 ENCOUNTER_WARRIOR_NUMBER = 1, // how many of warrior
41#else
42 ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest, or -
43 ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data
44 ENCOUNTER_DEFENDER_NUMBER = 20, // how many of defender
45 ENCOUNTER_EARTHSHATTER_NUMBER = 20, // how many of earthshatter
46 ENCOUNTER_ABOMINATION_NUMBER = 3, // how many of abomination
47 ENCOUNTER_BEHEMOTH_NUMBER = 2, // how many of behemoth
48 ENCOUNTER_GHOUL_NUMBER = 10, // how many of ghoul
49 ENCOUNTER_WARRIOR_NUMBER = 2, // how many of warrior
50#endif
51 ENCOUNTER_TOTAL_DAWN = 300, // Total number
53
60
61 SAY_LIGHT_OF_DAWN01 = 0, // pre text
64 SAY_LIGHT_OF_DAWN04 = 3, // intro
67 SAY_LIGHT_OF_DAWN07 = 6, // During the fight - Korfax, Champion of the Light
68 SAY_LIGHT_OF_DAWN08 = 7, // Lord Maxwell Tyrosus
69 SAY_LIGHT_OF_DAWN09 = 8, // Highlord Darion Mograine
70 SAY_LIGHT_OF_DAWN25 = 24, // After the fight
71 SAY_LIGHT_OF_DAWN26 = 25, // Highlord Tirion Fordring
72 SAY_LIGHT_OF_DAWN27 = 26, // Highlord Darion Mograine
73 SAY_LIGHT_OF_DAWN28 = 27, // Highlord Tirion Fordring
74 SAY_LIGHT_OF_DAWN29 = 28, // Highlord Tirion Fordring
75 SAY_LIGHT_OF_DAWN30 = 29, // Highlord Tirion Fordring
76 SAY_LIGHT_OF_DAWN31 = 30, // Highlord Tirion Fordring
77 SAY_LIGHT_OF_DAWN32 = 31, // Highlord Alexandros Mograine
78 SAY_LIGHT_OF_DAWN33 = 32, // Highlord Darion Mograine
79 SAY_LIGHT_OF_DAWN34 = 33, // Highlord Darion Mograine
80 SAY_LIGHT_OF_DAWN35 = 34, // Darion Mograine
81 SAY_LIGHT_OF_DAWN36 = 35, // Darion Mograine
82 SAY_LIGHT_OF_DAWN37 = 36, // Highlord Alexandros Mograine
83 SAY_LIGHT_OF_DAWN38 = 37, // Darion Mograine
84 SAY_LIGHT_OF_DAWN39 = 38, // Highlord Alexandros Mograine
85 SAY_LIGHT_OF_DAWN40 = 39, // Darion Mograine
86 SAY_LIGHT_OF_DAWN41 = 40, // Highlord Alexandros Mograine
87 SAY_LIGHT_OF_DAWN42 = 41, // Highlord Alexandros Mograine
88 SAY_LIGHT_OF_DAWN43 = 42, // The Lich King
89 SAY_LIGHT_OF_DAWN44 = 43, // Highlord Darion Mograine
90 SAY_LIGHT_OF_DAWN45 = 44, // The Lich King
91 SAY_LIGHT_OF_DAWN46 = 45, // The Lich King
92 SAY_LIGHT_OF_DAWN47 = 46, // Highlord Tirion Fordring
93 SAY_LIGHT_OF_DAWN48 = 47, // The Lich King
94 SAY_LIGHT_OF_DAWN49 = 48, // The Lich King
95 SAY_LIGHT_OF_DAWN50 = 49, // Lord Maxwell Tyrosus
96 SAY_LIGHT_OF_DAWN51 = 50, // The Lich King
97 SAY_LIGHT_OF_DAWN52 = 51, // Highlord Darion Mograine
98 SAY_LIGHT_OF_DAWN53 = 52, // Highlord Darion Mograine
99 SAY_LIGHT_OF_DAWN54 = 53, // Highlord Tirion Fordring
100 SAY_LIGHT_OF_DAWN55 = 54, // The Lich King
101 SAY_LIGHT_OF_DAWN56 = 55, // Highlord Tirion Fordring
102 SAY_LIGHT_OF_DAWN57 = 56, // The Lich King
103 SAY_LIGHT_OF_DAWN58 = 57, // The Lich King
104 SAY_LIGHT_OF_DAWN59 = 58, // The Lich King
105 SAY_LIGHT_OF_DAWN60 = 59, // Highlord Tirion Fordring
106 SAY_LIGHT_OF_DAWN61 = 60, // Highlord Tirion Fordring
107 SAY_LIGHT_OF_DAWN62 = 61, // Highlord Tirion Fordring
108 SAY_LIGHT_OF_DAWN63 = 62, // Highlord Tirion Fordring
109 SAY_LIGHT_OF_DAWN64 = 63, // Highlord Tirion Fordring
110 SAY_LIGHT_OF_DAWN65 = 64, // Highlord Tirion Fordring
111 SAY_LIGHT_OF_DAWN66 = 65, // Highlord Tirion Fordring
112 SAY_LIGHT_OF_DAWN67 = 66, // Highlord Tirion Fordring
113 SAY_LIGHT_OF_DAWN68 = 67, // Highlord Darion Mograine
114
115 EMOTE_LIGHT_OF_DAWN01 = 68, // Emotes
133
135 SPELL_THE_LIGHT_OF_DAWN_Q = 53606, // quest credit
136
137 // ---- Dark Knight npc --------------------
138 // Highlord Darion Mograine
145 SPELL_THE_MIGHT_OF_MOGRAINE = 53642, // on players when begins
150
151 // Koltira Deathweaver & Orbaz Bloodbane are using the same abilities
153 NPC_ORBAZ_BLOODBANE = 29204, // this guy fleed
154 NPC_THASSARIAN = 29200, // he also does SPELL_THE_LIGHT_OF_DAWN 53658
159 // all do SPELL_HERO_AGGRO_AURA 53627
160
161 // Lich King
162 NPC_THE_LICH_KING = 29183, // show up at end
165 SPELL_SOUL_FEAST_ALEX = 53677, // on Alexandros
166 SPELL_SOUL_FEAST_TIRION = 53685, // on Tirion
167 SPELL_ICEBOUND_VISAGE = 53274, // not sure what is it for
169
170 // others
175
176 NPC_FLESH_BEHEMOTH = 29190, // giant guy
177 SPELL_STOMP = 53634,
180
181 NPC_ACHERUS_GHOUL = 29219, // just ghoul....
183
184 NPC_WARRIOR_OF_THE_FROZEN_WASTES = 29206, // use SPELL_CLEAVE 53631
185
187 NPC_DARION_MOGRAINE = 29228, // ghost
188
189 // ---- Dawn npc --------------------
190 // Highlord Tirion Fordring
197
198 // others
202
206
209
210 NPC_RAYNE = 29181,
214 SPELL_WRATH = 21807,
215
216 NPC_DEFENDER_OF_THE_LIGHT = 29174, // also does SPELL_HEROIC_LEAP 53625
221
224 SPELL_THUNDER = 53630
226
228{
229 {2281.335f, -5300.409f, 85.170f, 0}, // 0 Tirion Fordring loc
230 {2283.896f, -5287.914f, 83.066f, 1.55f}, // 1 Tirion Fordring loc2
231 {2281.461f, -5263.014f, 81.164f, 0}, // 2 Tirion charges
232 {2262.277f, -5293.477f, 82.167f, 0}, // 3 Tirion run
233 {2270.286f, -5287.73f, 82.262f, 0}, // 4 Tirion relocate
234 {2269.511f, -5288.289f, 82.225f, 0}, // 5 Tirion forward
235 {2262.277f, -5293.477f, 82.167f, 0}, // 6 Tirion runs to Darion
236 {2270.286f, -5287.73f, 82.262f, 0},
237 {2269.511f, -5288.289f, 82.225f, 0},
238 {2273.205f, -5288.848f, 82.617f, 0}, // 9 Korfax loc1
239 {2274.739f, -5287.926f, 82.684f, 0}, // 10 Korfax loc2
240 {2253.673f, -5318.004f, 81.724f, 0}, // 11 Korfax kicked
241 {2287.028f, -5309.644f, 87.253f, 0}, // 12 Maxwell loc1
242 {2286.978f, -5308.025f, 86.83f, 0}, // 13 Maxwell loc2
243 {2248.877f, -5307.586f, 82.166f, 0}, // 14 maxwell kicked
244 {2278.58f, -5316.933f, 88.319f, 0}, // 15 Eligor loc1
245 {2278.535f, -5315.479f, 88.08f, 0}, // 16 Eligor loc2
246 {2259.416f, -5304.505f, 82.149f, 0}, // 17 eligor kicked
247 {2289.259f, -5280.355f, 82.112f, 0}, // 18 Koltira loc1
248 {2289.02f, -5281.985f, 82.207f, 0}, // 19 Koltira loc2
249 {2273.289f, -5273.675f, 81.701f, 0}, // 20 Thassarian loc1
250 {2273.332f, -5275.544f, 81.849f, 0}, // 21 Thassarian loc2
251 {2281.198f, -5257.397f, 80.224f, 4.66f}, // 22 Alexandros loc1
252 {2281.156f, -5259.934f, 80.647f, 0}, // 23 Alexandros loc2
253 {2281.294f, -5281.895f, 82.445f, 1.35f}, // 24 Darion loc1
254 {2281.093f, -5263.013f, 81.125f, 0}, // 25 Darion loc1
255 {2281.313f, -5250.282f, 79.322f, 4.69f}, // 26 Lich King spawns
256 {2281.523f, -5261.058f, 80.877f, 0}, // 27 Lich king move forwards
257 {2272.709f, -5255.552f, 78.226f, 0}, // 28 Lich king kicked
258 {2273.972f, -5257.676f, 78.862f, 0}, // 29 Lich king moves forward
259};
260
261static constexpr uint32 PATH_ESCORT_MOGRAINE = 233386;
262
264{
265public:
266 npc_highlord_darion_mograine() : CreatureScript("npc_highlord_darion_mograine") { }
267
269 {
271 {
272 Initialize();
273 }
274
276 {
277 bIsBattle = false;
278 uiStep = 0;
279 uiPhase_timer = 3000;
280 uiFight_duration = 300000; // 5 minutes
284
285 uiAnti_magic_zone = urand(1000, 6000);
286 uiDeath_strike = urand(5000, 10000);
287 uiDeath_embrace = urand(5000, 10000);
288 uiIcy_touch = urand(5000, 10000);
289 uiUnholy_blight = urand(5000, 10000);
290
291 uiFight_speech = 15000;
292 uiSpawncheck = 1000;
293 uiTargetcheck = 10000;
294 }
295
303
304 // Darion Mograine
313
314 // Dawn
324
325 // Death
334
335 void Reset() override
336 {
338 {
339 Initialize();
340
342 me->Mount(25279);
343 me->SetVisible(true);
344
346 //sWorldStateMgr->SetValue(WORLD_STATE_SHOW_MINUTES_UNTIL_BATTLE, 0, false, me->GetMap());
348
350 temp->setDeathState(JUST_DIED);
352 temp->setDeathState(JUST_DIED);
354 temp->setDeathState(JUST_DIED);
356 temp->setDeathState(JUST_DIED);
358 temp->setDeathState(JUST_DIED);
359
365
366 for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
367 {
369 temp->setDeathState(JUST_DIED);
371 }
372 for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
373 {
375 temp->setDeathState(JUST_DIED);
377 }
378
380 temp->Respawn();
382 temp->Respawn();
384 temp->Respawn();
386 temp->Respawn();
387
392 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
393 {
395 temp->setDeathState(JUST_DIED);
397 }
398 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
399 {
401 temp->setDeathState(JUST_DIED);
403 }
404 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
405 {
407 temp->setDeathState(JUST_DIED);
408 uiGhoulGUID[i].Clear();
409 }
410 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
411 {
413 temp->setDeathState(JUST_DIED);
414 uiWarriorGUID[i].Clear();
415 }
416 }
417 }
418
419 void AttackStart(Unit* who) override
420 {
421 if (!who)
422 return;
423
424 if (who == me)
425 return;
426
427 if (me->Attack(who, true))
428 {
429 AddThreat(who, 0.0f);
430 me->SetInCombatWith(who);
431 who->SetInCombatWith(me);
432 DoStartMovement(who);
433 }
434 }
435
436 void MoveInLineOfSight(Unit* who) override
437
438 {
439 if (!who)
440 return;
441
442 if (me->IsValidAttackTarget(who))
443 if (me->IsWithinDistInMap(who, 20) && me->IsWithinLOSInMap(who))
444 AttackStart(who);
445 }
446
447 void SetHoldState(bool bOnHold)
448 {
449 SetEscortPaused(bOnHold);
450 }
451
452 void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
453 {
454 switch (waypointId)
455 {
456 case 0:
457 me->SetWalk(false);
458 SetHoldState(true);
459 break;
460 case 1:
461 SetHoldState(true);
462 SpawnNPC();
464 temp->AI()->Talk(SAY_LIGHT_OF_DAWN07);
466 temp->AI()->Talk(SAY_LIGHT_OF_DAWN08);
467
468 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
470 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
472 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
474 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
479
480 me->Dismount();
481 me->CastSpell(me, SPELL_THE_MIGHT_OF_MOGRAINE, true); // need to fix, on player only
482
484 temp->Dismount();
486 temp->Dismount();
487
488 bIsBattle = true;
489 break;
490 case 2:
491 me->SetWalk(true);
493 break;
494 case 3:
495 {
496 //Unit* pTirion = ObjectAccessor::GetCreature(*me, uiTirionGUID);
497
502 {
503 if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN))
504 temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
505 temp->SetWalk(true);
506 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19]);
507 }
509 {
510 if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN))
511 temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
512 temp->SetWalk(true);
513 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21]);
514 }
516 {
517 temp->SetWalk(true);
518 temp->SetEmoteState(EMOTE_STATE_READY2H);
519 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10]);
520 }
522 {
523 temp->SetWalk(true);
524 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13]);
525 }
527 {
528 temp->SetWalk(true);
529 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16]);
530 }
531 JumpToNextStep(10000);
532 }
533 break;
534 case 4:
537
539 temp->SetStandState(UNIT_STAND_STATE_KNEEL);
541 temp->SetStandState(UNIT_STAND_STATE_KNEEL);
542 SetHoldState(true);
543 break;
544 case 5:
546 SetHoldState(true);
547 break;
548 case 6:
549 SetHoldState(true);
551 JumpToNextStep(1000);
552 break;
553 case 7:
554 SetHoldState(true);
555 JumpToNextStep(2000);
556 break;
557 case 8:
560 me->CastSpell(temp, SPELL_ASHBRINGER, true);
562 SetHoldState(true);
563 break;
564 }
565 }
566
567 void EnterEvadeMode(EvadeReason why) override
568 {
569 if (!bIsBattle)//do not reset self if we are in battle
571 }
572
573 void UpdateAI(uint32 diff) override
574 {
575 EscortAI::UpdateAI(diff);
576
577 if (!bIsBattle)
578 {
579 if (uiPhase_timer <= diff)
580 {
581 // ******* Before battle *****************************************************************
582 switch (uiStep)
583 {
584 case 0: // countdown
585 //sWorldStateMgr->SetValue(WORLD_STATE_SHOW_MINUTES_UNTIL_BATTLE, 1, false, me->GetMap());
586 break;
587
588 case 1: // just delay
589 //sWorldStateMgr->SetValue(WORLD_STATE_SHOW_FORCES_REMAINING, 1, false, me->GetMap());
593 JumpToNextStep(3000);
594 break;
595
596 case 2:
599 uiKoltiraGUID = pKoltira->GetGUID();
601 uiOrbazGUID = pOrbaz->GetGUID();
602 if (Creature* pThassarian = GetClosestCreatureWithEntry(me, NPC_THASSARIAN, 50.0f))
603 uiThassarianGUID = pThassarian->GetGUID();
604 JumpToNextStep(10000);
605 break;
606
607 case 3: // rise
609 JumpToNextStep(3000);
610 break;
611
612 case 4: // summon ghoul
613 // Dunno whats the summon spell, so workaround
614 DoCast(me, 33271); // shack effect
615 uiPhase_timer = 500;
617 {
619 temp->SetWalk(false);
623 }
624 else
625 {
627 ++uiStep;
628 }
629 break;
630
631 case 5: // summon abomination
632 DoCast(me, 33271); // shack effect
633 uiPhase_timer = 500;
635 {
637 temp->SetWalk(false);
641 }
642 else
643 {
645 ++uiStep;
646 }
647 break;
648
649 case 6: // summon warrior
650 DoCast(me, 33271); // shack effect
651 uiPhase_timer = 500;
653 {
655 temp->SetWalk(false);
659 }
660 else
661 {
663 ++uiStep;
664 }
665 break;
666
667 case 7: // summon warrior
668 DoCast(me, 33271); // shack effect
669 uiPhase_timer = 500;
671 {
673 temp->SetWalk(false);
677 }
678 else
679 {
681 ++uiStep;
682 }
683 break;
684
685 case 8: // summon announce
687 JumpToNextStep(5000);
688 break;
689
690 case 9: // charge begins
691 SetHoldState(false);
693 {
694 temp->SetWalk(false);
695 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
696 }
698 {
699 temp->SetWalk(false);
700 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
701 }
703 {
704 temp->SetWalk(false);
705 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
706 }
707 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
709 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
710 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
712 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
713 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
715 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
716 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
718 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
719 JumpToNextStep(5000);
720 break;
721
722 // ******* After battle *****************************************************************
723 case 11: // Tirion starts to speak
725 temp->AI()->Talk(SAY_LIGHT_OF_DAWN28);
726 JumpToNextStep(21000);
727 break;
728
729 case 12:
731 temp->AI()->Talk(SAY_LIGHT_OF_DAWN29);
732 JumpToNextStep(13000);
733 break;
734
735 case 13:
737 temp->AI()->Talk(SAY_LIGHT_OF_DAWN30);
738 JumpToNextStep(13000);
739 break;
740
741 case 14:
744 JumpToNextStep(7000);
745 break;
746
747 case 15: // summon gate
749 {
750 temp->SetUninteractible(true);
751 temp->CastSpell(temp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true);
752 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN06);
753 uiAlexandrosGUID = temp->GetGUID();
754 }
755 JumpToNextStep(4000);
756 break;
757
758 case 16: // Alexandros out
760 {
761 temp->SetUninteractible(false);
762 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23]);
763 temp->AI()->Talk(SAY_LIGHT_OF_DAWN32);
764 }
765 SetHoldState(false); // makes darion turns back
766 JumpToNextStep(5000);
767 break;
768
769 case 17:
772 JumpToNextStep(5000);
773 break;
774
775 case 18: // Darion's spirit out
777 {
778 temp->AI()->Talk(SAY_LIGHT_OF_DAWN35);
779 temp->SetWalk(false);
780 uiDarionGUID = temp->GetGUID();
781 }
782 JumpToNextStep(4000);
783 break;
784
785 case 19: // runs to father
787 {
788 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN07);
789 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25]);
790 }
791 JumpToNextStep(4000);
792 break;
793
794 case 20:
796 temp->AI()->Talk(SAY_LIGHT_OF_DAWN36);
797 JumpToNextStep(4000);
798 break;
799
800 case 21:
802 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN08);
803 JumpToNextStep(4000);
804 break;
805
806 case 22:
808 temp->AI()->Talk(SAY_LIGHT_OF_DAWN37);
809 JumpToNextStep(8000);
810 break;
811
812 case 23:
814 temp->AI()->Talk(SAY_LIGHT_OF_DAWN38);
815 JumpToNextStep(8000);
816 break;
817
818 case 24:
820 temp->AI()->Talk(SAY_LIGHT_OF_DAWN39);
821
822 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID)) // Tirion moves forward here
823 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1]);
824
825 JumpToNextStep(15000);
826 break;
827
828 case 25:
830 temp->AI()->Talk(SAY_LIGHT_OF_DAWN40);
831 JumpToNextStep(11000);
832 break;
833
834 case 26:
836 temp->AI()->Talk(SAY_LIGHT_OF_DAWN41);
837 JumpToNextStep(5000);
838 break;
839
840 case 27:
842 temp->setDeathState(JUST_DIED);
843 JumpToNextStep(24000);
844 break;
845
846 case 28:
848 temp->AI()->Talk(SAY_LIGHT_OF_DAWN42);
849 JumpToNextStep(6000);
850 break;
851
852 case 29: // lich king spawns
854 {
855 temp->AI()->Talk(SAY_LIGHT_OF_DAWN43);
856 uiLichKingGUID = temp->GetGUID();
858 temp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false);
859 }
860 JumpToNextStep(2000);
861 break;
862
863 case 30:
864 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiAlexandrosGUID)) // just hide him
865 {
866 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN09);
867 temp->SetVisible(false);
868 }
870 {
871 temp->InterruptNonMeleeSpells(false);
872 temp->AI()->Talk(SAY_LIGHT_OF_DAWN45);
873 }
874 JumpToNextStep(3000);
875 break;
876
877 case 31:
881 JumpToNextStep(3000);
882 break;
883
884 case 32:
886 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[27]);
887 JumpToNextStep(6000);
888 break;
889
890 case 33: // Darion supports to jump to lich king here
892 DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge
893 // doesn't make it looks well, so workarounds, Darion charges, looks better
894 me->SetSpeedRate(MOVE_RUN, 3.0f);
895 me->SetWalk(false);
896 SetHoldState(false);
898 break;
899
900 case 35: // Lich king counterattacks
902 {
903 temp->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
904 temp->AI()->Talk(SAY_LIGHT_OF_DAWN46);
905 }
906 me->SetSpeedRate(MOVE_RUN, 6.0f);
908 SetHoldState(false); // Darion got kicked by lich king
910 break;
911
912 case 37: // Lich king counterattacks
914 JumpToNextStep(3000);
915 break;
916
917 case 38:
919 temp->AI()->Talk(SAY_LIGHT_OF_DAWN47);
920 JumpToNextStep(8000);
921 break;
922
923 case 39:
925 temp->AI()->Talk(SAY_LIGHT_OF_DAWN48);
926 JumpToNextStep(15000);
927 break;
928
929 case 40:
931 temp->AI()->Talk(SAY_LIGHT_OF_DAWN49);
932 JumpToNextStep(17000);
933 break;
934
935 case 41: // Lich king - Apocalypse
937 {
938 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN11);
939 temp->AI()->Talk(SAY_LIGHT_OF_DAWN51);
941 {
942 pTirion->SetStandState(UNIT_STAND_STATE_KNEEL);
943 //temp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working
944 temp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false);
945 pTirion->AI()->Talk(EMOTE_LIGHT_OF_DAWN12);
946 }
947 }
948 JumpToNextStep(2000);
949 break;
950
951 case 42: // Maxwell yells for attack
952 {
953 float fLichPositionX = 0,
954 fLichPositionY = 0,
955 fLichPositionZ = 0;
957 {
958 fLichPositionX = temp->GetPositionX();
959 fLichPositionY = temp->GetPositionY();
960 fLichPositionZ = temp->GetPositionZ();
961 }
962
963 if (fLichPositionX && fLichPositionY)
964 {
965 Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10s);
967 temp->SetWalk(false);
968 temp->SetSpeedRate(MOVE_RUN, 2.0f);
969 temp->SetFaction(me->GetFaction());
970 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
971 uiDefenderGUID[0] = temp->GetGUID();
972
973 temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10s);
975 temp->SetWalk(false);
976 temp->SetSpeedRate(MOVE_RUN, 2.0f);
977 temp->SetFaction(me->GetFaction());
978 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
979 uiEarthshatterGUID[0] = temp->GetGUID();
980 }
982 {
983 temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
984 temp->SetWalk(false);
985 temp->SetSpeedRate(MOVE_RUN, 2.0f);
986 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
987 temp->AI()->Talk(SAY_LIGHT_OF_DAWN50);
988 }
990 {
991 temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
992 temp->SetWalk(false);
993 temp->SetSpeedRate(MOVE_RUN, 2.0f);
994 temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED);
995 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
996 }
998 {
999 temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
1000 temp->SetWalk(false);
1001 temp->SetSpeedRate(MOVE_RUN, 2.0f);
1002 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
1003 }
1004 }
1005 JumpToNextStep(4500);
1006 break;
1007
1008 case 43: // They all got kicked
1010 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN13);
1011
1013 {
1014 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1015 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1016 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1017 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14]);
1018 }
1020 {
1021 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1022 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1023 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1024 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11]);
1025 }
1027 {
1028 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1029 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1030 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1031 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17]);
1032 }
1034 {
1035 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1036 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1037 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }));
1038 }
1040 {
1041 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1042 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1043 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }));
1044 }
1045 JumpToNextStep(3000);
1046 break;
1047
1048 case 44: // make them stand up
1050 temp->SetStandState(UNIT_STAND_STATE_STAND);
1052 temp->SetStandState(UNIT_STAND_STATE_STAND);
1054 temp->SetStandState(UNIT_STAND_STATE_STAND);
1055 JumpToNextStep(1000);
1056 break;
1057
1058 case 45:
1060 JumpToNextStep(5000);
1061 break;
1062
1063 case 46: // Darion stand up, "not today"
1064 me->SetSpeedRate(MOVE_RUN, 1.0f);
1065 me->SetWalk(true);
1068 SetHoldState(false); // Darion throws sword
1069 JumpToNextStep(7000);
1070 break;
1071
1072 case 47: // Ashbringer rebirth
1076 {
1077 temp->SetStandState(UNIT_STAND_STATE_STAND);
1078 temp->SetVirtualItem(0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING));
1079 temp->CastSpell(temp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false);
1080 }
1081 JumpToNextStep(1000);
1082 break;
1083
1084 case 48: // Show the cleansing effect (dawn of light)
1085 //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID))
1086 // go->SetPhaseMask(128, true);
1087 me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896f, -5287.914f, 83.066f, 0.f, QuaternionData(), 30s);
1089 {
1090 if (temp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER))
1091 temp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER);
1092 temp->CastSpell(temp, 41542, false); // workarounds, light expoded, makes it cool
1093 temp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
1094 }
1096 temp->InterruptNonMeleeSpells(false);
1097 JumpToNextStep(2500);
1098 break;
1099
1100 case 49:
1102 temp->AI()->Talk(SAY_LIGHT_OF_DAWN54);
1103 JumpToNextStep(4000);
1104 break;
1105
1106 case 50:
1108 temp->AI()->Talk(SAY_LIGHT_OF_DAWN55);
1109 JumpToNextStep(5000);
1110 break;
1111
1112 case 51:
1114 temp->AI()->Talk(SAY_LIGHT_OF_DAWN56);
1115 JumpToNextStep(1000);
1116 break;
1117
1118 case 52: // Tiron charges
1120 {
1121 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN16);
1122 temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge
1123 temp->SetEmoteState(EMOTE_STATE_READY2H);
1124 temp->SetSpeedRate(MOVE_RUN, 3.0f); // workarounds, make Tirion still running
1125 temp->SetWalk(false);
1126 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2]);
1128 lktemp->Relocate(LightofDawnLoc[28]); // workarounds, he should kick back by Tirion, but here we relocate him
1129 }
1130 JumpToNextStep(1500);
1131 break;
1132
1133 case 53:
1135 temp->AI()->Talk(SAY_LIGHT_OF_DAWN57);
1136 JumpToNextStep(1000);
1137 break;
1138
1139 case 54:
1141 {
1142 temp->SetSpeedRate(MOVE_RUN, 1.0f);
1143 me->SetWalk(true);
1144 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29]); // 26
1145 }
1146 JumpToNextStep(4000);
1147 break;
1148
1149 case 55:
1151 temp->SetStandState(UNIT_STAND_STATE_KNEEL);
1152 JumpToNextStep(2000);
1153 break;
1154
1155 case 56:
1157 temp->SetStandState(UNIT_STAND_STATE_STAND);
1158 JumpToNextStep(1500);
1159 break;
1160
1161 case 57:
1163 temp->AI()->Talk(SAY_LIGHT_OF_DAWN58);
1164 JumpToNextStep(10000);
1165 break;
1166
1167 case 58:
1169 temp->AI()->Talk(SAY_LIGHT_OF_DAWN59);
1170 JumpToNextStep(10000);
1171 break;
1172
1173 case 59:
1175 temp->CastSpell(temp, SPELL_TELEPORT_VISUAL, false);
1176 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion
1177 {
1178 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1179 temp->SetSpeedRate(MOVE_RUN, 1.0f);
1180 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6]);
1181 }
1182 JumpToNextStep(2500);
1183 break;
1184
1185 case 60:
1186 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiLichKingGUID)) // Lich king disappears here
1187 {
1188 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN17);
1189 temp->KillSelf();
1190 }
1191 JumpToNextStep(10000);
1192 break;
1193
1194 case 61:
1196 temp->AI()->Talk(SAY_LIGHT_OF_DAWN60);
1197 JumpToNextStep(3000);
1198 break;
1199
1200 case 62:
1202 {
1203 temp->SetWalk(true);
1204 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7]);
1205 }
1206 JumpToNextStep(5500);
1207 break;
1208
1209 case 63:
1211 {
1212 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8]);
1213 temp->AI()->Talk(SAY_LIGHT_OF_DAWN61);
1214 }
1215 JumpToNextStep(15000);
1216 break;
1217
1218 case 64:
1220 temp->AI()->Talk(SAY_LIGHT_OF_DAWN62);
1221 JumpToNextStep(7000);
1222 break;
1223
1224 case 65:
1226 temp->AI()->Talk(SAY_LIGHT_OF_DAWN63);
1227 JumpToNextStep(10000);
1228 break;
1229
1230 case 66:
1232 temp->AI()->Talk(SAY_LIGHT_OF_DAWN64);
1233 JumpToNextStep(11000);
1234 break;
1235
1236 case 67:
1238 temp->AI()->Talk(SAY_LIGHT_OF_DAWN65);
1239 JumpToNextStep(10000);
1240 break;
1241
1242 case 68:
1244 temp->AI()->Talk(SAY_LIGHT_OF_DAWN66);
1245 JumpToNextStep(8000);
1246 break;
1247
1248 case 69:
1250 temp->AI()->Talk(SAY_LIGHT_OF_DAWN67);
1251 JumpToNextStep(10000);
1252 break;
1253
1254 case 70:
1257 JumpToNextStep(10000);
1258 break;
1259
1260 case 71:
1261 //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light
1262 // go->SetPhaseMask(0, true);
1263 {
1264 // search players with in 50 yards for quest credit
1265 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
1266 if (!PlayerList.isEmpty())
1267 {
1268 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
1269 if (me->IsWithinDistInMap(i->GetSource(), 500))
1270 i->GetSource()->CastSpell(i->GetSource(), SPELL_THE_LIGHT_OF_DAWN_Q, false);
1271 }
1272 }
1273 me->SetVisible(false); // respawns another Darion for quest turn in
1275 JumpToNextStep(1000);
1276 break;
1277
1278 case 72:
1279 SetHoldState(false); // Escort ends
1280 JumpToNextStep(25000);
1281 break;
1282
1283 case 73:
1285 temp->DespawnOrUnsummon();
1287 temp->DespawnOrUnsummon();
1289 temp->DespawnOrUnsummon();
1291 temp->DespawnOrUnsummon();
1293 break;
1294 }
1295
1296 } else uiPhase_timer -= diff;
1297 }
1298
1299 // ******* During battle *****************************************************************
1300 else
1301 {
1302 if (uiAnti_magic_zone <= diff)
1303 {
1305 uiAnti_magic_zone = urand(25000, 30000);
1306 } else uiAnti_magic_zone -= diff;
1307
1308 if (uiDeath_strike <= diff)
1309 {
1311 uiDeath_strike = urand(5000, 10000);
1312 } else uiDeath_strike -= diff;
1313
1314 if (uiDeath_embrace <= diff)
1315 {
1317 uiDeath_embrace = urand(5000, 10000);
1318 } else uiDeath_embrace -= diff;
1319
1320 if (uiIcy_touch <= diff)
1321 {
1323 uiIcy_touch = urand(5000, 10000);
1324 } else uiIcy_touch -= diff;
1325
1326 if (uiUnholy_blight <= diff)
1327 {
1329 uiUnholy_blight = urand(5000, 10000);
1330 } else uiUnholy_blight -= diff;
1331
1332 if (uiFight_speech <= diff)
1333 {
1335 uiFight_speech = urand(15000, 20000);
1336 } else uiFight_speech -= diff;
1337
1338 // Check spawns
1339 if (uiSpawncheck <= diff)
1340 {
1341 SpawnNPC();
1342 uiSpawncheck = 1000;
1343 } else uiSpawncheck -= diff;
1344
1345 // Check targets
1346 if (uiTargetcheck <= diff)
1347 {
1348 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
1350 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
1352 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
1354 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
1359
1360 uiTargetcheck = 10000;
1361 } else uiTargetcheck -= diff;
1362
1363 // Battle end
1364 if (uiFight_duration <= diff + 5000)
1365 {
1366 if (!uiTirionGUID)
1368 {
1369 temp->SetFaction(me->GetFaction());
1370 temp->SetVirtualItem(0, uint32(EQUIP_UNEQUIP));
1371 temp->AI()->Talk(SAY_LIGHT_OF_DAWN25);
1372 uiTirionGUID = temp->GetGUID();
1373 }
1374 }
1375 if (uiFight_duration <= diff)
1376 {
1377 bIsBattle = false;
1378 uiFight_duration = 300000;
1379
1382 me->RemoveAllAuras();
1383 me->CombatStop(true);
1385 me->SetWalk(false);
1386
1388
1389 for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
1391 for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
1393 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
1395 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
1397 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
1399 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
1401
1403 {
1404 temp->AI()->EnterEvadeMode();
1405 temp->RemoveAllAuras();
1406 temp->CombatStop(true);
1407 temp->AttackStop();
1408 temp->SetFaction(me->GetFaction());
1409 temp->SetWalk(false);
1410 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9]);
1411 }
1412
1414 {
1415 temp->RemoveAllAuras();
1416 temp->CombatStop(true);
1417 temp->AttackStop();
1418 temp->SetFaction(me->GetFaction());
1419 temp->SetWalk(false);
1420 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12]);
1421 }
1422
1424 {
1425 temp->AI()->EnterEvadeMode();
1426 temp->RemoveAllAuras();
1427 temp->CombatStop(true);
1428 temp->AttackStop();
1429 temp->SetFaction(me->GetFaction());
1430 temp->SetWalk(false);
1431 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15]);
1432 }
1434
1436 {
1437 temp->AI()->EnterEvadeMode();
1438 temp->RemoveAllAuras();
1439 temp->CombatStop(true);
1440 temp->AttackStop();
1441 temp->SetFaction(me->GetFaction());
1442 temp->SetWalk(false);
1443 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18]);
1444 temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
1445 }
1446
1448 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN04);
1449
1451 {
1452 temp->AI()->EnterEvadeMode();
1453 temp->RemoveAllAuras();
1454 temp->CombatStop(true);
1455 temp->AttackStop();
1456 temp->SetFaction(me->GetFaction());
1457 temp->SetWalk(false);
1458 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20]);
1459 temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
1460 }
1461
1463 temp->AI()->Talk(SAY_LIGHT_OF_DAWN26);
1464
1465 SetHoldState(false);
1466
1467 } else uiFight_duration -= diff;
1468 }
1469 }
1470
1472 {
1473 uiPhase_timer = uiTimer;
1474 ++uiStep;
1475 }
1476
1478 {
1479 if (Creature* temp = ObjectAccessor::GetCreature(*me, ui_GUID))
1480 if (temp->IsAlive())
1481 if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0))
1482 if (pTarget->IsAlive())
1483 {
1484 AddThreat(pTarget, 0.0f, temp);
1485 temp->AI()->AttackStart(pTarget);
1486 }
1487 }
1488
1490 {
1491 Unit* temp = nullptr;
1492
1493 // Death
1494 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
1495 {
1497 if (!temp)
1498 {
1499 temp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1501 uiGhoulGUID[i] = temp->GetGUID();
1502 }
1503 }
1504 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
1505 {
1507 if (!temp)
1508 {
1509 temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1511 uiAbominationGUID[i] = temp->GetGUID();
1512 }
1513 }
1514 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
1515 {
1517 if (!temp)
1518 {
1519 temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1521 uiWarriorGUID[i] = temp->GetGUID();
1522 }
1523 }
1524 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
1525 {
1527 if (!temp)
1528 {
1529 temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1531 uiBehemothGUID[i] = temp->GetGUID();
1532 }
1533 }
1534
1535 // Dawn
1536 for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
1537 {
1539 if (!temp)
1540 {
1541 temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1543 AddThreat(temp, 0.0f);
1544 uiDefenderGUID[i] = temp->GetGUID();
1545 }
1546 }
1547 for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
1548 {
1550 if (!temp)
1551 {
1552 temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1554 AddThreat(temp, 0.0f);
1555 uiEarthshatterGUID[i] = temp->GetGUID();
1556 }
1557 }
1559 if (!temp)
1560 {
1561 temp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10min);
1563 AddThreat(temp, 0.0f);
1564 uiKorfaxGUID = temp->GetGUID();
1565 }
1567 if (!temp)
1568 {
1569 temp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10min);
1571 AddThreat(temp, 0.0f);
1572 uiMaxwellGUID = temp->GetGUID();
1573 }
1575 if (!temp)
1576 {
1577 temp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10min);
1579 AddThreat(temp, 0.0f);
1580 uiEligorGUID = temp->GetGUID();
1581 }
1583 if (!temp)
1584 {
1585 temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1587 AddThreat(temp, 0.0f);
1588 uiRayneGUID = temp->GetGUID();
1589 }
1590 }
1591
1593 {
1594 if (Creature* temp = ObjectAccessor::GetCreature(*me, pGUID))
1595 if (temp->IsAlive())
1596 {
1597 temp->SetVisible(false);
1598 temp->KillSelf();
1599 }
1600 }
1601
1602 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
1603 {
1604 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
1605 ClearGossipMenuFor(player);
1606 switch (action)
1607 {
1608 case GOSSIP_ACTION_INFO_DEF + 1:
1609 CloseGossipMenuFor(player);
1610 uiStep = 1;
1612 Start(true, player->GetGUID());
1613 break;
1614 }
1615 return true;
1616 }
1617
1618 bool OnGossipHello(Player* player) override
1619 {
1620 if (me->IsQuestGiver())
1621 player->PrepareQuestMenu(me->GetGUID());
1622
1623 if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE)
1625
1626 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1627
1628 return true;
1629 }
1630 };
1631
1632 CreatureAI* GetAI(Creature* creature) const override
1633 {
1634 return new npc_highlord_darion_mograineAI(creature);
1635 }
1636};
1637
1638/*######
1639## npc the lich king in dawn of light
1640######*/
1642{
1643public:
1644 npc_the_lich_king_tirion_dawn() : CreatureScript("npc_the_lich_king_tirion_dawn") { }
1645
1646 CreatureAI* GetAI(Creature* creature) const override
1647 {
1648 return new npc_the_lich_king_tirion_dawnAI(creature);
1649 }
1650
1652 {
1654 void Reset() override { }
1655 void AttackStart(Unit* /*who*/) override { } // very simple, just don't make them aggreesive
1656 void UpdateAI(uint32 /*diff*/) override { }
1657 void JustDied(Unit* /*killer*/) override { }
1658 };
1659
1660};
1661
1663{
1666}
@ EQUIP_UNEQUIP
Definition: CreatureAI.h:55
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition: ObjectDefines.h:64
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:145
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
uint32 rand32()
Definition: Random.cpp:70
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive=true)
@ STATE_ESCORT_ESCORTING
void AddGossipItemFor(Player *player, GossipOptionNpc optionNpc, std::string text, uint32 sender, uint32 action)
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
void ClearGossipMenuFor(Player *player)
void CloseGossipMenuFor(Player *player)
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
@ EMOTE_ONESHOT_SPECIALATTACK1H
@ EMOTE_ONESHOT_KICK
@ EMOTE_ONESHOT_ROAR
@ EMOTE_STATE_READY2H
@ EMOTE_ONESHOT_NONE
@ EMOTE_STATE_ATTACK_UNARMED
@ FACTION_SCARLET_CRUSADE
@ FACTION_UNDEAD_SCOURGE_3
EvadeReason
Definition: UnitAICommon.h:30
@ MOVE_RUN
Definition: UnitDefines.h:118
@ UNIT_STAND_STATE_DEAD
Definition: UnitDefines.h:49
@ UNIT_STAND_STATE_KNEEL
Definition: UnitDefines.h:50
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:42
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
@ JUST_DIED
Definition: Unit.h:247
#define sWorldStateMgr
Definition: WorldStateMgr.h:50
Position const LightofDawnLoc[]
Definition: chapter5.cpp:227
mograine
Definition: chapter5.cpp:31
@ SPELL_STOMP
Definition: chapter5.cpp:177
@ SAY_LIGHT_OF_DAWN27
Definition: chapter5.cpp:72
@ SPELL_HOLY_WRATH
Definition: chapter5.cpp:219
@ SAY_LIGHT_OF_DAWN01
Definition: chapter5.cpp:61
@ SPELL_SCOURGE_AGGRO_AURA
Definition: chapter5.cpp:174
@ EMOTE_LIGHT_OF_DAWN02
Definition: chapter5.cpp:116
@ SPELL_PLAGUE_STRIKE1
Definition: chapter5.cpp:158
@ WORLD_STATE_SHOW_FORCES_REMAINING
Definition: chapter5.cpp:56
@ NPC_THE_LICH_KING
Definition: chapter5.cpp:162
@ SPELL_TIRION_CHARGE
Definition: chapter5.cpp:195
@ SPELL_CLEAVE
Definition: chapter5.cpp:200
@ SPELL_ASHBRINGER
Definition: chapter5.cpp:149
@ SAY_LIGHT_OF_DAWN59
Definition: chapter5.cpp:104
@ SAY_LIGHT_OF_DAWN53
Definition: chapter5.cpp:98
@ SAY_LIGHT_OF_DAWN38
Definition: chapter5.cpp:83
@ SPELL_DEATH_EMBRACE
Definition: chapter5.cpp:142
@ SPELL_BLOOD_STRIKE1
Definition: chapter5.cpp:155
@ SPELL_SCOURGE_HOOK
Definition: chapter5.cpp:173
@ EMOTE_LIGHT_OF_DAWN03
Definition: chapter5.cpp:117
@ SPELL_MOGRAINE_CHARGE
Definition: chapter5.cpp:148
@ SAY_LIGHT_OF_DAWN49
Definition: chapter5.cpp:94
@ SAY_LIGHT_OF_DAWN32
Definition: chapter5.cpp:77
@ SAY_LIGHT_OF_DAWN52
Definition: chapter5.cpp:97
@ SAY_LIGHT_OF_DAWN37
Definition: chapter5.cpp:82
@ SAY_LIGHT_OF_DAWN08
Definition: chapter5.cpp:68
@ SAY_LIGHT_OF_DAWN09
Definition: chapter5.cpp:69
@ EMOTE_LIGHT_OF_DAWN15
Definition: chapter5.cpp:129
@ WORLD_STATE_BATTLE_IN_PROGRESS
Definition: chapter5.cpp:59
@ SPELL_DEATH_STRIKE
Definition: chapter5.cpp:141
@ SAY_LIGHT_OF_DAWN42
Definition: chapter5.cpp:87
@ SPELL_THE_LIGHT_OF_DAWN
Definition: chapter5.cpp:144
@ SPELL_THE_MIGHT_OF_MOGRAINE
Definition: chapter5.cpp:145
@ WORLD_STATE_FORCES_OF_THE_LIGHT_REMAINING
Definition: chapter5.cpp:54
@ NPC_FLESH_BEHEMOTH
Definition: chapter5.cpp:176
@ WORLD_STATE_FORCES_OF_THE_SCOURGE_REMAINING
Definition: chapter5.cpp:55
@ EMOTE_LIGHT_OF_DAWN10
Definition: chapter5.cpp:124
@ SAY_LIGHT_OF_DAWN02
Definition: chapter5.cpp:62
@ SAY_LIGHT_OF_DAWN04
Definition: chapter5.cpp:64
@ NPC_RAMPAGING_ABOMINATION
Definition: chapter5.cpp:171
@ SPELL_ICY_TOUCH2
Definition: chapter5.cpp:157
@ SAY_LIGHT_OF_DAWN67
Definition: chapter5.cpp:112
@ EMOTE_LIGHT_OF_DAWN08
Definition: chapter5.cpp:122
@ ENCOUNTER_DK_NUMBER
Definition: chapter5.cpp:33
@ SAY_LIGHT_OF_DAWN29
Definition: chapter5.cpp:74
@ NPC_HIGHLORD_TIRION_FORDRING
Definition: chapter5.cpp:191
@ SAY_LIGHT_OF_DAWN56
Definition: chapter5.cpp:101
@ NPC_DEFENDER_OF_THE_LIGHT
Definition: chapter5.cpp:216
@ SAY_LIGHT_OF_DAWN61
Definition: chapter5.cpp:106
@ SAY_LIGHT_OF_DAWN47
Definition: chapter5.cpp:92
@ SPELL_HEROIC_LEAP
Definition: chapter5.cpp:201
@ SAY_LIGHT_OF_DAWN54
Definition: chapter5.cpp:99
@ SPELL_SOUL_FEAST_TIRION
Definition: chapter5.cpp:166
@ SPELL_CHAIN_HEAL
Definition: chapter5.cpp:223
@ EMOTE_LIGHT_OF_DAWN18
Definition: chapter5.cpp:132
@ SPELL_UNHOLY_BLIGHT
Definition: chapter5.cpp:146
@ GO_LIGHT_OF_DAWN
Definition: chapter5.cpp:134
@ SAY_LIGHT_OF_DAWN26
Definition: chapter5.cpp:71
@ ENCOUNTER_TOTAL_DAWN
Definition: chapter5.cpp:51
@ SPELL_ICEBOUND_VISAGE
Definition: chapter5.cpp:167
@ EMOTE_LIGHT_OF_DAWN13
Definition: chapter5.cpp:127
@ SAY_LIGHT_OF_DAWN06
Definition: chapter5.cpp:66
@ EMOTE_LIGHT_OF_DAWN11
Definition: chapter5.cpp:125
@ SAY_LIGHT_OF_DAWN41
Definition: chapter5.cpp:86
@ SAY_LIGHT_OF_DAWN68
Definition: chapter5.cpp:113
@ SAY_LIGHT_OF_DAWN31
Definition: chapter5.cpp:76
@ SAY_LIGHT_OF_DAWN64
Definition: chapter5.cpp:109
@ EMOTE_LIGHT_OF_DAWN17
Definition: chapter5.cpp:131
@ EMOTE_LIGHT_OF_DAWN06
Definition: chapter5.cpp:120
@ SAY_LIGHT_OF_DAWN58
Definition: chapter5.cpp:103
@ NPC_ORBAZ_BLOODBANE
Definition: chapter5.cpp:153
@ SAY_LIGHT_OF_DAWN44
Definition: chapter5.cpp:89
@ EMOTE_LIGHT_OF_DAWN01
Definition: chapter5.cpp:115
@ SAY_LIGHT_OF_DAWN46
Definition: chapter5.cpp:91
@ ENCOUNTER_ABOMINATION_NUMBER
Definition: chapter5.cpp:37
@ EMOTE_LIGHT_OF_DAWN04
Definition: chapter5.cpp:118
@ SPELL_TELEPORT_VISUAL
Definition: chapter5.cpp:164
@ EMOTE_LIGHT_OF_DAWN14
Definition: chapter5.cpp:128
@ EMOTE_LIGHT_OF_DAWN05
Definition: chapter5.cpp:119
@ SAY_LIGHT_OF_DAWN35
Definition: chapter5.cpp:80
@ EMOTE_LIGHT_OF_DAWN16
Definition: chapter5.cpp:130
@ NPC_DARION_MOGRAINE
Definition: chapter5.cpp:187
@ SPELL_THUNDERCLAP
Definition: chapter5.cpp:178
@ SAY_LIGHT_OF_DAWN62
Definition: chapter5.cpp:107
@ NPC_ACHERUS_GHOUL
Definition: chapter5.cpp:181
@ SPELL_APOCALYPSE
Definition: chapter5.cpp:163
@ SPELL_ANTI_MAGIC_ZONE1
Definition: chapter5.cpp:140
@ EQUIP_HIGHLORD_TIRION_FORDRING
Definition: chapter5.cpp:192
@ SAY_LIGHT_OF_DAWN65
Definition: chapter5.cpp:110
@ ENCOUNTER_TOTAL_SCOURGE
Definition: chapter5.cpp:52
@ EMOTE_LIGHT_OF_DAWN09
Definition: chapter5.cpp:123
@ SPELL_CLEAVE1
Definition: chapter5.cpp:172
@ SAY_LIGHT_OF_DAWN28
Definition: chapter5.cpp:73
@ SAY_LIGHT_OF_DAWN34
Definition: chapter5.cpp:79
@ NPC_WARRIOR_OF_THE_FROZEN_WASTES
Definition: chapter5.cpp:184
@ SPELL_ICY_TOUCH1
Definition: chapter5.cpp:143
@ SPELL_REJUVENATION
Definition: chapter5.cpp:211
@ SPELL_GHOULPLOSION
Definition: chapter5.cpp:182
@ SAY_LIGHT_OF_DAWN33
Definition: chapter5.cpp:78
@ SAY_LIGHT_OF_DAWN40
Definition: chapter5.cpp:85
@ NPC_COMMANDER_ELIGOR_DAWNBRINGER
Definition: chapter5.cpp:207
@ SPELL_LAY_ON_HANDS
Definition: chapter5.cpp:193
@ SAY_LIGHT_OF_DAWN55
Definition: chapter5.cpp:100
@ SAY_LIGHT_OF_DAWN30
Definition: chapter5.cpp:75
@ SAY_LIGHT_OF_DAWN07
Definition: chapter5.cpp:67
@ SAY_LIGHT_OF_DAWN45
Definition: chapter5.cpp:90
@ NPC_LEONID_BARTHALOMEW_THE_REVERED
Definition: chapter5.cpp:204
@ WORLD_STATE_MINUTES_UNTIL_BATTLE
Definition: chapter5.cpp:58
@ SPELL_HERO_AGGRO_AURA
Definition: chapter5.cpp:179
@ NPC_HIGHLORD_DARION_MOGRAINE
Definition: chapter5.cpp:139
@ NPC_THASSARIAN
Definition: chapter5.cpp:154
@ SAY_LIGHT_OF_DAWN57
Definition: chapter5.cpp:102
@ SPELL_DEATH_GRIP
Definition: chapter5.cpp:156
@ SAY_LIGHT_OF_DAWN03
Definition: chapter5.cpp:63
@ NPC_KORFAX_CHAMPION_OF_THE_LIGHT
Definition: chapter5.cpp:199
@ SAY_LIGHT_OF_DAWN43
Definition: chapter5.cpp:88
@ NPC_RAYNE
Definition: chapter5.cpp:210
@ EMOTE_LIGHT_OF_DAWN07
Definition: chapter5.cpp:121
@ SPELL_HOLY_LIGHT2
Definition: chapter5.cpp:208
@ SPELL_TIRION_CHARGE_VISUAL
Definition: chapter5.cpp:196
@ SPELL_WRATH
Definition: chapter5.cpp:214
@ SAY_LIGHT_OF_DAWN50
Definition: chapter5.cpp:95
@ SPELL_SOUL_FEAST_ALEX
Definition: chapter5.cpp:165
@ ENCOUNTER_GHOUL_NUMBER
Definition: chapter5.cpp:39
@ NPC_DUKE_NICHOLAS_ZVERENHOFF
Definition: chapter5.cpp:205
@ ENCOUNTER_BEHEMOTH_NUMBER
Definition: chapter5.cpp:38
@ ENCOUNTER_EARTHSHATTER_NUMBER
Definition: chapter5.cpp:36
@ ENCOUNTER_WARRIOR_NUMBER
Definition: chapter5.cpp:40
@ SAY_LIGHT_OF_DAWN36
Definition: chapter5.cpp:81
@ ENCOUNTER_DK_TIMER
Definition: chapter5.cpp:34
@ SAY_LIGHT_OF_DAWN48
Definition: chapter5.cpp:93
@ SPELL_HOLY_LIGHT1
Definition: chapter5.cpp:217
@ EMOTE_LIGHT_OF_DAWN12
Definition: chapter5.cpp:126
@ SPELL_HOLY_STRIKE
Definition: chapter5.cpp:218
@ NPC_LORD_MAXWELL_TYROSUS
Definition: chapter5.cpp:203
@ SAY_LIGHT_OF_DAWN60
Definition: chapter5.cpp:105
@ WORLD_STATE_SHOW_MINUTES_UNTIL_BATTLE
Definition: chapter5.cpp:57
@ SAY_LIGHT_OF_DAWN39
Definition: chapter5.cpp:84
@ ENCOUNTER_DEFENDER_NUMBER
Definition: chapter5.cpp:35
@ SPELL_THUNDER
Definition: chapter5.cpp:224
@ SAY_LIGHT_OF_DAWN51
Definition: chapter5.cpp:96
@ SPELL_REBIRTH_OF_THE_ASHBRINGER
Definition: chapter5.cpp:194
@ SAY_LIGHT_OF_DAWN05
Definition: chapter5.cpp:65
@ SPELL_UPPERCUT
Definition: chapter5.cpp:220
@ SAY_LIGHT_OF_DAWN25
Definition: chapter5.cpp:70
@ SPELL_THE_LIGHT_OF_DAWN_Q
Definition: chapter5.cpp:135
@ NPC_RIMBLAT_EARTHSHATTER
Definition: chapter5.cpp:222
@ SPELL_ALEXANDROS_MOGRAINE_SPAWN
Definition: chapter5.cpp:147
@ NPC_HIGHLORD_ALEXANDROS_MOGRAINE
Definition: chapter5.cpp:186
@ SPELL_STARFALL
Definition: chapter5.cpp:212
@ SPELL_TRANQUILITY
Definition: chapter5.cpp:213
@ SAY_LIGHT_OF_DAWN66
Definition: chapter5.cpp:111
@ NPC_KOLTIRA_DEATHWEAVER
Definition: chapter5.cpp:152
@ SPELL_REBUKE
Definition: chapter5.cpp:168
@ SAY_LIGHT_OF_DAWN63
Definition: chapter5.cpp:108
static constexpr uint32 PATH_ESCORT_MOGRAINE
Definition: chapter5.cpp:261
void AddSC_the_scarlet_enclave_c5()
Definition: chapter5.cpp:1662
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
Creature *const me
Definition: CreatureAI.h:61
void EngagementOver()
Definition: CreatureAI.cpp:287
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
bool isEmpty() const
Definition: LinkedList.h:110
iterator end()
Definition: MapRefManager.h:35
iterator begin()
Definition: MapRefManager.h:34
PlayerList const & GetPlayers() const
Definition: Map.h:367
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void Clear()
Definition: ObjectGuid.h:286
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
void PrepareQuestMenu(ObjectGuid guid)
Definition: Player.cpp:14474
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: Player.cpp:16050
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: Player.cpp:14367
std::unique_ptr< PlayerMenu > PlayerTalkClass
Definition: Player.h:2380
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 SetVisible(bool x)
Definition: Unit.cpp:8351
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition: Unit.cpp:5827
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
Definition: Unit.cpp:13604
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:10100
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
Definition: Unit.h:1045
void SetFaction(uint32 faction) override
Definition: Unit.h:859
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void Dismount()
Definition: Unit.cpp:7920
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
bool IsQuestGiver() const
Definition: Unit.h:994
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition: Unit.cpp:7887
void SetEmoteState(Emote emote)
Definition: Unit.h:852
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:5670
uint32 GetFaction() const override
Definition: Unit.h:858
bool SetWalk(bool enable)
Definition: Unit.cpp:12707
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.cpp:8525
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void RemoveAllAuras()
Definition: Unit.cpp:4242
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
Map * GetMap() const
Definition: Object.h:624
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
Definition: Object.cpp:2991
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
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2065
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
Definition: Object.cpp:1181
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1147
CreatureAI * GetAI(Creature *creature) const override
Definition: chapter5.cpp:1632
CreatureAI * GetAI(Creature *creature) const override
Definition: chapter5.cpp:1646
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
void Start(bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false)
void EnterEvadeMode(EvadeReason why) override
bool HasEscortState(uint32 escortState)
void LoadPath(uint32 pathId)
void SetEscortPaused(bool on)
void UpdateAI(uint32 diff) override
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
Position GetPositionWithOffset(Position const &offset) const
Definition: Position.cpp:58
constexpr float GetPositionZ() const
Definition: Position.h:78
void AddThreat(Unit *victim, float amount, Unit *who=nullptr)
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
ObjectGuid uiAbominationGUID[ENCOUNTER_ABOMINATION_NUMBER]
Definition: chapter5.cpp:330
ObjectGuid uiBehemothGUID[ENCOUNTER_BEHEMOTH_NUMBER]
Definition: chapter5.cpp:331
ObjectGuid uiWarriorGUID[ENCOUNTER_WARRIOR_NUMBER]
Definition: chapter5.cpp:333
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
Definition: chapter5.cpp:1602
void AttackStart(Unit *who) override
== Triggered Actions Requested ==================
Definition: chapter5.cpp:419
void WaypointReached(uint32 waypointId, uint32) override
Definition: chapter5.cpp:452
ObjectGuid uiDefenderGUID[ENCOUNTER_DEFENDER_NUMBER]
Definition: chapter5.cpp:322
ObjectGuid uiEarthshatterGUID[ENCOUNTER_EARTHSHATTER_NUMBER]
Definition: chapter5.cpp:323
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
Definition: chapter5.cpp:1655