TrinityCore
Loading...
Searching...
No Matches
zone_icecrown.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 "CombatAI.h"
20#include "Containers.h"
21#include "DB2Stores.h"
22#include "MotionMaster.h"
23#include "ObjectAccessor.h"
24#include "Player.h"
25#include "ScriptedCreature.h"
26#include "SpellAuras.h"
27#include "SpellScript.h"
28#include "TemporarySummon.h"
29#include "Vehicle.h"
30
31/*######
32## npc_argent_valiant
33######*/
34
41
43{
44 npc_argent_valiant(Creature* creature) : ScriptedAI(creature)
45 {
46 Initialize();
47 creature->GetMotionMaster()->MovePoint(0, 8599.258f, 963.951f, 547.553f);
48 creature->SetFaction(FACTION_FRIENDLY); //wrong faction in db?
49 }
50
52 {
53 uiChargeTimer = 7000;
55 }
56
59
60 void Reset() override
61 {
62 Initialize();
63 }
64
65 void MovementInform(uint32 uiType, uint32 /*uiId*/) override
66 {
67 if (uiType != POINT_MOTION_TYPE)
68 return;
69
71 }
72
73 void DamageTaken(Unit* pDoneBy, uint32& uiDamage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
74 {
75 if (uiDamage > me->GetHealth() && pDoneBy && pDoneBy->GetTypeId() == TYPEID_PLAYER)
76 {
77 uiDamage = 0;
78 pDoneBy->CastSpell(pDoneBy, SPELL_KILL_CREDIT, true);
83 }
84 }
85
86 void UpdateAI(uint32 uiDiff) override
87 {
88 if (!UpdateVictim())
89 return;
90
91 if (uiChargeTimer <= uiDiff)
92 {
94 uiChargeTimer = 7000;
95 } else uiChargeTimer -= uiDiff;
96
97 if (uiShieldBreakerTimer <= uiDiff)
98 {
100 uiShieldBreakerTimer = 10000;
101 } else uiShieldBreakerTimer -= uiDiff;
102 }
103};
104
105/*######
106## npc_guardian_pavilion
107######*/
108
117
119{
121 {
122 SetCombatMovement(false);
123 }
124
125 void MoveInLineOfSight(Unit* who) override
126
127 {
129 return;
130
131 if (!who || who->GetTypeId() != TYPEID_PLAYER || !me->IsHostileTo(who) || !me->isInBackInMap(who, 5.0f))
132 return;
133
135 return;
136
137 if (who->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
138 who->CastSpell(who, SPELL_TRESPASSER_H, true);
139 else
140 who->CastSpell(who, SPELL_TRESPASSER_A, true);
141
142 }
143};
144
145/*######
146* npc_tournament_training_dummy
147######*/
171
173{
175 {
176 Initialize();
177 SetCombatMovement(false);
178 }
179
181 {
182 isVulnerable = false;
183 }
184
187
188 void Reset() override
189 {
191 Initialize();
192
193 events.Reset();
195 }
196
197 void EnterEvadeMode(EvadeReason why) override
198 {
199 if (!_EnterEvadeMode(why))
200 return;
201
202 Reset();
203 }
204
205 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
206 {
207 damage = 0;
209 }
210
211 void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
212 {
213 Unit* unitCaster = caster->ToUnit();
214 if (!unitCaster)
215 return;
216
217 switch (me->GetEntry())
218 {
220 if (spellInfo->Id == SPELL_PLAYER_CHARGE)
221 if (isVulnerable)
222 DoCast(unitCaster, SPELL_CHARGE_CREDIT, true);
223 break;
224 case NPC_MELEE_TARGET:
225 if (spellInfo->Id == SPELL_PLAYER_THRUST)
226 {
227 DoCast(unitCaster, SPELL_MELEE_CREDIT, true);
228
229 if (Unit* target = unitCaster->GetVehicleBase())
230 DoCast(target, SPELL_COUNTERATTACK, true);
231 }
232 break;
234 if (spellInfo->Id == SPELL_PLAYER_BREAK_SHIELD)
235 if (isVulnerable)
236 DoCast(unitCaster, SPELL_RANGED_CREDIT, true);
237 break;
238 }
239
240 if (spellInfo->Id == SPELL_PLAYER_BREAK_SHIELD)
242 isVulnerable = true;
243 }
244
245 void UpdateAI(uint32 diff) override
246 {
247 events.Update(diff);
248
249 switch (events.ExecuteEvent())
250 {
252 switch (me->GetEntry())
253 {
255 {
258 break;
259 }
261 {
263 if (!defend || defend->GetStackAmount() < 3 || defend->GetDuration() <= 8000)
265 break;
266 }
267 }
268 isVulnerable = false;
270 break;
272 if (UpdateVictim())
273 {
276 }
277 break;
278 }
279
280 if (!UpdateVictim())
281 return;
282
285 }
286
287 void MoveInLineOfSight(Unit* /*who*/) override { }
288
289};
290
291// Battle for Crusaders' Pinnacle
293{
297 SPELL_TORCH = 58121,
298
307 NPC_LK = 31013,
308
309 BANNER_SAY = 0, // "The Blessed Banner of the Crusade has been planted.\n Defend the banner from all attackers!"
310 DALFORS_SAY_PRE_1 = 0, // "BY THE LIGHT! Those damned monsters! Look at what they've done to our people!"
311 DALFORS_SAY_PRE_2 = 1, // "Burn it down, boys. Burn it all down."
312 DALFORS_SAY_START = 2, // "Let 'em come. They'll pay for what they've done!"
313 DALFORS_YELL_FINISHED = 3, // "We've done it, lads! We've taken the pinnacle from the Scourge! Report to Father Gustav at once and tell him the good news! We're gonna get to buildin' and settin' up! Go!"
314 LK_TALK_1 = 0, // "Leave no survivors!"
315 LK_TALK_2 = 1, // "Cower before my terrible creations!"
316 LK_TALK_3 = 2, // "Feast my children! Feast upon the flesh of the living!"
317 LK_TALK_4 = 3, // "Lay down your arms and surrender your souls!"
318
328};
329
331{
332 {6458.703f, 403.858f, 490.498f, 3.1205f}, // Dalfors spawn point
333 {6422.950f, 423.335f, 510.451f, 0.0f}, // Dalfors intro pos
334 {6426.343f, 420.515f, 508.650f, 0.0f}, // Dalfors fight pos
335};
336
338{
339 {6462.025f, 403.681f, 489.721f, 3.1007f}, // priest1 spawn point
340 {6421.480f, 423.576f, 510.781f, 5.7421f}, // priest1 intro pos
341};
342
344{
345 {6463.969f, 407.198f, 489.240f, 2.2689f}, // priest2 spawn point
346 {6419.778f, 421.404f, 510.972f, 5.7421f}, // priest2 intro pos
347};
348
350{
351 {6464.371f, 400.944f, 489.186f, 6.1610f}, // priest3 spawn point
352 {6423.516f, 425.782f, 510.774f, 5.7421f}, // priest3 intro pos
353};
354
356{
357 {6462.929f, 409.826f, 489.392f, 3.0968f}, // mason1 spawn point
358 {6428.163f, 421.960f, 508.297f, 0.0f}, // mason1 intro pos
359 {6414.335f, 454.904f, 511.395f, 2.8972f}, // mason1 action pos
360};
361
363{
364 {6462.650f, 405.670f, 489.576f, 2.9414f}, // mason2 spawn point
365 {6426.250f, 419.194f, 508.219f, 0.0f}, // mason2 intro pos
366 {6415.014f, 446.849f, 511.395f, 3.1241f}, // mason2 action pos
367};
368
370{
371 {6462.646f, 401.218f, 489.601f, 2.7864f}, // mason3 spawn point
372 {6423.855f, 416.598f, 508.305f, 0.0f}, // mason3 intro pos
373 {6417.070f, 438.824f, 511.395f, 3.6651f}, // mason3 action pos
374};
375
377{
379 {
380 HalofSpawned = false;
381 PhaseCount = 0;
382
383 SetCombatMovement(false);
384 }
385
387
389
391
393
398
399 void Reset() override
400 {
401 me->SetRegenerateHealth(false);
405 }
406
407 void JustEngagedWith(Unit* /*who*/) override { }
408
409 void MoveInLineOfSight(Unit* /*who*/) override { }
410
411 void JustSummoned(Creature* summon) override
412 {
413 Summons.Summon(summon);
415 {
416 summon->SetHomePosition(DalforsPos[2]);
418 summon->EngageWithTarget(me);
419 SetAggressiveStateAfter(2s, summon, true);
420 }
421 }
422
423 void JustDied(Unit* /*killer*/) override
424 {
425 Summons.DespawnAll();
427 }
428
429 void UpdateAI(uint32 diff) override
430 {
431 events.Update(diff);
432
433 switch (events.ExecuteEvent())
434 {
435 case EVENT_SPAWN:
436 {
438 {
439 guidDalfors = Dalfors->GetGUID();
440 Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[1]);
441 }
443 {
444 guidPriest[0] = Priest1->GetGUID();
445 Priest1->GetMotionMaster()->MovePoint(0, Priest1Pos[1]);
446 }
448 {
449 guidPriest[1] = Priest2->GetGUID();
450 Priest2->GetMotionMaster()->MovePoint(0, Priest2Pos[1]);
451 }
453 {
454 guidPriest[2] = Priest3->GetGUID();
455 Priest3->GetMotionMaster()->MovePoint(0, Priest3Pos[1]);
456 }
457 if (Creature* Mason1 = DoSummon(NPC_ARGENT_MASON, Mason1Pos[0]))
458 {
459 guidMason[0] = Mason1->GetGUID();
460 Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[1]);
461 }
462 if (Creature* Mason2 = DoSummon(NPC_ARGENT_MASON, Mason2Pos[0]))
463 {
464 guidMason[1] = Mason2->GetGUID();
465 Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[1]);
466 }
467 if (Creature* Mason3 = DoSummon(NPC_ARGENT_MASON, Mason3Pos[0]))
468 {
469 guidMason[2] = Mason3->GetGUID();
470 Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
471 }
473 }
474 break;
475 case EVENT_INTRO_1:
476 {
478 Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
480 }
481 break;
482 case EVENT_INTRO_2:
483 {
485 {
486 Dalfors->SetFacingTo(6.215f);
487 Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
488 }
490 }
491 break;
492 case EVENT_INTRO_3:
493 {
495 {
496 Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
497 Dalfors->SetHomePosition(DalforsPos[2]);
498 }
500 {
501 Priest1->SetFacingTo(5.7421f);
502 Priest1->SetHomePosition(Priest1Pos[1]);
503 }
505 {
506 Priest2->SetFacingTo(5.7421f);
507 Priest2->SetHomePosition(Priest2Pos[1]);
508 }
510 {
511 Priest3->SetFacingTo(5.7421f);
512 Priest3->SetHomePosition(Priest3Pos[1]);
513 }
515 {
516 Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
517 Mason1->SetHomePosition(Mason1Pos[2]);
518 }
520 {
521 Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
522 Mason2->SetHomePosition(Mason2Pos[2]);
523 }
525 {
526 Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
527 Mason3->SetHomePosition(Mason3Pos[2]);
528 }
531 }
532 break;
534 {
536 {
537 Mason1->SetFacingTo(2.8972f);
538 Mason1->AI()->SetData(1, 1); // triggers SAI actions on npc
539 }
541 {
542 Mason2->SetFacingTo(3.1241f);
543 Mason2->AI()->SetData(1, 1); // triggers SAI actions on npc
544 }
546 {
547 Mason3->SetFacingTo(3.6651f);
548 Mason3->AI()->SetData(1, 1); // triggers SAI actions on npc
549 }
550 }
551 break;
553 {
555 LK->AI()->Talk(LK_TALK_1);
557 Dalfors->AI()->Talk(DALFORS_SAY_START);
559 }
560 break;
561 case EVENT_WAVE_SPAWN:
562 {
563 if (PhaseCount == 3)
564 {
566 LK->AI()->Talk(LK_TALK_2);
567 }
568 else if (PhaseCount == 6)
569 {
571 LK->AI()->Talk(LK_TALK_3);
572 }
574 if (urand(0, 1) == 0)
575 {
578 }
579 else
580 {
583 }
584
585 PhaseCount++;
586
587 if (PhaseCount < 8)
589 else
591 }
592 break;
593 case EVENT_HALOF:
594 {
596 LK->AI()->Talk(LK_TALK_4);
597
600
602 {
603 HalofSpawned = true;
604 guidHalof = tempsum->GetGUID();
605 }
606 }
607 break;
608 case EVENT_ENDED:
609 {
610 Summons.DespawnAll();
612 }
613 break;
614 }
615
616 if (PhaseCount == 8)
618 if (Halof->isDead())
619 {
621 Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
622 Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
623 Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
626 Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
628 }
629 }
630};
631
632/*######
633## Borrowed Technology - Id: 13291, The Solution Solution (daily) - Id: 13292, Volatility - Id: 13239, Volatiliy - Id: 13261 (daily)
634######*/
635
637{
638 // Spells
639 SPELL_GRAB = 59318,
643 SPELL_RIDE = 59319,
644
645 // Points
648
649 // Events
652
654{
655 npc_frostbrood_skytalon(Creature* creature) : VehicleAI(creature) { }
656
658
659 void IsSummonedBy(WorldObject* summoner) override
660 {
661 me->GetMotionMaster()->MovePoint(POINT_GRAB_DECOY, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
662 }
663
664 void MovementInform(uint32 type, uint32 id) override
665 {
666 if (type != POINT_MOTION_TYPE)
667 return;
668
669 if (id == POINT_GRAB_DECOY)
670 if (TempSummon* summon = me->ToTempSummon())
671 if (Unit* summoner = summon->GetSummonerUnit())
672 DoCast(summoner, SPELL_GRAB);
673 }
674
675 void UpdateAI(uint32 diff) override
676 {
678 events.Update(diff);
679
680 while (uint32 eventId = events.ExecuteEvent())
681 {
682 if (eventId == EVENT_FLY_AWAY)
683 {
684 Position randomPosOnRadius;
685 randomPosOnRadius.m_positionZ = (me->GetPositionZ() + 40.0f);
686 me->GetNearPoint2D(nullptr, randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 40.0f, me->GetAbsoluteAngle(me));
687 me->GetMotionMaster()->MovePoint(POINT_FLY_AWAY, randomPosOnRadius);
688 }
689 }
690 }
691
692 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
693 {
694 switch (spellInfo->Id)
695 {
696 case SPELL_EXPLOSION:
698 break;
699 case SPELL_RIDE:
702 break;
703 }
704 }
705};
706
707/*######
708## Quest 12887, 12892: It's All Fun and Games
709######*/
710
711// 55288 - It's All Fun and Games: The Ocular On Death
713{
714 bool Validate(SpellInfo const* spellInfo) override
715 {
716 return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
717 }
718
719 void HandleScript(SpellEffIndex /*effIndex*/)
720 {
721 if (Player* target = GetHitPlayer())
722 target->CastSpell(target, uint32(GetEffectValueAsInt()));
723 }
724
729};
730
731/*######
732## Quest 14077, 14144: The Light's Mercy
733######*/
734
735// 66411 - Summon Tualiq Proxy
737{
739 {
740 Position const offset = { 0.0f, 0.0f, 30.0f, 0.0f };
741 dest.RelocateOffset(offset);
742 }
743
748};
749
750/*######
751## Quest 14076 & 14092: Breakfast Of Champions
752######*/
753
759
760// 66512 - Pound Drum
778
779/*######
780## Quest 14112 & 14145: What Do You Feed a Yeti, Anyway?
781######*/
782
790
798
799// 66741 - Chum the Water
818
819/*######
820## Quest 13121: Through the Eye
821######*/
822
830
831// 25732 - Through the Eye: Eye of the Lich King
859
860// 57884 - Through the Eye: Kill Credit to Master
878
879/*######
880## Quest 13008: Scourge Tactics
881######*/
882
883// 56515 - Summon Freed Crusader
885{
886 bool Validate(SpellInfo const* spellInfo) override
887 {
888 return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
889 }
890
891 void HandleScript(SpellEffIndex /*effIndex*/)
892 {
894 }
895
900};
901
902/*######
903## Quest 13236, 13395: Army of the Damned
904######*/
905
911
912// 58916 - Gift of the Lich King
930
931// 58917 - Consume Minions
949
950/*######
951## Quest 12995: Leave Our Mark
952######*/
953
958
959// 23301 - Ebon Blade Banner
961{
962 void HandleScript(SpellEffIndex /*effIndex*/)
963 {
964 if (Player* caster = GetCaster()->ToPlayer())
965 caster->KilledMonsterCredit(NPC_LEAVE_OUR_MARK_KILL_CREDIT_BUNNY);
966 }
967
972};
973
974/*######
975## Quest 13400: The Hunter and the Prince
976######*/
977
982
983// 61752 - Illidan Kill Credit Master
985{
986 bool Validate(SpellInfo const* /*spellInfo*/) override
987 {
989 }
990
991 void HandleDummy(SpellEffIndex /*effIndex*/)
992 {
993 Unit* caster = GetCaster();
994 if (caster->IsVehicle())
995 if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(0))
996 passenger->CastSpell(passenger, SPELL_ILLIDAN_KILL_CREDIT, true);
997 }
998
1003};
1004
1005/*######
1006## Quest 13280, 13283: King of the Mountain
1007######*/
1008
1017
1018// 4338 - Plant Alliance Battle Standard
1019// 59643 - Plant Horde Battle Standard
1021{
1022 void HandleDummy(SpellEffIndex /*effIndex*/)
1023 {
1024 Unit* caster = GetCaster();
1025 Unit* target = GetHitUnit();
1027
1029 if (caster->IsVehicle())
1030 if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
1031 player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC);
1032
1034 triggeredSpellID = SPELL_HORDE_BATTLE_STANDARD_STATE;
1035
1036 target->RemoveAllAuras();
1037 target->CastSpell(target, triggeredSpellID, true);
1038 }
1039
1044};
1045
1046// 4336 - Jump Jets
1048{
1050 {
1051 Unit* caster = GetCaster();
1052 if (caster->IsVehicle())
1053 if (Unit* rocketBunny = caster->GetVehicleKit()->GetPassenger(1))
1054 rocketBunny->CastSpell(rocketBunny, SPELL_JUMP_ROCKET_BLAST, true);
1055 }
1056
1057 void Register() override
1058 {
1060 }
1061};
1062
1063/*######
1064## Quest 13291: Borrowed Technology / 13292: The Solution Solution (Daily) / 13239: Volatility / 13261: Volatiliy (Daily)
1065######*/
1066
1071
1072// 59318 - Grab Fake Soldier
1074{
1075 bool Validate(SpellInfo const* /*spell*/) override
1076 {
1078 }
1079
1080 void HandleDummy(SpellEffIndex /*effIndex*/)
1081 {
1082 if (!GetHitCreature())
1083 return;
1084 // TO DO: Being triggered is hack, but in checkcast it doesn't pass aurastate requirements.
1085 // Beside that the decoy won't keep it's freeze animation state when enter.
1087 }
1088
1093};
1094
1095// 59303 - Summon Frost Wyrm
1097{
1099 {
1100 // Adjust effect summon position
1101 Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f };
1102 dest.RelocateOffset(offset);
1103 }
1104
1109};
1110
1111/*######
1112## Quest 12847: Second Chances
1113######*/
1114
1115// 12601 - Second Chances: Summon Landgren's Soul Moveto Target Bunny
1117{
1119 {
1120 // Adjust effect summon position
1121 Position const offset = { 0.0f, 0.0f, 2.5f, 0.0f };
1122 dest.RelocateOffset(offset);
1123 }
1124
1129};
1130
1131/*######
1132## Quest 13086: The Last Line Of Defense
1133######*/
1134
1139
1140// 57387 - Argent Cannon Assault
1142{
1143 bool Validate(SpellInfo const* /*spellInfo*/) override
1144 {
1146 }
1147
1152
1157};
1158
1159// 57385 - Argent Cannon
1160// 57412 - Reckoning Bomb
1162{
1163 bool Validate(SpellInfo const* spellInfo) override
1164 {
1165 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } })
1166 && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
1167 }
1168
1169 void HandleDummy(SpellEffIndex /*effIndex*/)
1170 {
1171 if (WorldLocation const* pos = GetExplTargetDest())
1172 GetCaster()->CastSpell(pos->GetPosition(), GetEffectValueAsInt(), true);
1173 }
1174
1179};
1180
1181/*######
1182## Quest 13790, 13793, 13811, 13814: Among the Champions / 13665, 13745, 13750, 13756, 13761, 13767, 13772, 13777, 13782, 13787: The Grand Melee
1183######*/
1184
1186{
1187 bool Validate(SpellInfo const* spellInfo) override
1188 {
1189 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } })
1191 }
1192
1193 void HandleScript(SpellEffIndex /*effIndex*/)
1194 {
1196 target->CastSpell(target, uint32(GetEffectValueAsInt()), true);
1197 }
1198
1203};
1204
1205/*######
1206## Quest 13264, 13276, 13288, 13289: That's Abominable!
1207######*/
1208
1244
1245// 59576 - Burst at the Seams
1247{
1260
1261 void HandleScript(SpellEffIndex /*effIndex*/)
1262 {
1263 if (Creature* creature = GetCaster()->ToCreature())
1264 {
1265 creature->CastSpell(creature, SPELL_BLOATED_ABOMINATION_FEIGN_DEATH, true);
1266 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59579, true);
1267 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1268 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1269 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1270 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1271 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1272 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1273 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1274 }
1275 }
1276
1281};
1282
1283// 59579 - Burst at the Seams
1285{
1286 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1287 {
1288 Unit* target = GetTarget();
1289 target->CastSpell(target, SPELL_TROLL_EXPLOSION, true);
1290 target->CastSpell(target, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1291 target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
1292 target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
1293 target->CastSpell(target, SPELL_EXPLODE_TROLL_BLOODY_MEAT, true);
1294 target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1295 }
1296
1297 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1298 {
1299 Unit* target = GetTarget();
1300 if (Unit* caster = GetCaster())
1301 {
1302 switch (target->GetEntry())
1303 {
1304 case NPC_ICY_GHOUL:
1306 break;
1307 case NPC_VICIOUS_GEIST:
1309 break;
1312 break;
1313 }
1314 }
1315 target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_59580, true);
1316 }
1317
1323};
1324
1325// 52593 - Bloated Abomination Feign Death
1327{
1328 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1329 {
1330 Unit* target = GetTarget();
1333
1334 if (Creature* creature = target->ToCreature())
1335 creature->SetReactState(REACT_PASSIVE);
1336 }
1337
1338 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1339 {
1340 Unit* target = GetTarget();
1341 if (Creature* creature = target->ToCreature())
1342 creature->DespawnOrUnsummon();
1343 }
1344
1350};
1351
1352// 76245 - Area Restrict Abom
1354{
1355 void HandleScript(SpellEffIndex /*effIndex*/)
1356 {
1357 if (Creature* creature = GetHitCreature()) {
1358 uint32 area = creature->GetAreaId();
1360 creature->DespawnOrUnsummon();
1361 }
1362 }
1363
1368};
1369
1370// 59590 - Assign Ghoul Kill Credit to Master
1371// 60039 - Assign Skeleton Kill Credit to Master
1372// 60041 - Assign Geist Kill Credit to Master
1374{
1375 void HandleScript(SpellEffIndex /*effIndex*/)
1376 {
1377 if (Unit* target = GetHitUnit())
1378 {
1379 if (Unit* owner = target->GetOwner())
1380 {
1381 owner->CastSpell(owner, GetEffectValueAsInt(), true);
1382 }
1383 }
1384 }
1385
1390};
1391
1392// 52510 - Burst at the Seams
1394{
1407
1408 bool Load() override
1409 {
1410 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1411 }
1412
1414 {
1415 if (Unit* creature = GetHitCreature())
1416 {
1417 if (Unit* charmer = GetCaster()->GetCharmerOrOwner())
1418 {
1419 if (Player* player = charmer->ToPlayer())
1420 {
1421 if (player->GetQuestStatus(QUEST_FUEL_FOR_THE_FIRE) == QUEST_STATUS_INCOMPLETE)
1422 {
1423 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1424 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1425 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1426 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_52508, true);
1427 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59580, true);
1428
1429 player->CastSpell(player, SPELL_DRAKKARI_SKULLCRUSHER_CREDIT, true);
1430 uint16 count = player->GetReqKillOrCastCurrentCount(QUEST_FUEL_FOR_THE_FIRE, NPC_DRAKKARI_CHIEFTAINK);
1431 if ((count % 20) == 0)
1432 player->CastSpell(player, SPELL_SUMMON_DRAKKARI_CHIEFTAIN, true);
1433 }
1434 }
1435 }
1436 }
1437 }
1438
1439 void HandleScript(SpellEffIndex /*effIndex*/)
1440 {
1442 }
1443
1449};
1450
1451/*######
1452## Quest 13082: The Boon of A'dal
1453######*/
1454
1464
1465// 57787 - Forcecast Bridenbrad Ascension
1497
1499{
1531}
DB2Storage< BroadcastTextEntry > sBroadcastTextStore("BroadcastText.db2", &BroadcastTextLoadInfo::Instance)
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
@ POINT_MOTION_TYPE
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:146
bool roll_chance(float chance, PseudoRandomDistributionState &state)
Definition Random.cpp:131
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:43
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1392
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
Creature * GetClosestCreatureWithEntry(WorldObject *source, uint32 entry, float maxSearchRange, bool alive=true)
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_KNOCK_BACK
@ TARGET_DEST_CASTER_BACK
@ TARGET_DEST_CASTER
@ EMOTE_ONESHOT_ROAR
@ TEAM_ALLIANCE
@ FACTION_FRIENDLY
@ FACTION_MONSTER
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define SpellEffectFn(F, I, N)
#define SpellCastFn(F)
#define SpellDestinationTargetSelectFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
EvadeReason
@ UNIT_FLAG2_FEIGN_DEATH
@ REACT_PASSIVE
DamageEffectType
@ UNIT_FLAG3_FAKE_DEAD
@ UNIT_STATE_STUNNED
Definition Unit.h:278
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetCaster() const
Unit * GetTarget() const
int32 GetDuration() const
Definition SpellAuras.h:222
uint8 GetStackAmount() const
Definition SpellAuras.h:238
TypeID GetTypeId() const
Definition BaseEntity.h:166
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
Creature * DoSummon(uint32 entry, Position const &pos, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:394
void SetReactState(ReactStates st)
Definition Creature.h:180
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetRegenerateHealth(bool value)
Definition Creature.h:381
void Update(uint32 time)
Definition EventMap.h:77
EventId ExecuteEvent()
Definition EventMap.cpp:77
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:56
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
Player * ToPlayer()
Definition Object.h:126
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
Unit * ToUnit()
Definition Object.h:116
TeamId GetTeamId() const
Definition Player.h:2407
int32 CalcValueAsInt(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
uint32 const Id
Definition SpellInfo.h:328
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:590
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
HookList< CastHandler > AfterCast
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Unit * GetCaster() const
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
int32 GetEffectValueAsInt() const
HookList< EffectHandler > OnEffectHit
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< CastHandler > OnCast
WorldLocation const * GetExplTargetDest() const
SpellInfo const * GetSpellInfo() const
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
bool IsVehicle() const
Definition Unit.h:766
void SetUnitFlag3(UnitFlags3 flags)
Definition Unit.h:871
void SetControlled(bool apply, UnitState state)
Definition Unit.cpp:11631
void SetFaction(uint32 faction) override
Definition Unit.h:887
bool isInBackInMap(Unit const *target, float distance, float arc=float(M_PI)) const
Definition Unit.cpp:3323
Unit * GetVehicleBase() const
Definition Unit.cpp:12206
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:866
TempSummon * ToTempSummon()
Definition Unit.h:1844
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4718
uint64 GetHealth() const
Definition Unit.h:800
void EngageWithTarget(Unit *who)
Definition Unit.cpp:8513
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4822
void RemoveAllAuras()
Definition Unit.cpp:4400
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition Unit.cpp:1662
Vehicle * GetVehicleKit() const
Definition Unit.h:1798
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3992
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition Vehicle.cpp:303
Unit * GetCharmerOrOwnerOrSelf() const
Definition Object.cpp:1618
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2222
bool IsHostileTo(WorldObject const *target) const
Definition Object.cpp:2186
Unit * GetOwner() const
Definition Object.cpp:1603
void GetNearPoint2D(WorldObject const *searcher, float &x, float &y, float distance, float absAngle) const
Definition Object.cpp:2690
uint32 GetAreaId() const
Definition Object.h:333
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *spellInfo) override
void SetDest(SpellDestination &dest)
void SetDest(SpellDestination &dest)
void SetDest(SpellDestination &dest)
bool Validate(SpellInfo const *spellInfo) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
constexpr float GetPositionX() const
Definition Position.h:87
float m_positionZ
Definition Position.h:66
constexpr float GetPositionY() const
Definition Position.h:88
float m_positionX
Definition Position.h:64
float m_positionY
Definition Position.h:65
float GetAbsoluteAngle(float x, float y) const
Definition Position.h:136
constexpr float GetOrientation() const
Definition Position.h:90
constexpr float GetPositionZ() const
Definition Position.h:89
void SetCombatMovement(bool allowMovement)
void SetAggressiveStateAfter(Milliseconds timer, Creature *who=nullptr, bool startCombat=true, Creature *summoner=nullptr, StartCombatArgs const &combatArgs={ })
void RelocateOffset(Position const &offset)
Definition Spell.cpp:90
void UpdateAI(uint32 diff) override
Definition CombatAI.cpp:246
void DamageTaken(Unit *pDoneBy, uint32 &uiDamage, DamageEffectType, SpellInfo const *) override
void Reset() override
void MovementInform(uint32 uiType, uint32) override
npc_argent_valiant(Creature *creature)
void UpdateAI(uint32 uiDiff) override
ObjectGuid guidMason[3]
ObjectGuid guidPriest[3]
void JustSummoned(Creature *summon) override
npc_blessed_banner(Creature *creature)
void JustDied(Unit *) override
void MoveInLineOfSight(Unit *) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
void Reset() override
void UpdateAI(uint32 diff) override
void MovementInform(uint32 type, uint32 id) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void IsSummonedBy(WorldObject *summoner) override
npc_frostbrood_skytalon(Creature *creature)
void MoveInLineOfSight(Unit *who) override
npc_guardian_pavilion(Creature *creature)
void SpellHit(WorldObject *caster, SpellInfo const *spellInfo) override
void EnterEvadeMode(EvadeReason why) override
npc_tournament_training_dummy(Creature *creature)
void MoveInLineOfSight(Unit *) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void UpdateAI(uint32 diff) override
GuardianPavilion
@ AREA_SILVER_COVENANT_PAVILION
@ SPELL_TRESPASSER_H
@ SPELL_TRESPASSER_A
@ AREA_SUNREAVER_PAVILION
void AddSC_icecrown()
ArgentValiant
@ SPELL_CHARGE
@ SPELL_KILL_CREDIT
@ SPELL_SHIELD_BREAKER
Position const Priest1Pos[2]
KingOfTheMountain
@ SPELL_PLANT_HORDE_BATTLE_STANDARD
@ SPELL_ALLIANCE_BATTLE_STANDARD_STATE
@ SPELL_HORDE_BATTLE_STANDARD_STATE
@ SPELL_JUMP_ROCKET_BLAST
@ NPC_KING_OF_THE_MOUNTAINT_KC
BreakfastOfChampions
@ SPELL_STORMFORGED_MOLE_MACHINE
@ SPELL_SUMMON_DEEP_JORMUNGAR
std::array< uint32, 4 > const ChumTheWaterSummonSpells
Position const Mason1Pos[3]
LeaveOurMark
@ NPC_LEAVE_OUR_MARK_KILL_CREDIT_BUNNY
Position const Mason3Pos[3]
Position const Priest3Pos[2]
ThatsAbominable
@ SPELL_BURST_AT_THE_SEAMS_52510
@ SPELL_BURST_AT_THE_SEAMS_BONE
@ SPELL_DRAKKARI_CHIEFTAINK_KILL_CREDIT
@ QUEST_FUEL_FOR_THE_FIRE
@ SPELL_ASSIGN_SKELETON_KILL_CREDIT_TO_MASTER
@ AREA_MORD_RETHAR_THE_DEATH_GATE
@ SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT
@ NPC_RENIMATED_ABOMINATION
@ SPELL_TROLL_EXPLOSION
@ SPELL_ASSIGN_GEIST_KILL_CREDIT_TO_MASTER
@ NPC_RISEN_ALLIANCE_SOLDIERS
@ AREA_THE_BROKEN_FRONT
@ SPELL_EXPLODE_TROLL_MEAT
@ SPELL_EXPLODE_TROLL_BLOODY_MEAT
@ NPC_VICIOUS_GEIST
@ SPELL_BURST_AT_THE_SEAMS_59580
@ NPC_ICY_GHOUL
@ NPC_DRAKKARI_CHIEFTAINK
@ SPELL_SUMMON_DRAKKARI_CHIEFTAIN
@ SPELL_BURST_AT_THE_SEAMS_52508
@ SPELL_BURST_AT_THE_SEAMS_59579
@ SPELL_BURST_AT_THE_SEAMS_59576
@ SPELL_ASSIGN_GHOUL_KILL_CREDIT_TO_MASTER
@ SPELL_DRAKKARI_SKULLCRUSHER_CREDIT
@ SPELL_EXPLODE_ABOMINATION_MEAT
@ SPELL_BLOATED_ABOMINATION_FEIGN_DEATH
BorrowedTechnology
@ SPELL_RIDE_FROST_WYRM
Position const Priest2Pos[2]
ThroughTheEye
@ SPELL_USING_THE_EYE_OF_THE_LK
@ TEXT_USING_THE_EYE_OF_THE_LK
@ SPELL_SUMMON_IMAGE_OF_SHADOW_CULTIST
@ SPELL_SUMMON_IMAGE_OF_VARDMADRA
TournamentDummy
@ SPELL_RANGED_DEFEND
@ SPELL_PLAYER_CHARGE
@ NPC_RANGED_TARGET
@ SPELL_VULNERABLE
@ EVENT_DUMMY_RECAST_DEFEND
@ SPELL_CHARGE_DEFEND
@ SPELL_MELEE_CREDIT
@ SPELL_COUNTERATTACK
@ EVENT_DUMMY_RESET
@ NPC_CHARGE_TARGET
@ SPELL_CHARGE_CREDIT
@ SPELL_RANGED_CREDIT
@ SPELL_PLAYER_BREAK_SHIELD
@ NPC_MELEE_TARGET
@ SPELL_PLAYER_THRUST
ArmyOfTheDamned
@ SPELL_CONSUME_MINIONS
@ SPELL_GIFT_OF_THE_LICH_KING
TheBoonOfAdal
@ SPELL_SEE_QUEST_INVISIBILITY_1
@ SPELL_SUMMON_LIGHT_BUNNY
@ SPELL_SUMMON_KURI
@ SPELL_SUMMON_SPIRIT_OF_BRIDENBRAD
@ SPELL_SUMMON_ADAL
@ SPELL_SUMMON_MORI
TheHunterAndThePrince
@ SPELL_ILLIDAN_KILL_CREDIT
ChumTheWaterSummons
@ SPELL_SUMMON_NORTH_SEA_THRESHER
@ SPELL_SUMMON_NORTH_SEA_MAKO
@ SPELL_SUMMON_ANGRY_KVALDIR
@ SPELL_SUMMON_NORTH_SEA_BLUE_SHARK
BorrowedTechnologyAndVolatility
@ SPELL_EXPLOSION
@ SPELL_IMMOLATION
@ SPELL_GRAB
@ SPELL_PING_BUNNY
@ POINT_GRAB_DECOY
@ POINT_FLY_AWAY
@ SPELL_RIDE
@ EVENT_FLY_AWAY
BlessedBanner
@ BANNER_SAY
@ DALFORS_SAY_PRE_1
@ EVENT_START_FIGHT
@ SPELL_BLESSING_OF_THE_CRUSADE
@ EVENT_SPAWN
@ EVENT_INTRO_1
@ NPC_HIDEOUS_PLAGEBRINGER
@ SPELL_CRUSADERS_SPIRE_VICTORY
@ EVENT_INTRO_2
@ NPC_HALOF_THE_DEATHBRINGER
@ SPELL_THREAT_PULSE
@ NPC_BLESSED_BANNER
@ NPC_ARGENT_BATTLE_PRIEST
@ LK_TALK_2
@ NPC_REANIMATED_CAPTAIN
@ EVENT_HALOF
@ DALFORS_YELL_FINISHED
@ NPC_ARGENT_MASON
@ EVENT_WAVE_SPAWN
@ LK_TALK_1
@ EVENT_MASON_ACTION
@ SPELL_TORCH
@ NPC_CRUSADER_LORD_DALFORS
@ DALFORS_SAY_PRE_2
@ EVENT_INTRO_3
@ EVENT_ENDED
@ NPC_SCOURGE_DRUDGE
@ LK_TALK_4
@ DALFORS_SAY_START
@ LK_TALK_3
@ NPC_LK
Position const Mason2Pos[3]
TheLastLineOfDefense
@ SPELL_POWERING_UP_THE_CORE
Position const DalforsPos[3]