TrinityCore
Loading...
Searching...
No Matches
chapter1.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 "CreatureAIImpl.h"
19#include "ScriptMgr.h"
20#include "CombatAI.h"
21#include "CreatureTextMgr.h"
22#include "G3DPosition.hpp"
23#include "GameObject.h"
24#include "GameObjectAI.h"
25#include "Log.h"
26#include "MotionMaster.h"
27#include "MoveSplineInit.h"
28#include "ObjectAccessor.h"
29#include "ObjectMgr.h"
30#include "PassiveAI.h"
31#include "Player.h"
32#include "ScriptedEscortAI.h"
33#include "ScriptedGossip.h"
34#include "SpellAuraEffects.h"
35#include "SpellInfo.h"
36#include "SpellScript.h"
37#include "TemporarySummon.h"
38#include "Vehicle.h"
39
40/*######
41##Quest 12848
42######*/
43
44#define GCD_CAST 1
45
64
73
75{
76 191577,
77 191580,
78 191581,
79 191582,
80 191583,
81 191584,
82 191585,
83 191586,
84 191587,
85 191588,
86 191589,
87 191590
88};
89
91{
92 29519,
93 29520,
94 29565,
95 29566,
96 29567
97};
98
100{
101public:
102 npc_unworthy_initiate() : CreatureScript("npc_unworthy_initiate") { }
103
105 {
107 {
108 Initialize();
112
113 wait_timer = 0;
114 anchorX = 0.f;
115 anchorY = 0.f;
116 }
117
119 {
122 }
123
129
131
132 void Reset() override
133 {
134 Initialize();
135 events.Reset();
137 me->SetImmuneToPC(true);
139 me->LoadEquipment(0, true);
140 }
141
149
150 void MovementInform(uint32 type, uint32 id) override
151 {
152 if (type != POINT_MOTION_TYPE)
153 return;
154
155 if (id == 1)
156 {
157 wait_timer = 5000;
158 me->LoadEquipment(1);
160
162 Talk(SAY_EVENT_ATTACK, starter);
163
165 }
166 }
167
168 void EventStart(Creature* anchor, Player* target)
169 {
170 wait_timer = 5000;
172
175
176 float z;
177 anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f);
178
179 playerGUID = target->GetGUID();
180 Talk(SAY_EVENT_START, target);
181 }
182
183 void UpdateAI(uint32 diff) override
184 {
185 switch (phase)
186 {
187 case PHASE_CHAINED:
188 if (!anchorGUID)
189 {
190 if (Creature* anchor = me->FindNearestCreature(29521, 30))
191 {
192 anchor->AI()->SetGUID(me->GetGUID());
193 anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true);
194 anchorGUID = anchor->GetGUID();
195 }
196 else
197 TC_LOG_ERROR("scripts", "npc_unworthy_initiateAI: unable to find anchor!");
198
199 float dist = 99.0f;
200 GameObject* prison = nullptr;
201
202 for (uint8 i = 0; i < 12; ++i)
203 {
204 if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i], 30))
205 {
206 if (me->IsWithinDist(temp_prison, dist, false))
207 {
208 dist = me->GetDistance2d(temp_prison);
209 prison = temp_prison;
210 }
211 }
212 }
213
214 if (prison)
215 prison->ResetDoorOrButton();
216 else
217 TC_LOG_ERROR("scripts", "npc_unworthy_initiateAI: unable to find prison!");
218 }
219 break;
220 case PHASE_TO_EQUIP:
221 if (wait_timer)
222 {
223 if (wait_timer > diff)
224 wait_timer -= diff;
225 else
226 {
228 //TC_LOG_DEBUG("scripts", "npc_unworthy_initiateAI: move to {} {} {}", anchorX, anchorY, me->GetPositionZ());
230 wait_timer = 0;
231 }
232 }
233 break;
234 case PHASE_TO_ATTACK:
235 if (wait_timer)
236 {
237 if (wait_timer > diff)
238 wait_timer -= diff;
239 else
240 {
242 me->SetImmuneToPC(false);
245
247 AttackStart(target);
248 wait_timer = 0;
249 }
250 }
251 break;
252 case PHASE_ATTACKING:
253 if (!UpdateVictim())
254 return;
255
256 events.Update(diff);
257
258 while (uint32 eventId = events.ExecuteEvent())
259 {
260 switch (eventId)
261 {
262 case EVENT_ICY_TOUCH:
266 break;
271 break;
276 break;
277 case EVENT_DEATH_COIL:
281 break;
282 }
283 }
284
286 break;
287 default:
288 break;
289 }
290 }
291 };
292
293 CreatureAI* GetAI(Creature* creature) const override
294 {
295 return new npc_unworthy_initiateAI(creature);
296 }
297};
298
300{
301public:
302 npc_unworthy_initiate_anchor() : CreatureScript("npc_unworthy_initiate_anchor") { }
303
304 CreatureAI* GetAI(Creature* creature) const override
305 {
306 return new npc_unworthy_initiate_anchorAI(creature);
307 }
308
310 {
312
314
315 void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
316 {
317 prisonerGUID = guid;
318 }
319
320 ObjectGuid GetGUID(int32 /*id*/) const override
321 {
322 return prisonerGUID;
323 }
324 };
325};
326
328{
329 public:
330 go_acherus_soul_prison() : GameObjectScript("go_acherus_soul_prison") { }
331
333 {
335
336 bool OnGossipHello(Player* player) override
337 {
338 if (Creature* anchor = me->FindNearestCreature(29521, 15))
339 {
340 ObjectGuid prisonerGUID = anchor->AI()->GetGUID();
341 if (!prisonerGUID.IsEmpty())
342 if (Creature* prisoner = ObjectAccessor::GetCreature(*player, prisonerGUID))
343 ENSURE_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player);
344 }
345
346 return false;
347 }
348 };
349
350 GameObjectAI* GetAI(GameObject* go) const override
351 {
352 return new go_acherus_soul_prisonAI(go);
353 }
354};
355
356// 51519 - Death Knight Initiate Visual
358{
360
362 {
363 Creature* target = GetHitCreature();
364 if (!target)
365 return;
366
367 uint32 spellId;
368 switch (target->GetDisplayId())
369 {
370 case 25369: spellId = 51552; break; // bloodelf female
371 case 25373: spellId = 51551; break; // bloodelf male
372 case 25363: spellId = 51542; break; // draenei female
373 case 25357: spellId = 51541; break; // draenei male
374 case 25361: spellId = 51537; break; // dwarf female
375 case 25356: spellId = 51538; break; // dwarf male
376 case 25372: spellId = 51550; break; // forsaken female
377 case 25367: spellId = 51549; break; // forsaken male
378 case 25362: spellId = 51540; break; // gnome female
379 case 25359: spellId = 51539; break; // gnome male
380 case 25355: spellId = 51534; break; // human female
381 case 25354: spellId = 51520; break; // human male
382 case 25360: spellId = 51536; break; // nightelf female
383 case 25358: spellId = 51535; break; // nightelf male
384 case 25368: spellId = 51544; break; // orc female
385 case 25364: spellId = 51543; break; // orc male
386 case 25371: spellId = 51548; break; // tauren female
387 case 25366: spellId = 51547; break; // tauren male
388 case 25370: spellId = 51545; break; // troll female
389 case 25365: spellId = 51546; break; // troll male
390 default: return;
391 }
392
393 target->CastSpell(target, spellId, true);
394 target->LoadEquipment();
395 }
396
401};
402
403/*######
404## npc_eye_of_acherus
405######*/
406
425
426static constexpr uint8 const EyeOfAcherusPathSize = 4;
428{
429 { 2361.21f, -5660.45f, 496.744f },
430 { 2341.571f, -5672.797f, 538.3942f },
431 { 1957.4f, -5844.1f, 273.867f },
432 { 1758.01f, -5876.79f, 166.867f }
433};
434
436{
438 {
439 creature->SetDisplayId(creature->GetCreatureTemplate()->Modelid1);
440 creature->SetReactState(REACT_PASSIVE);
441 }
442
449
458
459 void UpdateAI(uint32 diff) override
460 {
461 _events.Update(diff);
462
463 while (uint32 eventId = _events.ExecuteEvent())
464 {
465 switch (eventId)
466 {
468 if (Unit* owner = me->GetCharmerOrOwner())
471 break;
472 case EVENT_UNROOT:
476 break;
478 {
479 std::function<void(Movement::MoveSplineInit&)> initializer = [=, me = me](Movement::MoveSplineInit& init)
480 {
482 init.MovebyPath(path);
483 init.SetFly();
484 if (Unit* owner = me->GetCharmerOrOwner())
485 init.SetVelocity(owner->GetSpeed(MOVE_RUN));
486 };
487
489 break;
490 }
495 if (Unit* owner = me->GetCharmerOrOwner())
497 break;
498 default:
499 break;
500 }
501 }
502 }
503
504 void MovementInform(uint32 movementType, uint32 pointId) override
505 {
506 if (movementType != POINT_MOTION_TYPE)
507 return;
508
509 switch (pointId)
510 {
511 case POINT_NEW_AVALON:
514 break;
515 default:
516 break;
517 }
518 }
519
520private:
522};
523
536
537// 51858 - Siphon of Acherus
539{
541
542 bool Validate(SpellInfo const* /*spellInfo*/) override
543 {
544 return ValidateSpellInfo(
545 {
550 });
551 }
552
553 void HandleDummy(SpellEffIndex /*effIndex*/)
554 {
555 uint32 spellId = 0;
556
557 switch (GetHitCreature()->GetEntry())
558 {
560 spellId = SPELL_FORGE_CREDIT;
561 break;
563 spellId = SPELL_TOWN_HALL_CREDIT;
564 break;
565 case NPC_SCARLET_HOLD:
567 break;
569 spellId = SPELL_CHAPEL_CREDIT;
570 break;
571 default:
572 return;
573 }
574
575 GetCaster()->CastSpell(nullptr, spellId, true);
576 }
577
582};
583
584// 52694 - Recall Eye of Acherus
586{
588
589 bool Validate(SpellInfo const* /*spell*/) override
590 {
592 }
593
594 void HandleDummy(SpellEffIndex /*effIndex*/)
595 {
596 if (Player* player = Object::ToPlayer(GetCaster()->GetCharmerOrOwner()))
597 {
598 player->StopCastingCharm();
599 player->StopCastingBindSight();
600 player->RemoveAura(SPELL_THE_EYE_OF_ACHERUS);
601 }
602 }
603
608};
609
610/*######
611## npc_death_knight_initiate
612######*/
613
615{
616 SPELL_DUEL = 52996,
617 //SPELL_DUEL_TRIGGERED = 52990,
621};
622
624{
626};
627
629{
632
634{
635public:
636 npc_death_knight_initiate() : CreatureScript("npc_death_knight_initiate") { }
637
639 {
641 {
642 Initialize();
643 }
644
646 {
648 m_uiDuelTimer = 5000;
649 m_bIsDuelInProgress = false;
650 lose = false;
651 }
652
653 bool lose;
657
658 void Reset() override
659 {
660 Initialize();
661
665 }
666
667 void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
668 {
669 if (!m_bIsDuelInProgress && spellInfo->Id == SPELL_DUEL)
670 {
671 m_uiDuelerGUID = caster->GetGUID();
672 Talk(SAY_DUEL, caster);
673 m_bIsDuelInProgress = true;
674 }
675 }
676
677 void DamageTaken(Unit* pDoneBy, uint32 &uiDamage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
678 {
679 if (m_bIsDuelInProgress && pDoneBy && pDoneBy->IsControlledByPlayer())
680 {
681 if (pDoneBy->GetGUID() != m_uiDuelerGUID && pDoneBy->GetOwnerGUID() != m_uiDuelerGUID) // other players cannot help
682 uiDamage = 0;
683 else if (uiDamage >= me->GetHealth())
684 {
685 uiDamage = 0;
686
687 if (!lose)
688 {
689 pDoneBy->RemoveGameObject(SPELL_DUEL_FLAG, true);
690 pDoneBy->AttackStop();
691 me->CastSpell(pDoneBy, SPELL_DUEL_VICTORY, true);
692 lose = true;
693 me->CastSpell(me, SPELL_GROVEL, true);
695 }
696 }
697 }
698 }
699
700 void UpdateAI(uint32 uiDiff) override
701 {
702 if (!UpdateVictim())
703 {
705 {
706 if (m_uiDuelTimer <= uiDiff)
707 {
709
711 AttackStart(unit);
712 }
713 else
714 m_uiDuelTimer -= uiDiff;
715 }
716 return;
717 }
718
720 {
721 if (lose)
722 {
723 if (!me->HasAura(SPELL_GROVEL))
725 return;
726 }
728 {
729 me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_GROVEL, true); // beg
732 return;
733 }
734 }
735
737
738 CombatAI::UpdateAI(uiDiff);
739 }
740
741 bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
742 {
743 uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
744 ClearGossipMenuFor(player);
745 if (action == GOSSIP_ACTION_INFO_DEF)
746 {
747 CloseGossipMenuFor(player);
748
749 if (player->IsInCombat() || me->IsInCombat())
750 return true;
751
753 return true;
754
755 me->SetImmuneToPC(false);
757
758 player->CastSpell(me, SPELL_DUEL, false);
759 player->CastSpell(player, SPELL_DUEL_FLAG, true);
760 }
761 return true;
762 }
763
764 bool OnGossipHello(Player* player) override
765 {
767 InitGossipMenuFor(player, gossipMenuId);
769 {
770 if (player->HealthBelowPct(10))
771 return true;
772
773 if (player->IsInCombat() || me->IsInCombat())
774 return true;
775
777 SendGossipMenuFor(player, player->GetGossipTextId(me), me->GetGUID());
778 }
779 return true;
780 }
781 };
782
783 CreatureAI* GetAI(Creature* creature) const override
784 {
785 return new npc_death_knight_initiateAI(creature);
786 }
787};
788
789/*######
790## npc_dark_rider_of_acherus
791######*/
792
803
805{
807
808 void JustAppeared() override
809 {
810 if (TempSummon* summon = me->ToTempSummon())
811 _horseGUID = summon->GetSummonerGUID();
812
814 }
815
816 void Reset() override
817 {
818 _events.Reset();
819 }
820
821 void UpdateAI(uint32 diff) override
822 {
823 _events.Update(diff);
824
825 while (uint32 eventId = _events.ExecuteEvent())
826 {
827 switch (eventId)
828 {
832 me->GetMotionMaster()->MoveChase(horse);
834 break;
838 DoCast(horse, SPELL_DESPAWN_HORSE, true);
840 break;
841 case EVENT_END_SCRIPT:
843 break;
844 default:
845 break;
846 }
847 }
848 }
849
850 void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
851 {
852 if (spellInfo->Id == SPELL_DESPAWN_HORSE && target->GetGUID() == _horseGUID)
853 if (Creature* creature = target->ToCreature())
854 creature->DespawnOrUnsummon(2s);
855 }
856
857private:
860};
861
862/*######
863## npc_salanar_the_horseman
864######*/
865
876
878{
879public:
880 npc_salanar_the_horseman() : CreatureScript("npc_salanar_the_horseman") { }
881
883 {
885
886 void MoveInLineOfSight(Unit* who) override
887 {
889
890 if (who->GetTypeId() == TYPEID_UNIT && who->IsVehicle() && me->IsWithinDistInMap(who, 5.0f))
891 {
892 if (Unit* charmer = who->GetCharmer())
893 {
894 if (Player* player = charmer->ToPlayer())
895 {
896 if (player->GetQuestStatus(QUEST_INTO_REALM_OF_SHADOWS) == QUEST_STATUS_INCOMPLETE)
897 {
898 player->GroupEventHappens(QUEST_INTO_REALM_OF_SHADOWS, me);
900 charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE);
901 if (Creature* creature = who->ToCreature())
902 {
903 creature->DespawnOrUnsummon();
904 //creature->Respawn(true);
905 }
906 }
907
908 player->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS);
909 }
910 }
911 }
912 }
913 };
914
915 CreatureAI* GetAI(Creature* creature) const override
916 {
917 return new npc_salanar_the_horsemanAI(creature);
918 }
919};
920
922{
923 SEAT_ID_0 = 0
925
926// 52265 - Repo
928{
930
931 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
932 {
933 Creature* creature = GetTarget()->ToCreature();
934 if (!creature)
935 return;
936
937 if (Vehicle* vehicleKit = creature->GetVehicleKit())
938 if (Unit* passenger = vehicleKit->GetPassenger(SEAT_ID_0))
939 GetCaster()->EngageWithTarget(passenger);
940
941 creature->DespawnOrUnsummon(1s);
942 }
943
948};
949
950// 52264 - Deliver Stolen Horse
978
979/*######
980## npc_ros_dark_rider
981######*/
982
984{
985public:
986 npc_ros_dark_rider() : CreatureScript("npc_ros_dark_rider") { }
987
988 CreatureAI* GetAI(Creature* creature) const override
989 {
990 return new npc_ros_dark_riderAI(creature);
991 }
992
994 {
995 npc_ros_dark_riderAI(Creature* creature) : ScriptedAI(creature) { }
996
997 void JustEngagedWith(Unit* /*who*/) override
998 {
999 me->ExitVehicle();
1000 }
1001
1002 void Reset() override
1003 {
1004 Creature* deathcharger = me->FindNearestCreature(28782, 30);
1005 if (!deathcharger)
1006 return;
1007
1008 deathcharger->RestoreFaction();
1011 if (!me->GetVehicle() && deathcharger->IsVehicle() && deathcharger->GetVehicleKit()->HasEmptySeat(0))
1012 me->EnterVehicle(deathcharger);
1013 }
1014
1015 void JustDied(Unit* killer) override
1016 {
1017 Creature* deathcharger = me->FindNearestCreature(28782, 30);
1018 if (!deathcharger || !killer)
1019 return;
1020
1021 if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle())
1022 {
1023 deathcharger->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
1026 }
1027 }
1028 };
1029
1030};
1031
1032// correct way: 52312 52314 52555 ...
1034{
1036
1037 NPC_GHOULS = 28845,
1038 NPC_GHOSTS = 28846,
1039};
1040
1042{
1043public:
1044 npc_dkc1_gothik() : CreatureScript("npc_dkc1_gothik") { }
1045
1046 CreatureAI* GetAI(Creature* creature) const override
1047 {
1048 return new npc_dkc1_gothikAI(creature);
1049 }
1050
1052 {
1053 npc_dkc1_gothikAI(Creature* creature) : ScriptedAI(creature) { }
1054
1055 void MoveInLineOfSight(Unit* who) override
1056
1057 {
1059
1060 if (who->GetEntry() == NPC_GHOULS && me->IsWithinDistInMap(who, 10.0f))
1061 {
1062 if (Unit* owner = who->GetOwner())
1063 {
1064 if (Player* player = owner->ToPlayer())
1065 {
1066 Creature* creature = who->ToCreature();
1067 if (player->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE)
1068 creature->CastSpell(owner, 52517, true);
1069
1071 // stand next to Gothik and be commanded into the pit
1072 // and dig into the ground.
1073 creature->DespawnOrUnsummon();
1074
1075 if (player->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE)
1076 owner->RemoveAllMinionsByEntry(NPC_GHOSTS);
1077 }
1078 }
1079 }
1080 }
1081 };
1082
1083};
1084
1086{
1088 {
1090 }
1091
1092 void JustAppeared() override
1093 {
1095
1096 if (urand(0, 1))
1097 if (Unit* owner = me->GetOwner())
1098 Talk(SAY_LINE_0, owner);
1099 }
1100
1101 void FindMinions(Unit* owner)
1102 {
1103 std::list<Creature*> MinionList;
1104 owner->GetAllMinionsByEntry(MinionList, NPC_GHOULS);
1105
1106 if (!MinionList.empty())
1107 {
1108 for (Creature* creature : MinionList)
1109 {
1110 if (creature->GetOwner()->GetGUID() == me->GetOwner()->GetGUID())
1111 {
1112 if (creature->IsInCombat() && creature->getAttackerForHelper())
1113 {
1114 AttackStart(creature->getAttackerForHelper());
1115 }
1116 }
1117 }
1118 }
1119 }
1120
1121 void UpdateAI(uint32 /*diff*/) override
1122 {
1123 if (!me->IsInCombat())
1124 {
1125 if (Unit* owner = me->GetOwner())
1126 {
1127 Player* plrOwner = owner->ToPlayer();
1128 if (plrOwner && plrOwner->IsInCombat())
1129 {
1130 if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == NPC_GHOSTS)
1131 AttackStart(plrOwner->getAttackerForHelper());
1132 else
1133 FindMinions(owner);
1134 }
1135 }
1136 }
1137
1138 if (!UpdateVictim() || !me->GetVictim())
1139 return;
1140
1141 //ScriptedAI::UpdateAI(diff);
1142 //Check if we have a current target
1143 if (me->EnsureVictim()->GetEntry() == NPC_GHOSTS)
1144 {
1145 if (me->isAttackReady())
1146 {
1147 //If we are within range melee the target
1149 {
1152 }
1153 }
1154 }
1155 }
1156};
1157
1163
1164// 52479 - Gift of the Harvester
1166{
1168
1169 bool Validate(SpellInfo const* /*spell*/) override
1170 {
1171 return ValidateSpellInfo(
1172 {
1175 });
1176 }
1177
1179 {
1180 Unit* originalCaster = GetOriginalCaster();
1181 Unit* target = GetHitUnit();
1182
1183 if (originalCaster && target)
1184 originalCaster->CastSpell(target, RAND(SPELL_GHOUL_TRANFORM, SPELL_GHOST_TRANSFORM), true);
1185 }
1186
1191};
1192
1193/*######
1194## Quest 12842: Runeforging: Preparation For Battle
1195######*/
1196
1202
1203/* 53323 - Rune of Swordshattering
1204 53331 - Rune of Lichbane
1205 53341 - Rune of Cinderglacier
1206 53342 - Rune of Spellshattering
1207 53343 - Rune of Razorice
1208 53344 - Rune of the Fallen Crusader
1209 54446 - Rune of Swordbreaking
1210 54447 - Rune of Spellbreaking
1211 62158 - Rune of the Stoneskin Gargoyle
1212 70164 - Rune of the Nerubian Carapace */
1214{
1216
1217 bool Validate(SpellInfo const* /*spellInfo*/) override
1218 {
1220 sObjectMgr->GetQuestTemplate(QUEST_RUNEFORGING);
1221 }
1222
1223 void HandleDummy(SpellEffIndex /*effIndex*/)
1224 {
1225 if (Player* caster = GetCaster()->ToPlayer())
1226 if (caster->GetQuestStatus(QUEST_RUNEFORGING) == QUEST_STATUS_INCOMPLETE)
1227 caster->CastSpell(caster, SPELL_RUNEFORGING_CREDIT);
1228 }
1229
1234};
1235
1240
1241// 52124 - Sky Darkener Assault
1261
1262/*######
1263## Quest 12619: The Emblazoned Runeblade
1264######*/
1265
1266// 51769 - Emblazon Runeblade
1283
1284// 51770 - Emblazon Runeblade
1304
First const & RAND(First const &first, Second const &second, Rest const &... rest)
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
@ MOTION_PRIORITY_NORMAL
@ POINT_MOTION_TYPE
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
#define sObjectMgr
Definition ObjectMgr.h:1721
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:107
@ QUEST_STATUS_COMPLETE
Definition QuestDef.h:105
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1139
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
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 InitGossipMenuFor(Player *player, uint32 menuId)
void CloseGossipMenuFor(Player *player)
@ GOSSIP_SENDER_MAIN
@ GOSSIP_ACTION_INFO_DEF
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_KILL_CREDIT2
@ FACTION_SCARLET_CRUSADE_2
@ FACTION_UNDEAD_SCOURGE_2
@ FACTION_FRIENDLY
@ FACTION_MONSTER
@ FACTION_CREATURE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define SpellEffectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define ENSURE_AI(a, b)
Definition UnitAI.h:28
@ REACT_DEFENSIVE
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STAND_STATE_KNEEL
Definition UnitDefines.h:42
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:34
@ UNIT_NPC_FLAG_SPELLCLICK
@ MOVE_RUN
@ UNIT_FLAG_CAN_SWIM
@ UNIT_FLAG_UNINTERACTIBLE
DamageEffectType
Definition Unit.h:352
static constexpr uint8 const EyeOfAcherusPathSize
Definition chapter1.cpp:426
Says_VBM
Definition chapter1.cpp:624
@ SAY_DUEL
Definition chapter1.cpp:625
GiftOfTheHarvester
@ SPELL_GHOUL_TRANFORM
@ SPELL_GHOST_TRANSFORM
HorseSeats
Definition chapter1.cpp:922
@ SEAT_ID_0
Definition chapter1.cpp:923
#define GCD_CAST
Definition chapter1.cpp:44
void AddSC_the_scarlet_enclave_c1()
SkyDarkenerAssault
@ SPELL_SKY_DARKENER_ASSAULT
Misc_VBN
Definition chapter1.cpp:629
@ QUEST_DEATH_CHALLENGE
Definition chapter1.cpp:630
DeathComesFromOnHigh
Definition chapter1.cpp:525
@ NPC_NEW_AVALON_TOWN_HALL
Definition chapter1.cpp:532
@ NPC_NEW_AVALON_FORGE
Definition chapter1.cpp:531
@ SPELL_TOWN_HALL_CREDIT
Definition chapter1.cpp:527
@ NPC_CHAPEL_OF_THE_CRIMSON_FLAME
Definition chapter1.cpp:534
@ NPC_SCARLET_HOLD
Definition chapter1.cpp:533
@ SPELL_SCARLET_HOLD_CREDIT
Definition chapter1.cpp:528
@ SPELL_CHAPEL_CREDIT
Definition chapter1.cpp:529
@ SPELL_FORGE_CREDIT
Definition chapter1.cpp:526
Spells_DKI
Definition chapter1.cpp:615
@ SPELL_DUEL_FLAG
Definition chapter1.cpp:619
@ SPELL_GROVEL
Definition chapter1.cpp:620
@ SPELL_DUEL
Definition chapter1.cpp:616
@ SPELL_DUEL_VICTORY
Definition chapter1.cpp:618
Runeforging
@ QUEST_RUNEFORGING
@ SPELL_RUNEFORGING_CREDIT
SalanarTheHorseman
Definition chapter1.cpp:867
@ SALANAR_SAY
Definition chapter1.cpp:868
@ SPELL_EFFECT_STOLEN_HORSE
Definition chapter1.cpp:870
@ QUEST_INTO_REALM_OF_SHADOWS
Definition chapter1.cpp:869
@ SPELL_REALM_OF_SHADOWS
Definition chapter1.cpp:874
@ SPELL_DELIVER_STOLEN_HORSE
Definition chapter1.cpp:871
@ SPELL_CALL_DARK_RIDER
Definition chapter1.cpp:872
@ SPELL_EFFECT_OVERTAKE
Definition chapter1.cpp:873
UnworthyInitiatePhase
Definition chapter1.cpp:66
@ PHASE_TO_ATTACK
Definition chapter1.cpp:70
@ PHASE_EQUIPING
Definition chapter1.cpp:69
@ PHASE_TO_EQUIP
Definition chapter1.cpp:68
@ PHASE_CHAINED
Definition chapter1.cpp:67
@ PHASE_ATTACKING
Definition chapter1.cpp:71
TheGiftThatKeepsOnGiving
@ SAY_LINE_0
@ NPC_GHOSTS
@ NPC_GHOULS
EyeOfAcherusMisc
Definition chapter1.cpp:408
@ SPELL_EYE_OF_ACHERUS_VISUAL
Definition chapter1.cpp:410
@ SAY_LAUNCH_TOWARDS_DESTINATION
Definition chapter1.cpp:420
@ EVENT_GRANT_CONTROL
Definition chapter1.cpp:418
@ SPELL_THE_EYE_OF_ACHERUS
Definition chapter1.cpp:409
@ EVENT_LAUNCH_TOWARDS_DESTINATION
Definition chapter1.cpp:417
@ SPELL_ROOT_SELF
Definition chapter1.cpp:413
@ EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION
Definition chapter1.cpp:415
@ SAY_EYE_UNDER_CONTROL
Definition chapter1.cpp:421
@ SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST
Definition chapter1.cpp:411
@ SPELL_EYE_OF_ACHERUS_FLIGHT
Definition chapter1.cpp:412
@ POINT_NEW_AVALON
Definition chapter1.cpp:423
@ EVENT_UNROOT
Definition chapter1.cpp:416
G3D::Vector3 const EyeOfAcherusPath[EyeOfAcherusPathSize]
Definition chapter1.cpp:427
uint32 acherus_soul_prison[12]
Definition chapter1.cpp:74
uint32 acherus_unworthy_initiate[5]
Definition chapter1.cpp:90
DarkRiderOfAcherus
Definition chapter1.cpp:794
@ SAY_DARK_RIDER
Definition chapter1.cpp:795
@ SPELL_DESPAWN_HORSE
Definition chapter1.cpp:801
@ EVENT_DESPAWN_HORSE
Definition chapter1.cpp:798
@ EVENT_START_MOVING
Definition chapter1.cpp:797
@ EVENT_END_SCRIPT
Definition chapter1.cpp:799
UnworthyInitiate
Definition chapter1.cpp:47
@ SPELL_DEATH_COIL
Definition chapter1.cpp:54
@ SPELL_PLAGUE_STRIKE
Definition chapter1.cpp:52
@ EVENT_PLAGUE_STRIKE
Definition chapter1.cpp:60
@ SPELL_BLOOD_STRIKE
Definition chapter1.cpp:53
@ SAY_EVENT_START
Definition chapter1.cpp:56
@ SAY_EVENT_ATTACK
Definition chapter1.cpp:57
@ SPELL_DK_INITIATE_VISUAL
Definition chapter1.cpp:49
@ EVENT_ICY_TOUCH
Definition chapter1.cpp:59
@ EVENT_BLOOD_STRIKE
Definition chapter1.cpp:61
@ SPELL_ICY_TOUCH
Definition chapter1.cpp:51
@ SPELL_SOUL_PRISON_CHAIN
Definition chapter1.cpp:48
@ EVENT_DEATH_COIL
Definition chapter1.cpp:62
SpellEffectInfo const & GetSpellEffectInfo() const
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetCaster() const
Unit * GetTarget() const
void Reset() override
Definition CombatAI.cpp:64
void UpdateAI(uint32 diff) override
Definition CombatAI.cpp:89
virtual void MoveInLineOfSight(Unit *)
virtual void JustAppeared()
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
int8 GetOriginalEquipmentId() const
Definition Creature.h:176
void SetDisplayId(uint32 modelId) override
void SetImmuneToPC(bool apply) override
Definition Creature.h:129
void LoadEquipment(int8 id=1, bool force=false)
void SetReactState(ReactStates st)
Definition Creature.h:119
void SetCurrentEquipmentId(uint8 id)
Definition Creature.h:178
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetTarget(ObjectGuid guid) override
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:186
void ExitVehicle(Position const *exitPosition=nullptr) override
uint8 GetCurrentEquipmentId() const
Definition Creature.h:177
void Update(uint32 time)
Definition EventMap.h:67
void DelayEvents(Milliseconds delay)
Definition EventMap.cpp:95
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
GameObject *const me
void ResetDoorOrButton()
void LaunchMoveSpline(std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE)
void MoveChase(Unit *target, Optional< ChaseRange > dist={}, Optional< ChaseAngle > angle={})
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
bool IsEmpty() const
Definition ObjectGuid.h:172
void Clear()
Definition ObjectGuid.h:150
static Creature * ToCreature(Object *o)
Definition Object.h:186
Player * ToPlayer()
Definition Object.h:182
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
static Player * ToPlayer(Object *o)
Definition Object.h:180
uint32 GetGossipOptionAction(uint32 selection) const
Definition GossipDef.h:269
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition Player.cpp:15642
static uint32 GetDefaultGossipMenuForSource(WorldObject *source)
Definition Player.cpp:14251
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition Player.cpp:14233
PlayerMenu * PlayerTalkClass
Definition Player.h:1969
uint32 TriggerSpell
Definition SpellInfo.h:228
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
uint32 Id
Definition SpellInfo.h:289
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
Creature * GetHitCreature() const
Unit * GetCaster() const
HookList< EffectHandler > OnEffectHit
Unit * GetHitUnit() const
int32 GetEffectValue() const
HookList< EffectHandler > OnEffectHitTarget
Unit * GetOriginalCaster() const
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:30
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition Unit.cpp:12569
bool IsVehicle() const
Definition Unit.h:887
bool IsWithinMeleeRange(Unit const *obj) const
Definition Unit.h:844
Vehicle * GetVehicle() const
Definition Unit.h:1737
void RemoveGameObject(GameObject *gameObj, bool del)
Definition Unit.cpp:5111
void RestoreFaction()
Definition Unit.cpp:11776
void SetFaction(uint32 faction) override
Definition Unit.h:974
ObjectGuid GetOwnerGUID() const override
Definition Unit.h:1241
Unit * GetCharmer() const
Definition Unit.h:1253
Unit * getAttackerForHelper() const
Definition Unit.cpp:5512
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
bool IsFullHealth() const
Definition Unit.h:916
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1098
TempSummon * ToTempSummon()
Definition Unit.h:1794
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
Unit * EnsureVictim() const
Definition Unit.h:861
Unit * GetCharmerOrOwner() const
Definition Unit.h:1265
uint32 GetDisplayId() const
Definition Unit.h:1582
bool HealthBelowPct(int32 pct) const
Definition Unit.h:917
uint32 GetHealth() const
Definition Unit.h:913
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:1097
void EngageWithTarget(Unit *who)
Definition Unit.cpp:8292
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
Unit * GetVictim() const
Definition Unit.h:859
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
Definition Unit.cpp:2071
void SetStandState(UnitStandStateType state)
Definition Unit.cpp:10363
bool IsControlledByPlayer() const
Definition Unit.h:1258
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:954
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition Unit.h:835
Vehicle * GetVehicleKit() const
Definition Unit.h:1735
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition Unit.cpp:598
bool AttackStop()
Definition Unit.cpp:5645
void GetAllMinionsByEntry(std::list< Creature * > &Minions, uint32 entry)
Definition Unit.cpp:6062
bool IsInCombat() const
Definition Unit.h:1144
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
bool HasEmptySeat(int8 seatId) const
Checks if vehicle's seat specified by 'seatId' is empty.
Definition Vehicle.cpp:275
GameObject * FindNearestGameObject(uint32 entry, float range, bool spawnedOnly=true) const
Definition Object.cpp:2121
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
Unit * GetOwner() const
Definition Object.cpp:2180
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:1141
void GetContactPoint(WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
Definition Object.cpp:3271
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2099
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1192
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition Object.cpp:1187
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
GameObjectAI * GetAI(GameObject *go) const override
Definition chapter1.cpp:350
CreatureAI * GetAI(Creature *creature) const override
Definition chapter1.cpp:783
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
Definition chapter1.cpp:988
CreatureAI * GetAI(Creature *creature) const override
Definition chapter1.cpp:915
CreatureAI * GetAI(Creature *creature) const override
Definition chapter1.cpp:304
CreatureAI * GetAI(Creature *creature) const override
Definition chapter1.cpp:293
bool Validate(SpellInfo const *spellInfo) override
PrepareSpellScript(spell_chapter1_emblazon_runeblade_effect)
PrepareAuraScript(spell_chapter1_emblazon_runeblade)
void HandleEffectPeriodic(AuraEffect const *aurEff)
PrepareSpellScript(spell_chapter1_recall_eye_of_acherus)
bool Validate(SpellInfo const *) override
Definition chapter1.cpp:589
PrepareSpellScript(spell_chapter1_runeforging_credit)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_chapter1_siphon_of_acherus)
void HandleDummy(SpellEffIndex)
Definition chapter1.cpp:553
bool Validate(SpellInfo const *) override
Definition chapter1.cpp:542
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_chapter1_sky_darkener_assault)
void HandleScriptEffect(SpellEffIndex)
Definition chapter1.cpp:361
PrepareSpellScript(spell_death_knight_initiate_visual)
PrepareSpellScript(spell_deliver_stolen_horse)
void HandleScriptEffect(SpellEffIndex)
Definition chapter1.cpp:960
void Register() override
Definition chapter1.cpp:973
bool Validate(SpellInfo const *) override
Definition chapter1.cpp:955
void HandleScriptEffect(SpellEffIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_gift_of_the_harvester)
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
Definition chapter1.cpp:931
PrepareAuraScript(spell_stable_master_repo)
void Register() override
Definition chapter1.cpp:944
std::vector< Vector3 > PointsArray
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
float GetPositionZ() const
Definition Position.h:81
void AttackStart(Unit *) override
bool OnGossipHello(Player *player) override
Definition chapter1.cpp:336
void UpdateAI(uint32 diff) override
Definition chapter1.cpp:821
npc_dark_rider_of_acherus(Creature *creature)
Definition chapter1.cpp:806
void Reset() override
Definition chapter1.cpp:816
void JustAppeared() override
Definition chapter1.cpp:808
void SpellHitTarget(WorldObject *target, SpellInfo const *spellInfo) override
Definition chapter1.cpp:850
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage, DamageEffectType, SpellInfo const *) override
Definition chapter1.cpp:677
bool OnGossipSelect(Player *player, uint32, uint32 gossipListId) override
Definition chapter1.cpp:741
void SpellHit(WorldObject *caster, SpellInfo const *spellInfo) override
Definition chapter1.cpp:667
npc_dkc1_gothikAI(Creature *creature)
void MoveInLineOfSight(Unit *who) override
void UpdateAI(uint32 diff) override
Definition chapter1.cpp:459
npc_eye_of_acherus(Creature *creature)
Definition chapter1.cpp:437
void MovementInform(uint32 movementType, uint32 pointId) override
Definition chapter1.cpp:504
void OnCharmed(bool apply) override
Definition chapter1.cpp:450
void InitializeAI() override
Definition chapter1.cpp:443
void JustDied(Unit *killer) override
void UpdateAI(uint32) override
npc_scarlet_ghoul(Creature *creature)
void JustAppeared() override
void FindMinions(Unit *owner)
void EventStart(Creature *anchor, Player *target)
Definition chapter1.cpp:168
void MovementInform(uint32 type, uint32 id) override
Definition chapter1.cpp:150
void SetGUID(ObjectGuid const &guid, int32) override
Definition chapter1.cpp:315