TrinityCore
Loading...
Searching...
No Matches
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 "GameObject.h"
20#include "Map.h"
21#include "MotionMaster.h"
22#include "ObjectAccessor.h"
23#include "Player.h"
24#include "ScriptedEscortAI.h"
25#include "ScriptedGossip.h"
26#include "SpellInfo.h"
27#include "SpellScript.h"
28#include "TemporarySummon.h"
29
30#define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell
31//Light of Dawn
33{
34#ifdef LESS_MOB
35 ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest, or -
36 ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data
37 ENCOUNTER_DEFENDER_NUMBER = 10, // how many of defender
38 ENCOUNTER_EARTHSHATTER_NUMBER = 1, // how many of earthshatter
39 ENCOUNTER_ABOMINATION_NUMBER = 2, // how many of abomination
40 ENCOUNTER_BEHEMOTH_NUMBER = 1, // how many of behemoth
41 ENCOUNTER_GHOUL_NUMBER = 5, // how many of ghoul
42 ENCOUNTER_WARRIOR_NUMBER = 1, // how many of warrior
43#else
44 ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest, or -
45 ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data
46 ENCOUNTER_DEFENDER_NUMBER = 20, // how many of defender
47 ENCOUNTER_EARTHSHATTER_NUMBER = 20, // how many of earthshatter
48 ENCOUNTER_ABOMINATION_NUMBER = 3, // how many of abomination
49 ENCOUNTER_BEHEMOTH_NUMBER = 2, // how many of behemoth
50 ENCOUNTER_GHOUL_NUMBER = 10, // how many of ghoul
51 ENCOUNTER_WARRIOR_NUMBER = 2, // how many of warrior
52#endif
53 ENCOUNTER_TOTAL_DAWN = 300, // Total number
55
59
60 SAY_LIGHT_OF_DAWN01 = 0, // pre text
63 SAY_LIGHT_OF_DAWN04 = 3, // intro
66 SAY_LIGHT_OF_DAWN07 = 6, // During the fight - Korfax, Champion of the Light
67 SAY_LIGHT_OF_DAWN08 = 7, // Lord Maxwell Tyrosus
68 SAY_LIGHT_OF_DAWN09 = 8, // Highlord Darion Mograine
69 SAY_LIGHT_OF_DAWN25 = 24, // After the fight
70 SAY_LIGHT_OF_DAWN26 = 25, // Highlord Tirion Fordring
71 SAY_LIGHT_OF_DAWN27 = 26, // Highlord Darion Mograine
72 SAY_LIGHT_OF_DAWN28 = 27, // Highlord Tirion Fordring
73 SAY_LIGHT_OF_DAWN29 = 28, // Highlord Tirion Fordring
74 SAY_LIGHT_OF_DAWN30 = 29, // Highlord Tirion Fordring
75 SAY_LIGHT_OF_DAWN31 = 30, // Highlord Tirion Fordring
76 SAY_LIGHT_OF_DAWN32 = 31, // Highlord Alexandros Mograine
77 SAY_LIGHT_OF_DAWN33 = 32, // Highlord Darion Mograine
78 SAY_LIGHT_OF_DAWN34 = 33, // Highlord Darion Mograine
79 SAY_LIGHT_OF_DAWN35 = 34, // Darion Mograine
80 SAY_LIGHT_OF_DAWN36 = 35, // Darion Mograine
81 SAY_LIGHT_OF_DAWN37 = 36, // Highlord Alexandros Mograine
82 SAY_LIGHT_OF_DAWN38 = 37, // Darion Mograine
83 SAY_LIGHT_OF_DAWN39 = 38, // Highlord Alexandros Mograine
84 SAY_LIGHT_OF_DAWN40 = 39, // Darion Mograine
85 SAY_LIGHT_OF_DAWN41 = 40, // Highlord Alexandros Mograine
86 SAY_LIGHT_OF_DAWN42 = 41, // Highlord Alexandros Mograine
87 SAY_LIGHT_OF_DAWN43 = 42, // The Lich King
88 SAY_LIGHT_OF_DAWN44 = 43, // Highlord Darion Mograine
89 SAY_LIGHT_OF_DAWN45 = 44, // The Lich King
90 SAY_LIGHT_OF_DAWN46 = 45, // The Lich King
91 SAY_LIGHT_OF_DAWN47 = 46, // Highlord Tirion Fordring
92 SAY_LIGHT_OF_DAWN48 = 47, // The Lich King
93 SAY_LIGHT_OF_DAWN49 = 48, // The Lich King
94 SAY_LIGHT_OF_DAWN50 = 49, // Lord Maxwell Tyrosus
95 SAY_LIGHT_OF_DAWN51 = 50, // The Lich King
96 SAY_LIGHT_OF_DAWN52 = 51, // Highlord Darion Mograine
97 SAY_LIGHT_OF_DAWN53 = 52, // Highlord Darion Mograine
98 SAY_LIGHT_OF_DAWN54 = 53, // Highlord Tirion Fordring
99 SAY_LIGHT_OF_DAWN55 = 54, // The Lich King
100 SAY_LIGHT_OF_DAWN56 = 55, // Highlord Tirion Fordring
101 SAY_LIGHT_OF_DAWN57 = 56, // The Lich King
102 SAY_LIGHT_OF_DAWN58 = 57, // The Lich King
103 SAY_LIGHT_OF_DAWN59 = 58, // The Lich King
104 SAY_LIGHT_OF_DAWN60 = 59, // Highlord Tirion Fordring
105 SAY_LIGHT_OF_DAWN61 = 60, // Highlord Tirion Fordring
106 SAY_LIGHT_OF_DAWN62 = 61, // Highlord Tirion Fordring
107 SAY_LIGHT_OF_DAWN63 = 62, // Highlord Tirion Fordring
108 SAY_LIGHT_OF_DAWN64 = 63, // Highlord Tirion Fordring
109 SAY_LIGHT_OF_DAWN65 = 64, // Highlord Tirion Fordring
110 SAY_LIGHT_OF_DAWN66 = 65, // Highlord Tirion Fordring
111 SAY_LIGHT_OF_DAWN67 = 66, // Highlord Tirion Fordring
112 SAY_LIGHT_OF_DAWN68 = 67, // Highlord Darion Mograine
113
114 EMOTE_LIGHT_OF_DAWN01 = 68, // Emotes
132
134 SPELL_THE_LIGHT_OF_DAWN_Q = 53606, // quest credit
135
136 // ---- Dark Knight npc --------------------
137 // Highlord Darion Mograine
144 SPELL_THE_MIGHT_OF_MOGRAINE = 53642, // on players when begins
149
150 // Koltira Deathweaver & Orbaz Bloodbane are using the same abilities
152 NPC_ORBAZ_BLOODBANE = 29204, // this guy fleed
153 NPC_THASSARIAN = 29200, // he also does SPELL_THE_LIGHT_OF_DAWN 53658
158 // all do SPELL_HERO_AGGRO_AURA 53627
159
160 // Lich King
161 NPC_THE_LICH_KING = 29183, // show up at end
164 SPELL_SOUL_FEAST_ALEX = 53677, // on Alexandros
165 SPELL_SOUL_FEAST_TIRION = 53685, // on Tirion
166 SPELL_ICEBOUND_VISAGE = 53274, // not sure what is it for
168
169 // others
174
175 NPC_FLESH_BEHEMOTH = 29190, // giant guy
176 SPELL_STOMP = 53634,
179
180 NPC_ACHERUS_GHOUL = 29219, // just ghoul....
182
183 NPC_WARRIOR_OF_THE_FROZEN_WASTES = 29206, // use SPELL_CLEAVE 53631
184
186 NPC_DARION_MOGRAINE = 29228, // ghost
187
188 // ---- Dawn npc --------------------
189 // Highlord Tirion Fordring
196
197 // others
201
205
208
209 NPC_RAYNE = 29181,
213 SPELL_WRATH = 21807,
214
215 NPC_DEFENDER_OF_THE_LIGHT = 29174, // also does SPELL_HEROIC_LEAP 53625
220
223 SPELL_THUNDER = 53630
225
226void UpdateWorldState(Map* map, uint32 id, uint32 state)
227{
228 Map::PlayerList const& players = map->GetPlayers();
229
230 if (!players.isEmpty())
231 {
232 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
233 {
234 if (Player* player = itr->GetSource())
235 player->SendUpdateWorldState(id, state);
236 }
237 }
238}
239
241{
242 {2281.335f, -5300.409f, 85.170f, 0}, // 0 Tirion Fordring loc
243 {2283.896f, -5287.914f, 83.066f, 1.55f}, // 1 Tirion Fordring loc2
244 {2281.461f, -5263.014f, 81.164f, 0}, // 2 Tirion charges
245 {2262.277f, -5293.477f, 82.167f, 0}, // 3 Tirion run
246 {2270.286f, -5287.73f, 82.262f, 0}, // 4 Tirion relocate
247 {2269.511f, -5288.289f, 82.225f, 0}, // 5 Tirion forward
248 {2262.277f, -5293.477f, 82.167f, 0}, // 6 Tirion runs to Darion
249 {2270.286f, -5287.73f, 82.262f, 0},
250 {2269.511f, -5288.289f, 82.225f, 0},
251 {2273.205f, -5288.848f, 82.617f, 0}, // 9 Korfax loc1
252 {2274.739f, -5287.926f, 82.684f, 0}, // 10 Korfax loc2
253 {2253.673f, -5318.004f, 81.724f, 0}, // 11 Korfax kicked
254 {2287.028f, -5309.644f, 87.253f, 0}, // 12 Maxwell loc1
255 {2286.978f, -5308.025f, 86.83f, 0}, // 13 Maxwell loc2
256 {2248.877f, -5307.586f, 82.166f, 0}, // 14 maxwell kicked
257 {2278.58f, -5316.933f, 88.319f, 0}, // 15 Eligor loc1
258 {2278.535f, -5315.479f, 88.08f, 0}, // 16 Eligor loc2
259 {2259.416f, -5304.505f, 82.149f, 0}, // 17 eligor kicked
260 {2289.259f, -5280.355f, 82.112f, 0}, // 18 Koltira loc1
261 {2289.02f, -5281.985f, 82.207f, 0}, // 19 Koltira loc2
262 {2273.289f, -5273.675f, 81.701f, 0}, // 20 Thassarian loc1
263 {2273.332f, -5275.544f, 81.849f, 0}, // 21 Thassarian loc2
264 {2281.198f, -5257.397f, 80.224f, 4.66f}, // 22 Alexandros loc1
265 {2281.156f, -5259.934f, 80.647f, 0}, // 23 Alexandros loc2
266 {2281.294f, -5281.895f, 82.445f, 1.35f}, // 24 Darion loc1
267 {2281.093f, -5263.013f, 81.125f, 0}, // 25 Darion loc1
268 {2281.313f, -5250.282f, 79.322f, 4.69f}, // 26 Lich King spawns
269 {2281.523f, -5261.058f, 80.877f, 0}, // 27 Lich king move forwards
270 {2272.709f, -5255.552f, 78.226f, 0}, // 28 Lich king kicked
271 {2273.972f, -5257.676f, 78.862f, 0}, // 29 Lich king moves forward
272};
273
274static constexpr uint32 PATH_ESCORT_MOGRAINE = 233386;
275
277{
278public:
279 npc_highlord_darion_mograine() : CreatureScript("npc_highlord_darion_mograine") { }
280
282 {
284 {
285 Initialize();
286 }
287
289 {
290 bIsBattle = false;
291 uiStep = 0;
292 uiPhase_timer = 3000;
293 uiFight_duration = 300000; // 5 minutes
297
298 uiAnti_magic_zone = urand(1000, 6000);
299 uiDeath_strike = urand(5000, 10000);
300 uiDeath_embrace = urand(5000, 10000);
301 uiIcy_touch = urand(5000, 10000);
302 uiUnholy_blight = urand(5000, 10000);
303
304 uiFight_speech = 15000;
305 uiSpawncheck = 1000;
306 uiTargetcheck = 10000;
307 }
308
316
317 // Darion Mograine
326
327 // Dawn
337
338 // Death
347
348 void Reset() override
349 {
351 {
352 Initialize();
353
355 me->Mount(25279);
356 me->SetVisible(true);
357
359 //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0);
361
363 temp->setDeathState(JUST_DIED);
365 temp->setDeathState(JUST_DIED);
367 temp->setDeathState(JUST_DIED);
369 temp->setDeathState(JUST_DIED);
371 temp->setDeathState(JUST_DIED);
372
378
379 for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
380 {
382 temp->setDeathState(JUST_DIED);
384 }
385 for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
386 {
388 temp->setDeathState(JUST_DIED);
390 }
391
393 temp->Respawn();
395 temp->Respawn();
397 temp->Respawn();
399 temp->Respawn();
400
405 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
406 {
408 temp->setDeathState(JUST_DIED);
410 }
411 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
412 {
414 temp->setDeathState(JUST_DIED);
416 }
417 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
418 {
420 temp->setDeathState(JUST_DIED);
421 uiGhoulGUID[i].Clear();
422 }
423 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
424 {
426 temp->setDeathState(JUST_DIED);
427 uiWarriorGUID[i].Clear();
428 }
429 }
430 }
431
432 void AttackStart(Unit* who) override
433 {
434 if (!who)
435 return;
436
437 if (who == me)
438 return;
439
440 if (me->Attack(who, true))
441 {
442 AddThreat(who, 0.0f);
443 me->SetInCombatWith(who);
444 who->SetInCombatWith(me);
445 DoStartMovement(who);
446 }
447 }
448
449 void MoveInLineOfSight(Unit* who) override
450
451 {
452 if (!who)
453 return;
454
455 if (me->IsValidAttackTarget(who))
456 if (me->IsWithinDistInMap(who, 20) && me->IsWithinLOSInMap(who))
457 AttackStart(who);
458 }
459
460 void SetHoldState(bool bOnHold)
461 {
462 SetEscortPaused(bOnHold);
463 }
464
465 void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
466 {
467 switch (waypointId)
468 {
469 case 0:
470 me->SetWalk(false);
471 SetHoldState(true);
472 break;
473 case 1:
474 SetHoldState(true);
475 SpawnNPC();
477 temp->AI()->Talk(SAY_LIGHT_OF_DAWN07);
479 temp->AI()->Talk(SAY_LIGHT_OF_DAWN08);
480
481 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
483 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
485 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
487 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
492
493 me->Dismount();
494 me->CastSpell(me, SPELL_THE_MIGHT_OF_MOGRAINE, true); // need to fix, on player only
495
497 temp->Dismount();
499 temp->Dismount();
500
501 bIsBattle = true;
502 break;
503 case 2:
504 me->SetWalk(true);
506 break;
507 case 3:
508 {
509 //Unit* pTirion = ObjectAccessor::GetCreature(*me, uiTirionGUID);
510
515 {
516 if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN))
517 temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
518 temp->SetWalk(true);
519 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19]);
520 }
522 {
523 if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN))
524 temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
525 temp->SetWalk(true);
526 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21]);
527 }
529 {
530 temp->SetWalk(true);
531 temp->SetEmoteState(EMOTE_STATE_READY2H);
532 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10]);
533 }
535 {
536 temp->SetWalk(true);
537 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13]);
538 }
540 {
541 temp->SetWalk(true);
542 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16]);
543 }
544 JumpToNextStep(10000);
545 }
546 break;
547 case 4:
550
552 temp->SetStandState(UNIT_STAND_STATE_KNEEL);
554 temp->SetStandState(UNIT_STAND_STATE_KNEEL);
555 SetHoldState(true);
556 break;
557 case 5:
559 SetHoldState(true);
560 break;
561 case 6:
562 SetHoldState(true);
564 JumpToNextStep(1000);
565 break;
566 case 7:
567 SetHoldState(true);
568 JumpToNextStep(2000);
569 break;
570 case 8:
573 me->CastSpell(temp, SPELL_ASHBRINGER, true);
575 SetHoldState(true);
576 break;
577 }
578 }
579
580 void EnterEvadeMode(EvadeReason why) override
581 {
582 if (!bIsBattle)//do not reset self if we are in battle
584 }
585
586 void UpdateAI(uint32 diff) override
587 {
588 EscortAI::UpdateAI(diff);
589
590 if (!bIsBattle)
591 {
592 if (uiPhase_timer <= diff)
593 {
594 // ******* Before battle *****************************************************************
595 switch (uiStep)
596 {
597 case 0: // countdown
598 //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 1);
599 break;
600
601 case 1: // just delay
602 //UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 1);
606 JumpToNextStep(3000);
607 break;
608
609 case 2:
612 uiKoltiraGUID = pKoltira->GetGUID();
614 uiOrbazGUID = pOrbaz->GetGUID();
615 if (Creature* pThassarian = GetClosestCreatureWithEntry(me, NPC_THASSARIAN, 50.0f))
616 uiThassarianGUID = pThassarian->GetGUID();
617 JumpToNextStep(10000);
618 break;
619
620 case 3: // rise
622 JumpToNextStep(3000);
623 break;
624
625 case 4: // summon ghoul
626 // Dunno whats the summon spell, so workaround
627 DoCast(me, 33271); // shack effect
628 uiPhase_timer = 500;
630 {
632 temp->SetWalk(false);
636 }
637 else
638 {
640 ++uiStep;
641 }
642 break;
643
644 case 5: // summon abomination
645 DoCast(me, 33271); // shack effect
646 uiPhase_timer = 500;
648 {
650 temp->SetWalk(false);
654 }
655 else
656 {
658 ++uiStep;
659 }
660 break;
661
662 case 6: // summon warrior
663 DoCast(me, 33271); // shack effect
664 uiPhase_timer = 500;
666 {
668 temp->SetWalk(false);
672 }
673 else
674 {
676 ++uiStep;
677 }
678 break;
679
680 case 7: // summon warrior
681 DoCast(me, 33271); // shack effect
682 uiPhase_timer = 500;
684 {
686 temp->SetWalk(false);
690 }
691 else
692 {
694 ++uiStep;
695 }
696 break;
697
698 case 8: // summon announce
700 JumpToNextStep(5000);
701 break;
702
703 case 9: // charge begins
704 SetHoldState(false);
706 {
707 temp->SetWalk(false);
708 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
709 }
711 {
712 temp->SetWalk(false);
713 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
714 }
716 {
717 temp->SetWalk(false);
718 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
719 }
720 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
722 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
723 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
725 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
726 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
728 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
729 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
731 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }));
732 JumpToNextStep(5000);
733 break;
734
735 // ******* After battle *****************************************************************
736 case 11: // Tirion starts to speak
738 temp->AI()->Talk(SAY_LIGHT_OF_DAWN28);
739 JumpToNextStep(21000);
740 break;
741
742 case 12:
744 temp->AI()->Talk(SAY_LIGHT_OF_DAWN29);
745 JumpToNextStep(13000);
746 break;
747
748 case 13:
750 temp->AI()->Talk(SAY_LIGHT_OF_DAWN30);
751 JumpToNextStep(13000);
752 break;
753
754 case 14:
757 JumpToNextStep(7000);
758 break;
759
760 case 15: // summon gate
762 {
763 temp->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
764 temp->CastSpell(temp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true);
765 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN06);
766 uiAlexandrosGUID = temp->GetGUID();
767 }
768 JumpToNextStep(4000);
769 break;
770
771 case 16: // Alexandros out
773 {
774 temp->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
775 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23]);
776 temp->AI()->Talk(SAY_LIGHT_OF_DAWN32);
777 }
778 SetHoldState(false); // makes darion turns back
779 JumpToNextStep(5000);
780 break;
781
782 case 17:
785 JumpToNextStep(5000);
786 break;
787
788 case 18: // Darion's spirit out
790 {
791 temp->AI()->Talk(SAY_LIGHT_OF_DAWN35);
792 temp->SetWalk(false);
793 uiDarionGUID = temp->GetGUID();
794 }
795 JumpToNextStep(4000);
796 break;
797
798 case 19: // runs to father
800 {
801 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN07);
802 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25]);
803 }
804 JumpToNextStep(4000);
805 break;
806
807 case 20:
809 temp->AI()->Talk(SAY_LIGHT_OF_DAWN36);
810 JumpToNextStep(4000);
811 break;
812
813 case 21:
815 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN08);
816 JumpToNextStep(4000);
817 break;
818
819 case 22:
821 temp->AI()->Talk(SAY_LIGHT_OF_DAWN37);
822 JumpToNextStep(8000);
823 break;
824
825 case 23:
827 temp->AI()->Talk(SAY_LIGHT_OF_DAWN38);
828 JumpToNextStep(8000);
829 break;
830
831 case 24:
833 temp->AI()->Talk(SAY_LIGHT_OF_DAWN39);
834
835 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID)) // Tirion moves forward here
836 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1]);
837
838 JumpToNextStep(15000);
839 break;
840
841 case 25:
843 temp->AI()->Talk(SAY_LIGHT_OF_DAWN40);
844 JumpToNextStep(11000);
845 break;
846
847 case 26:
849 temp->AI()->Talk(SAY_LIGHT_OF_DAWN41);
850 JumpToNextStep(5000);
851 break;
852
853 case 27:
855 temp->setDeathState(JUST_DIED);
856 JumpToNextStep(24000);
857 break;
858
859 case 28:
861 temp->AI()->Talk(SAY_LIGHT_OF_DAWN42);
862 JumpToNextStep(6000);
863 break;
864
865 case 29: // lich king spawns
867 {
868 temp->AI()->Talk(SAY_LIGHT_OF_DAWN43);
869 uiLichKingGUID = temp->GetGUID();
871 temp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false);
872 }
873 JumpToNextStep(2000);
874 break;
875
876 case 30:
877 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiAlexandrosGUID)) // just hide him
878 {
879 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN09);
880 temp->SetVisible(false);
881 }
883 {
884 temp->InterruptNonMeleeSpells(false);
885 temp->AI()->Talk(SAY_LIGHT_OF_DAWN45);
886 }
887 JumpToNextStep(3000);
888 break;
889
890 case 31:
894 JumpToNextStep(3000);
895 break;
896
897 case 32:
899 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[27]);
900 JumpToNextStep(6000);
901 break;
902
903 case 33: // Darion supports to jump to lich king here
905 DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge
906 // doesn't make it looks well, so workarounds, Darion charges, looks better
907 me->SetSpeedRate(MOVE_RUN, 3.0f);
908 me->SetWalk(false);
909 SetHoldState(false);
911 break;
912
913 case 35: // Lich king counterattacks
915 {
916 temp->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
917 temp->AI()->Talk(SAY_LIGHT_OF_DAWN46);
918 }
919 me->SetSpeedRate(MOVE_RUN, 6.0f);
921 SetHoldState(false); // Darion got kicked by lich king
923 break;
924
925 case 37: // Lich king counterattacks
927 JumpToNextStep(3000);
928 break;
929
930 case 38:
932 temp->AI()->Talk(SAY_LIGHT_OF_DAWN47);
933 JumpToNextStep(8000);
934 break;
935
936 case 39:
938 temp->AI()->Talk(SAY_LIGHT_OF_DAWN48);
939 JumpToNextStep(15000);
940 break;
941
942 case 40:
944 temp->AI()->Talk(SAY_LIGHT_OF_DAWN49);
945 JumpToNextStep(17000);
946 break;
947
948 case 41: // Lich king - Apocalypse
950 {
951 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN11);
952 temp->AI()->Talk(SAY_LIGHT_OF_DAWN51);
954 {
955 pTirion->SetStandState(UNIT_STAND_STATE_KNEEL);
956 //temp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working
957 temp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false);
958 pTirion->AI()->Talk(EMOTE_LIGHT_OF_DAWN12);
959 }
960 }
961 JumpToNextStep(2000);
962 break;
963
964 case 42: // Maxwell yells for attack
965 {
966 float fLichPositionX = 0,
967 fLichPositionY = 0,
968 fLichPositionZ = 0;
970 {
971 fLichPositionX = temp->GetPositionX();
972 fLichPositionY = temp->GetPositionY();
973 fLichPositionZ = temp->GetPositionZ();
974 }
975
976 if (fLichPositionX && fLichPositionY)
977 {
978 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);
980 temp->SetWalk(false);
981 temp->SetSpeedRate(MOVE_RUN, 2.0f);
982 temp->SetFaction(me->GetFaction());
983 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
984 uiDefenderGUID[0] = temp->GetGUID();
985
986 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);
988 temp->SetWalk(false);
989 temp->SetSpeedRate(MOVE_RUN, 2.0f);
990 temp->SetFaction(me->GetFaction());
991 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
992 uiEarthshatterGUID[0] = temp->GetGUID();
993 }
995 {
996 temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
997 temp->SetWalk(false);
998 temp->SetSpeedRate(MOVE_RUN, 2.0f);
999 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
1000 temp->AI()->Talk(SAY_LIGHT_OF_DAWN50);
1001 }
1003 {
1004 temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
1005 temp->SetWalk(false);
1006 temp->SetSpeedRate(MOVE_RUN, 2.0f);
1007 temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED);
1008 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
1009 }
1011 {
1012 temp->SetEmoteState(EMOTE_STATE_ATTACK_UNARMED);
1013 temp->SetWalk(false);
1014 temp->SetSpeedRate(MOVE_RUN, 2.0f);
1015 temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ);
1016 }
1017 }
1018 JumpToNextStep(4500);
1019 break;
1020
1021 case 43: // They all got kicked
1023 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN13);
1024
1026 {
1027 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1028 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1029 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1030 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14]);
1031 }
1033 {
1034 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1035 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1036 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1037 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11]);
1038 }
1040 {
1041 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1042 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1043 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1044 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17]);
1045 }
1047 {
1048 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1049 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1050 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }));
1051 }
1053 {
1054 temp->SetSpeedRate(MOVE_RUN, 6.0f);
1055 temp->SetStandState(UNIT_STAND_STATE_DEAD);
1056 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 10), float(rand32() % 10), 0.0f, 0.0f }));
1057 }
1058 JumpToNextStep(3000);
1059 break;
1060
1061 case 44: // make them stand up
1063 temp->SetStandState(UNIT_STAND_STATE_STAND);
1065 temp->SetStandState(UNIT_STAND_STATE_STAND);
1067 temp->SetStandState(UNIT_STAND_STATE_STAND);
1068 JumpToNextStep(1000);
1069 break;
1070
1071 case 45:
1073 JumpToNextStep(5000);
1074 break;
1075
1076 case 46: // Darion stand up, "not today"
1077 me->SetSpeedRate(MOVE_RUN, 1.0f);
1078 me->SetWalk(true);
1081 SetHoldState(false); // Darion throws sword
1082 JumpToNextStep(7000);
1083 break;
1084
1085 case 47: // Ashbringer rebirth
1089 {
1090 temp->SetStandState(UNIT_STAND_STATE_STAND);
1091 temp->SetVirtualItem(0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING));
1092 temp->CastSpell(temp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false);
1093 }
1094 JumpToNextStep(1000);
1095 break;
1096
1097 case 48: // Show the cleansing effect (dawn of light)
1098 //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID))
1099 // go->SetPhaseMask(128, true);
1100 me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896f, -5287.914f, 83.066f, 0.f, QuaternionData(), 30s);
1102 {
1103 if (temp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER))
1104 temp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER);
1105 temp->CastSpell(temp, 41542, false); // workarounds, light expoded, makes it cool
1106 temp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
1107 }
1109 temp->InterruptNonMeleeSpells(false);
1110 JumpToNextStep(2500);
1111 break;
1112
1113 case 49:
1115 temp->AI()->Talk(SAY_LIGHT_OF_DAWN54);
1116 JumpToNextStep(4000);
1117 break;
1118
1119 case 50:
1121 temp->AI()->Talk(SAY_LIGHT_OF_DAWN55);
1122 JumpToNextStep(5000);
1123 break;
1124
1125 case 51:
1127 temp->AI()->Talk(SAY_LIGHT_OF_DAWN56);
1128 JumpToNextStep(1000);
1129 break;
1130
1131 case 52: // Tiron charges
1133 {
1134 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN16);
1135 temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge
1136 temp->SetEmoteState(EMOTE_STATE_READY2H);
1137 temp->SetSpeedRate(MOVE_RUN, 3.0f); // workarounds, make Tirion still running
1138 temp->SetWalk(false);
1139 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2]);
1141 lktemp->Relocate(LightofDawnLoc[28]); // workarounds, he should kick back by Tirion, but here we relocate him
1142 }
1143 JumpToNextStep(1500);
1144 break;
1145
1146 case 53:
1148 temp->AI()->Talk(SAY_LIGHT_OF_DAWN57);
1149 JumpToNextStep(1000);
1150 break;
1151
1152 case 54:
1154 {
1155 temp->SetSpeedRate(MOVE_RUN, 1.0f);
1156 me->SetWalk(true);
1157 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29]); // 26
1158 }
1159 JumpToNextStep(4000);
1160 break;
1161
1162 case 55:
1164 temp->SetStandState(UNIT_STAND_STATE_KNEEL);
1165 JumpToNextStep(2000);
1166 break;
1167
1168 case 56:
1170 temp->SetStandState(UNIT_STAND_STATE_STAND);
1171 JumpToNextStep(1500);
1172 break;
1173
1174 case 57:
1176 temp->AI()->Talk(SAY_LIGHT_OF_DAWN58);
1177 JumpToNextStep(10000);
1178 break;
1179
1180 case 58:
1182 temp->AI()->Talk(SAY_LIGHT_OF_DAWN59);
1183 JumpToNextStep(10000);
1184 break;
1185
1186 case 59:
1188 temp->CastSpell(temp, SPELL_TELEPORT_VISUAL, false);
1189 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion
1190 {
1191 temp->SetEmoteState(EMOTE_ONESHOT_NONE);
1192 temp->SetSpeedRate(MOVE_RUN, 1.0f);
1193 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6]);
1194 }
1195 JumpToNextStep(2500);
1196 break;
1197
1198 case 60:
1199 if (Creature* temp = ObjectAccessor::GetCreature(*me, uiLichKingGUID)) // Lich king disappears here
1200 {
1201 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN17);
1202 temp->KillSelf();
1203 }
1204 JumpToNextStep(10000);
1205 break;
1206
1207 case 61:
1209 temp->AI()->Talk(SAY_LIGHT_OF_DAWN60);
1210 JumpToNextStep(3000);
1211 break;
1212
1213 case 62:
1215 {
1216 temp->SetWalk(true);
1217 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7]);
1218 }
1219 JumpToNextStep(5500);
1220 break;
1221
1222 case 63:
1224 {
1225 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8]);
1226 temp->AI()->Talk(SAY_LIGHT_OF_DAWN61);
1227 }
1228 JumpToNextStep(15000);
1229 break;
1230
1231 case 64:
1233 temp->AI()->Talk(SAY_LIGHT_OF_DAWN62);
1234 JumpToNextStep(7000);
1235 break;
1236
1237 case 65:
1239 temp->AI()->Talk(SAY_LIGHT_OF_DAWN63);
1240 JumpToNextStep(10000);
1241 break;
1242
1243 case 66:
1245 temp->AI()->Talk(SAY_LIGHT_OF_DAWN64);
1246 JumpToNextStep(11000);
1247 break;
1248
1249 case 67:
1251 temp->AI()->Talk(SAY_LIGHT_OF_DAWN65);
1252 JumpToNextStep(10000);
1253 break;
1254
1255 case 68:
1257 temp->AI()->Talk(SAY_LIGHT_OF_DAWN66);
1258 JumpToNextStep(8000);
1259 break;
1260
1261 case 69:
1263 temp->AI()->Talk(SAY_LIGHT_OF_DAWN67);
1264 JumpToNextStep(10000);
1265 break;
1266
1267 case 70:
1270 JumpToNextStep(10000);
1271 break;
1272
1273 case 71:
1274 //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light
1275 // go->SetPhaseMask(0, true);
1276 {
1277 // search players with in 50 yards for quest credit
1278 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
1279 if (!PlayerList.isEmpty())
1280 {
1281 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
1282 if (me->IsWithinDistInMap(i->GetSource(), 500))
1283 i->GetSource()->CastSpell(i->GetSource(), SPELL_THE_LIGHT_OF_DAWN_Q, false);
1284 }
1285 }
1286 me->SetVisible(false); // respawns another Darion for quest turn in
1288 JumpToNextStep(1000);
1289 break;
1290
1291 case 72:
1292 SetHoldState(false); // Escort ends
1293 JumpToNextStep(25000);
1294 break;
1295
1296 case 73:
1298 temp->DespawnOrUnsummon();
1300 temp->DespawnOrUnsummon();
1302 temp->DespawnOrUnsummon();
1304 temp->DespawnOrUnsummon();
1306 break;
1307 }
1308
1309 } else uiPhase_timer -= diff;
1310 }
1311
1312 // ******* During battle *****************************************************************
1313 else
1314 {
1315 if (uiAnti_magic_zone <= diff)
1316 {
1318 uiAnti_magic_zone = urand(25000, 30000);
1319 } else uiAnti_magic_zone -= diff;
1320
1321 if (uiDeath_strike <= diff)
1322 {
1324 uiDeath_strike = urand(5000, 10000);
1325 } else uiDeath_strike -= diff;
1326
1327 if (uiDeath_embrace <= diff)
1328 {
1330 uiDeath_embrace = urand(5000, 10000);
1331 } else uiDeath_embrace -= diff;
1332
1333 if (uiIcy_touch <= diff)
1334 {
1336 uiIcy_touch = urand(5000, 10000);
1337 } else uiIcy_touch -= diff;
1338
1339 if (uiUnholy_blight <= diff)
1340 {
1342 uiUnholy_blight = urand(5000, 10000);
1343 } else uiUnholy_blight -= diff;
1344
1345 if (uiFight_speech <= diff)
1346 {
1348 uiFight_speech = urand(15000, 20000);
1349 } else uiFight_speech -= diff;
1350
1351 // Check spawns
1352 if (uiSpawncheck <= diff)
1353 {
1354 SpawnNPC();
1355 uiSpawncheck = 1000;
1356 } else uiSpawncheck -= diff;
1357
1358 // Check targets
1359 if (uiTargetcheck <= diff)
1360 {
1361 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
1363 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
1365 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
1367 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
1372
1373 uiTargetcheck = 10000;
1374 } else uiTargetcheck -= diff;
1375
1376 // Battle end
1377 if (uiFight_duration <= diff + 5000)
1378 {
1379 if (!uiTirionGUID)
1381 {
1382 temp->SetFaction(me->GetFaction());
1383 temp->SetVirtualItem(0, uint32(EQUIP_UNEQUIP));
1384 temp->AI()->Talk(SAY_LIGHT_OF_DAWN25);
1385 uiTirionGUID = temp->GetGUID();
1386 }
1387 }
1388 if (uiFight_duration <= diff)
1389 {
1390 bIsBattle = false;
1391 uiFight_duration = 300000;
1392
1395 me->RemoveAllAuras();
1396 me->CombatStop(true);
1398 me->SetWalk(false);
1399
1401
1402 for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
1404 for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
1406 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
1408 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
1410 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
1412 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
1414
1416 {
1417 temp->AI()->EnterEvadeMode();
1418 temp->RemoveAllAuras();
1419 temp->CombatStop(true);
1420 temp->AttackStop();
1421 temp->SetFaction(me->GetFaction());
1422 temp->SetWalk(false);
1423 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9]);
1424 }
1425
1427 {
1428 temp->RemoveAllAuras();
1429 temp->CombatStop(true);
1430 temp->AttackStop();
1431 temp->SetFaction(me->GetFaction());
1432 temp->SetWalk(false);
1433 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12]);
1434 }
1435
1437 {
1438 temp->AI()->EnterEvadeMode();
1439 temp->RemoveAllAuras();
1440 temp->CombatStop(true);
1441 temp->AttackStop();
1442 temp->SetFaction(me->GetFaction());
1443 temp->SetWalk(false);
1444 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15]);
1445 }
1447
1449 {
1450 temp->AI()->EnterEvadeMode();
1451 temp->RemoveAllAuras();
1452 temp->CombatStop(true);
1453 temp->AttackStop();
1454 temp->SetFaction(me->GetFaction());
1455 temp->SetWalk(false);
1456 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18]);
1457 temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
1458 }
1459
1461 temp->AI()->Talk(EMOTE_LIGHT_OF_DAWN04);
1462
1464 {
1465 temp->AI()->EnterEvadeMode();
1466 temp->RemoveAllAuras();
1467 temp->CombatStop(true);
1468 temp->AttackStop();
1469 temp->SetFaction(me->GetFaction());
1470 temp->SetWalk(false);
1471 temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20]);
1472 temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false);
1473 }
1474
1476 temp->AI()->Talk(SAY_LIGHT_OF_DAWN26);
1477
1478 SetHoldState(false);
1479
1480 } else uiFight_duration -= diff;
1481
1483 }
1484 }
1485
1487 {
1488 uiPhase_timer = uiTimer;
1489 ++uiStep;
1490 }
1491
1493 {
1494 if (Creature* temp = ObjectAccessor::GetCreature(*me, ui_GUID))
1495 if (temp->IsAlive())
1496 if (Unit* pTarget = SelectTarget(SelectTargetMethod::Random, 0))
1497 if (pTarget->IsAlive())
1498 {
1499 AddThreat(pTarget, 0.0f, temp);
1500 temp->AI()->AttackStart(pTarget);
1501 }
1502 }
1503
1505 {
1506 Unit* temp = nullptr;
1507
1508 // Death
1509 for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i)
1510 {
1512 if (!temp)
1513 {
1514 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);
1516 uiGhoulGUID[i] = temp->GetGUID();
1517 }
1518 }
1519 for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i)
1520 {
1522 if (!temp)
1523 {
1524 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);
1526 uiAbominationGUID[i] = temp->GetGUID();
1527 }
1528 }
1529 for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i)
1530 {
1532 if (!temp)
1533 {
1534 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);
1536 uiWarriorGUID[i] = temp->GetGUID();
1537 }
1538 }
1539 for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i)
1540 {
1542 if (!temp)
1543 {
1544 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);
1546 uiBehemothGUID[i] = temp->GetGUID();
1547 }
1548 }
1549
1550 // Dawn
1551 for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i)
1552 {
1554 if (!temp)
1555 {
1556 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);
1558 AddThreat(temp, 0.0f);
1559 uiDefenderGUID[i] = temp->GetGUID();
1560 }
1561 }
1562 for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i)
1563 {
1565 if (!temp)
1566 {
1567 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);
1569 AddThreat(temp, 0.0f);
1570 uiEarthshatterGUID[i] = temp->GetGUID();
1571 }
1572 }
1574 if (!temp)
1575 {
1576 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);
1578 AddThreat(temp, 0.0f);
1579 uiKorfaxGUID = temp->GetGUID();
1580 }
1582 if (!temp)
1583 {
1584 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);
1586 AddThreat(temp, 0.0f);
1587 uiMaxwellGUID = temp->GetGUID();
1588 }
1590 if (!temp)
1591 {
1592 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);
1594 AddThreat(temp, 0.0f);
1595 uiEligorGUID = temp->GetGUID();
1596 }
1598 if (!temp)
1599 {
1600 temp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].GetPositionWithOffset({ float(rand32() % 30), float(rand32() % 30), 0.0f, 0.0f }), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5min);
1602 AddThreat(temp, 0.0f);
1603 uiRayneGUID = temp->GetGUID();
1604 }
1605 }
1606
1608 {
1609 if (Creature* temp = ObjectAccessor::GetCreature(*me, pGUID))
1610 if (temp->IsAlive())
1611 {
1612 temp->SetVisible(false);
1613 temp->KillSelf();
1614 }
1615 }
1616
1617 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
1618 {
1619 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
1620 ClearGossipMenuFor(player);
1621 switch (action)
1622 {
1623 case GOSSIP_ACTION_INFO_DEF + 1:
1624 CloseGossipMenuFor(player);
1625 uiStep = 1;
1627 Start(true, player->GetGUID());
1628 break;
1629 }
1630 return true;
1631 }
1632
1633 bool OnGossipHello(Player* player) override
1634 {
1635 if (me->IsQuestGiver())
1636 player->PrepareQuestMenu(me->GetGUID());
1637
1638 if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE)
1640
1641 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
1642
1643 return true;
1644 }
1645 };
1646
1647 CreatureAI* GetAI(Creature* creature) const override
1648 {
1649 return new npc_highlord_darion_mograineAI(creature);
1650 }
1651};
1652
1653/*######
1654## npc the lich king in dawn of light
1655######*/
1657{
1658public:
1659 npc_the_lich_king_tirion_dawn() : CreatureScript("npc_the_lich_king_tirion_dawn") { }
1660
1661 CreatureAI* GetAI(Creature* creature) const override
1662 {
1663 return new npc_the_lich_king_tirion_dawnAI(creature);
1664 }
1665
1667 {
1669 void Reset() override { }
1670 void AttackStart(Unit* /*who*/) override { } // very simple, just don't make them aggreesive
1671 void UpdateAI(uint32 /*diff*/) override { }
1672 void JustDied(Unit* /*killer*/) override { }
1673 };
1674
1675};
1676
@ EQUIP_UNEQUIP
Definition CreatureAI.h:76
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ GOSSIP_ICON_CHAT
Definition GossipDef.h:60
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:107
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 SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
void AddGossipItemFor(Player *player, GossipOptionIcon icon, std::string const &text, uint32 sender, uint32 action)
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
@ UNIT_STAND_STATE_DEAD
Definition UnitDefines.h:41
@ UNIT_STAND_STATE_KNEEL
Definition UnitDefines.h:42
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:34
@ UNIT_NPC_FLAG_GOSSIP
@ MOVE_RUN
@ UNIT_FLAG_UNINTERACTIBLE
@ JUST_DIED
Definition Unit.h:212
Position const LightofDawnLoc[]
Definition chapter5.cpp:240
void UpdateWorldState(Map *map, uint32 id, uint32 state)
Definition chapter5.cpp:226
mograine
Definition chapter5.cpp:33
@ SPELL_STOMP
Definition chapter5.cpp:176
@ SAY_LIGHT_OF_DAWN27
Definition chapter5.cpp:71
@ SPELL_HOLY_WRATH
Definition chapter5.cpp:218
@ SAY_LIGHT_OF_DAWN01
Definition chapter5.cpp:60
@ SPELL_SCOURGE_AGGRO_AURA
Definition chapter5.cpp:173
@ EMOTE_LIGHT_OF_DAWN02
Definition chapter5.cpp:115
@ SPELL_PLAGUE_STRIKE1
Definition chapter5.cpp:157
@ NPC_THE_LICH_KING
Definition chapter5.cpp:161
@ SPELL_TIRION_CHARGE
Definition chapter5.cpp:194
@ SPELL_CLEAVE
Definition chapter5.cpp:199
@ SPELL_ASHBRINGER
Definition chapter5.cpp:148
@ SAY_LIGHT_OF_DAWN59
Definition chapter5.cpp:103
@ SAY_LIGHT_OF_DAWN53
Definition chapter5.cpp:97
@ SAY_LIGHT_OF_DAWN38
Definition chapter5.cpp:82
@ SPELL_DEATH_EMBRACE
Definition chapter5.cpp:141
@ SPELL_BLOOD_STRIKE1
Definition chapter5.cpp:154
@ SPELL_SCOURGE_HOOK
Definition chapter5.cpp:172
@ EMOTE_LIGHT_OF_DAWN03
Definition chapter5.cpp:116
@ SPELL_MOGRAINE_CHARGE
Definition chapter5.cpp:147
@ SAY_LIGHT_OF_DAWN49
Definition chapter5.cpp:93
@ SAY_LIGHT_OF_DAWN32
Definition chapter5.cpp:76
@ SAY_LIGHT_OF_DAWN52
Definition chapter5.cpp:96
@ SAY_LIGHT_OF_DAWN37
Definition chapter5.cpp:81
@ SAY_LIGHT_OF_DAWN08
Definition chapter5.cpp:67
@ SAY_LIGHT_OF_DAWN09
Definition chapter5.cpp:68
@ EMOTE_LIGHT_OF_DAWN15
Definition chapter5.cpp:128
@ SPELL_DEATH_STRIKE
Definition chapter5.cpp:140
@ SAY_LIGHT_OF_DAWN42
Definition chapter5.cpp:86
@ SPELL_THE_LIGHT_OF_DAWN
Definition chapter5.cpp:143
@ SPELL_THE_MIGHT_OF_MOGRAINE
Definition chapter5.cpp:144
@ NPC_FLESH_BEHEMOTH
Definition chapter5.cpp:175
@ EMOTE_LIGHT_OF_DAWN10
Definition chapter5.cpp:123
@ SAY_LIGHT_OF_DAWN02
Definition chapter5.cpp:61
@ SAY_LIGHT_OF_DAWN04
Definition chapter5.cpp:63
@ NPC_RAMPAGING_ABOMINATION
Definition chapter5.cpp:170
@ SPELL_ICY_TOUCH2
Definition chapter5.cpp:156
@ SAY_LIGHT_OF_DAWN67
Definition chapter5.cpp:111
@ EMOTE_LIGHT_OF_DAWN08
Definition chapter5.cpp:121
@ ENCOUNTER_DK_NUMBER
Definition chapter5.cpp:35
@ SAY_LIGHT_OF_DAWN29
Definition chapter5.cpp:73
@ NPC_HIGHLORD_TIRION_FORDRING
Definition chapter5.cpp:190
@ SAY_LIGHT_OF_DAWN56
Definition chapter5.cpp:100
@ NPC_DEFENDER_OF_THE_LIGHT
Definition chapter5.cpp:215
@ SAY_LIGHT_OF_DAWN61
Definition chapter5.cpp:105
@ SAY_LIGHT_OF_DAWN47
Definition chapter5.cpp:91
@ SPELL_HEROIC_LEAP
Definition chapter5.cpp:200
@ SAY_LIGHT_OF_DAWN54
Definition chapter5.cpp:98
@ SPELL_SOUL_FEAST_TIRION
Definition chapter5.cpp:165
@ SPELL_CHAIN_HEAL
Definition chapter5.cpp:222
@ EMOTE_LIGHT_OF_DAWN18
Definition chapter5.cpp:131
@ SPELL_UNHOLY_BLIGHT
Definition chapter5.cpp:145
@ WORLD_STATE_COUNTDOWN
Definition chapter5.cpp:57
@ GO_LIGHT_OF_DAWN
Definition chapter5.cpp:133
@ SAY_LIGHT_OF_DAWN26
Definition chapter5.cpp:70
@ ENCOUNTER_TOTAL_DAWN
Definition chapter5.cpp:53
@ SPELL_ICEBOUND_VISAGE
Definition chapter5.cpp:166
@ EMOTE_LIGHT_OF_DAWN13
Definition chapter5.cpp:126
@ SAY_LIGHT_OF_DAWN06
Definition chapter5.cpp:65
@ EMOTE_LIGHT_OF_DAWN11
Definition chapter5.cpp:124
@ SAY_LIGHT_OF_DAWN41
Definition chapter5.cpp:85
@ SAY_LIGHT_OF_DAWN68
Definition chapter5.cpp:112
@ SAY_LIGHT_OF_DAWN31
Definition chapter5.cpp:75
@ SAY_LIGHT_OF_DAWN64
Definition chapter5.cpp:108
@ EMOTE_LIGHT_OF_DAWN17
Definition chapter5.cpp:130
@ EMOTE_LIGHT_OF_DAWN06
Definition chapter5.cpp:119
@ SAY_LIGHT_OF_DAWN58
Definition chapter5.cpp:102
@ NPC_ORBAZ_BLOODBANE
Definition chapter5.cpp:152
@ SAY_LIGHT_OF_DAWN44
Definition chapter5.cpp:88
@ WORLD_STATE_REMAINS
Definition chapter5.cpp:56
@ EMOTE_LIGHT_OF_DAWN01
Definition chapter5.cpp:114
@ SAY_LIGHT_OF_DAWN46
Definition chapter5.cpp:90
@ ENCOUNTER_ABOMINATION_NUMBER
Definition chapter5.cpp:39
@ WORLD_STATE_EVENT_BEGIN
Definition chapter5.cpp:58
@ EMOTE_LIGHT_OF_DAWN04
Definition chapter5.cpp:117
@ SPELL_TELEPORT_VISUAL
Definition chapter5.cpp:163
@ EMOTE_LIGHT_OF_DAWN14
Definition chapter5.cpp:127
@ EMOTE_LIGHT_OF_DAWN05
Definition chapter5.cpp:118
@ SAY_LIGHT_OF_DAWN35
Definition chapter5.cpp:79
@ EMOTE_LIGHT_OF_DAWN16
Definition chapter5.cpp:129
@ NPC_DARION_MOGRAINE
Definition chapter5.cpp:186
@ SPELL_THUNDERCLAP
Definition chapter5.cpp:177
@ SAY_LIGHT_OF_DAWN62
Definition chapter5.cpp:106
@ NPC_ACHERUS_GHOUL
Definition chapter5.cpp:180
@ SPELL_APOCALYPSE
Definition chapter5.cpp:162
@ SPELL_ANTI_MAGIC_ZONE1
Definition chapter5.cpp:139
@ EQUIP_HIGHLORD_TIRION_FORDRING
Definition chapter5.cpp:191
@ SAY_LIGHT_OF_DAWN65
Definition chapter5.cpp:109
@ ENCOUNTER_TOTAL_SCOURGE
Definition chapter5.cpp:54
@ EMOTE_LIGHT_OF_DAWN09
Definition chapter5.cpp:122
@ SPELL_CLEAVE1
Definition chapter5.cpp:171
@ SAY_LIGHT_OF_DAWN28
Definition chapter5.cpp:72
@ SAY_LIGHT_OF_DAWN34
Definition chapter5.cpp:78
@ NPC_WARRIOR_OF_THE_FROZEN_WASTES
Definition chapter5.cpp:183
@ SPELL_ICY_TOUCH1
Definition chapter5.cpp:142
@ SPELL_REJUVENATION
Definition chapter5.cpp:210
@ SPELL_GHOULPLOSION
Definition chapter5.cpp:181
@ SAY_LIGHT_OF_DAWN33
Definition chapter5.cpp:77
@ SAY_LIGHT_OF_DAWN40
Definition chapter5.cpp:84
@ NPC_COMMANDER_ELIGOR_DAWNBRINGER
Definition chapter5.cpp:206
@ SPELL_LAY_ON_HANDS
Definition chapter5.cpp:192
@ SAY_LIGHT_OF_DAWN55
Definition chapter5.cpp:99
@ SAY_LIGHT_OF_DAWN30
Definition chapter5.cpp:74
@ SAY_LIGHT_OF_DAWN07
Definition chapter5.cpp:66
@ SAY_LIGHT_OF_DAWN45
Definition chapter5.cpp:89
@ NPC_LEONID_BARTHALOMEW_THE_REVERED
Definition chapter5.cpp:203
@ SPELL_HERO_AGGRO_AURA
Definition chapter5.cpp:178
@ NPC_HIGHLORD_DARION_MOGRAINE
Definition chapter5.cpp:138
@ NPC_THASSARIAN
Definition chapter5.cpp:153
@ SAY_LIGHT_OF_DAWN57
Definition chapter5.cpp:101
@ SPELL_DEATH_GRIP
Definition chapter5.cpp:155
@ SAY_LIGHT_OF_DAWN03
Definition chapter5.cpp:62
@ NPC_KORFAX_CHAMPION_OF_THE_LIGHT
Definition chapter5.cpp:198
@ SAY_LIGHT_OF_DAWN43
Definition chapter5.cpp:87
@ NPC_RAYNE
Definition chapter5.cpp:209
@ EMOTE_LIGHT_OF_DAWN07
Definition chapter5.cpp:120
@ SPELL_HOLY_LIGHT2
Definition chapter5.cpp:207
@ SPELL_TIRION_CHARGE_VISUAL
Definition chapter5.cpp:195
@ SPELL_WRATH
Definition chapter5.cpp:213
@ SAY_LIGHT_OF_DAWN50
Definition chapter5.cpp:94
@ SPELL_SOUL_FEAST_ALEX
Definition chapter5.cpp:164
@ ENCOUNTER_GHOUL_NUMBER
Definition chapter5.cpp:41
@ NPC_DUKE_NICHOLAS_ZVERENHOFF
Definition chapter5.cpp:204
@ ENCOUNTER_BEHEMOTH_NUMBER
Definition chapter5.cpp:40
@ ENCOUNTER_EARTHSHATTER_NUMBER
Definition chapter5.cpp:38
@ ENCOUNTER_WARRIOR_NUMBER
Definition chapter5.cpp:42
@ SAY_LIGHT_OF_DAWN36
Definition chapter5.cpp:80
@ ENCOUNTER_DK_TIMER
Definition chapter5.cpp:36
@ SAY_LIGHT_OF_DAWN48
Definition chapter5.cpp:92
@ SPELL_HOLY_LIGHT1
Definition chapter5.cpp:216
@ EMOTE_LIGHT_OF_DAWN12
Definition chapter5.cpp:125
@ SPELL_HOLY_STRIKE
Definition chapter5.cpp:217
@ NPC_LORD_MAXWELL_TYROSUS
Definition chapter5.cpp:202
@ SAY_LIGHT_OF_DAWN60
Definition chapter5.cpp:104
@ SAY_LIGHT_OF_DAWN39
Definition chapter5.cpp:83
@ ENCOUNTER_DEFENDER_NUMBER
Definition chapter5.cpp:37
@ SPELL_THUNDER
Definition chapter5.cpp:223
@ SAY_LIGHT_OF_DAWN51
Definition chapter5.cpp:95
@ SPELL_REBIRTH_OF_THE_ASHBRINGER
Definition chapter5.cpp:193
@ SAY_LIGHT_OF_DAWN05
Definition chapter5.cpp:64
@ SPELL_UPPERCUT
Definition chapter5.cpp:219
@ SAY_LIGHT_OF_DAWN25
Definition chapter5.cpp:69
@ SPELL_THE_LIGHT_OF_DAWN_Q
Definition chapter5.cpp:134
@ NPC_RIMBLAT_EARTHSHATTER
Definition chapter5.cpp:221
@ SPELL_ALEXANDROS_MOGRAINE_SPAWN
Definition chapter5.cpp:146
@ NPC_HIGHLORD_ALEXANDROS_MOGRAINE
Definition chapter5.cpp:185
@ SPELL_STARFALL
Definition chapter5.cpp:211
@ SPELL_TRANQUILITY
Definition chapter5.cpp:212
@ SAY_LIGHT_OF_DAWN66
Definition chapter5.cpp:110
@ NPC_KOLTIRA_DEATHWEAVER
Definition chapter5.cpp:151
@ SPELL_REBUKE
Definition chapter5.cpp:167
@ SAY_LIGHT_OF_DAWN63
Definition chapter5.cpp:107
static constexpr uint32 PATH_ESCORT_MOGRAINE
Definition chapter5.cpp:274
void AddSC_the_scarlet_enclave_c5()
Creature *const me
Definition CreatureAI.h:82
void EngagementOver()
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
bool isEmpty() const
Definition LinkedList.h:108
iterator end()
iterator begin()
Definition Map.h:281
PlayerList const & GetPlayers() const
Definition Map.h:448
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void Clear()
Definition ObjectGuid.h:150
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
uint32 GetGossipOptionAction(uint32 selection) const
Definition GossipDef.h:269
void PrepareQuestMenu(ObjectGuid guid)
Definition Player.cpp:14270
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15642
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition Player.cpp:14233
PlayerMenu * PlayerTalkClass
Definition Player.h:1969
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
void SetVisible(bool x)
Definition Unit.cpp:8513
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
Definition Unit.h:1146
void SetFaction(uint32 faction) override
Definition Unit.h:974
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3093
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
void Dismount()
Definition Unit.cpp:8234
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1098
bool IsQuestGiver() const
Definition Unit.h:1103
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
void SetVirtualItem(uint32 slot, uint32 itemId)
Definition Unit.cpp:13868
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:8184
void SetEmoteState(Emote emote)
Definition Unit.h:967
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:5535
uint32 GetFaction() const override
Definition Unit.h:973
bool SetWalk(bool enable)
Definition Unit.cpp:13268
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition Unit.cpp:8678
void HandleEmoteCommand(Emote emoteId)
Definition Unit.cpp:1568
void SetStandState(UnitStandStateType state)
Definition Unit.cpp:10363
void RemoveAllAuras()
Definition Unit.cpp:4157
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:5691
Map * GetMap() const
Definition Object.h:449
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
Definition Object.cpp:2856
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1992
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition Object.cpp:2015
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
Definition Object.cpp:1226
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1192
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
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)
bool HasEscortState(uint32 escortState)
void EnterEvadeMode(EvadeReason=EVADE_REASON_OTHER) override
void LoadPath(uint32 pathId)
void SetEscortPaused(bool on)
void UpdateAI(uint32 diff) override
Position GetPositionWithOffset(Position const &offset) const
Definition Position.cpp:60
float GetPositionZ() const
Definition Position.h:81
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
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:343
ObjectGuid uiBehemothGUID[ENCOUNTER_BEHEMOTH_NUMBER]
Definition chapter5.cpp:344
ObjectGuid uiWarriorGUID[ENCOUNTER_WARRIOR_NUMBER]
Definition chapter5.cpp:346
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
void WaypointReached(uint32 waypointId, uint32) override
Definition chapter5.cpp:465
ObjectGuid uiDefenderGUID[ENCOUNTER_DEFENDER_NUMBER]
Definition chapter5.cpp:335
ObjectGuid uiEarthshatterGUID[ENCOUNTER_EARTHSHATTER_NUMBER]
Definition chapter5.cpp:336