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 "MotionMaster.h"
22#include "ObjectAccessor.h"
23#include "ObjectMgr.h"
24#include "Player.h"
25#include "ScriptedCreature.h"
26#include "ScriptedGossip.h"
27#include "Spell.h"
28#include "SpellAuras.h"
29#include "SpellScript.h"
30#include "TemporarySummon.h"
31#include "Vehicle.h"
32
33/*######
34## npc_argent_valiant
35######*/
36
43
45{
46 npc_argent_valiant(Creature* creature) : ScriptedAI(creature)
47 {
48 Initialize();
49 creature->GetMotionMaster()->MovePoint(0, 8599.258f, 963.951f, 547.553f);
50 creature->SetFaction(FACTION_FRIENDLY); //wrong faction in db?
51 }
52
54 {
55 uiChargeTimer = 7000;
57 }
58
61
62 void Reset() override
63 {
64 Initialize();
65 }
66
67 void MovementInform(uint32 uiType, uint32 /*uiId*/) override
68 {
69 if (uiType != POINT_MOTION_TYPE)
70 return;
71
73 }
74
75 void DamageTaken(Unit* pDoneBy, uint32& uiDamage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
76 {
77 if (uiDamage > me->GetHealth() && pDoneBy && pDoneBy->GetTypeId() == TYPEID_PLAYER)
78 {
79 uiDamage = 0;
80 pDoneBy->CastSpell(pDoneBy, SPELL_KILL_CREDIT, true);
85 }
86 }
87
88 void UpdateAI(uint32 uiDiff) override
89 {
90 if (!UpdateVictim())
91 return;
92
93 if (uiChargeTimer <= uiDiff)
94 {
96 uiChargeTimer = 7000;
97 } else uiChargeTimer -= uiDiff;
98
99 if (uiShieldBreakerTimer <= uiDiff)
100 {
102 uiShieldBreakerTimer = 10000;
103 } else uiShieldBreakerTimer -= uiDiff;
104
106 }
107};
108
109/*######
110## npc_guardian_pavilion
111######*/
112
121
123{
125 {
126 SetCombatMovement(false);
127 }
128
129 void MoveInLineOfSight(Unit* who) override
130
131 {
133 return;
134
135 if (!who || who->GetTypeId() != TYPEID_PLAYER || !me->IsHostileTo(who) || !me->isInBackInMap(who, 5.0f))
136 return;
137
139 return;
140
141 if (who->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
142 who->CastSpell(who, SPELL_TRESPASSER_H, true);
143 else
144 who->CastSpell(who, SPELL_TRESPASSER_A, true);
145
146 }
147};
148
149/*######
150* npc_tournament_training_dummy
151######*/
175
177{
179 {
180 Initialize();
181 SetCombatMovement(false);
182 }
183
185 {
186 isVulnerable = false;
187 }
188
191
192 void Reset() override
193 {
195 Initialize();
196
197 events.Reset();
199 }
200
201 void EnterEvadeMode(EvadeReason why) override
202 {
203 if (!_EnterEvadeMode(why))
204 return;
205
206 Reset();
207 }
208
209 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
210 {
211 damage = 0;
213 }
214
215 void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override
216 {
217 Unit* unitCaster = caster->ToUnit();
218 if (!unitCaster)
219 return;
220
221 switch (me->GetEntry())
222 {
224 if (spellInfo->Id == SPELL_PLAYER_CHARGE)
225 if (isVulnerable)
226 DoCast(unitCaster, SPELL_CHARGE_CREDIT, true);
227 break;
228 case NPC_MELEE_TARGET:
229 if (spellInfo->Id == SPELL_PLAYER_THRUST)
230 {
231 DoCast(unitCaster, SPELL_MELEE_CREDIT, true);
232
233 if (Unit* target = unitCaster->GetVehicleBase())
234 DoCast(target, SPELL_COUNTERATTACK, true);
235 }
236 break;
238 if (spellInfo->Id == SPELL_PLAYER_BREAK_SHIELD)
239 if (isVulnerable)
240 DoCast(unitCaster, SPELL_RANGED_CREDIT, true);
241 break;
242 }
243
244 if (spellInfo->Id == SPELL_PLAYER_BREAK_SHIELD)
246 isVulnerable = true;
247 }
248
249 void UpdateAI(uint32 diff) override
250 {
251 events.Update(diff);
252
253 switch (events.ExecuteEvent())
254 {
256 switch (me->GetEntry())
257 {
259 {
262 break;
263 }
265 {
267 if (!defend || defend->GetStackAmount() < 3 || defend->GetDuration() <= 8000)
269 break;
270 }
271 }
272 isVulnerable = false;
274 break;
276 if (UpdateVictim())
277 {
280 }
281 break;
282 }
283
284 if (!UpdateVictim())
285 return;
286
289 }
290
291 void MoveInLineOfSight(Unit* /*who*/) override { }
292
293};
294
295// Battle for Crusaders' Pinnacle
297{
301 SPELL_TORCH = 58121,
302
311 NPC_LK = 31013,
312
313 BANNER_SAY = 0, // "The Blessed Banner of the Crusade has been planted.\n Defend the banner from all attackers!"
314 DALFORS_SAY_PRE_1 = 0, // "BY THE LIGHT! Those damned monsters! Look at what they've done to our people!"
315 DALFORS_SAY_PRE_2 = 1, // "Burn it down, boys. Burn it all down."
316 DALFORS_SAY_START = 2, // "Let 'em come. They'll pay for what they've done!"
317 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!"
318 LK_TALK_1 = 0, // "Leave no survivors!"
319 LK_TALK_2 = 1, // "Cower before my terrible creations!"
320 LK_TALK_3 = 2, // "Feast my children! Feast upon the flesh of the living!"
321 LK_TALK_4 = 3, // "Lay down your arms and surrender your souls!"
322
332};
333
335{
336 {6458.703f, 403.858f, 490.498f, 3.1205f}, // Dalfors spawn point
337 {6422.950f, 423.335f, 510.451f, 0.0f}, // Dalfors intro pos
338 {6426.343f, 420.515f, 508.650f, 0.0f}, // Dalfors fight pos
339};
340
342{
343 {6462.025f, 403.681f, 489.721f, 3.1007f}, // priest1 spawn point
344 {6421.480f, 423.576f, 510.781f, 5.7421f}, // priest1 intro pos
345};
346
348{
349 {6463.969f, 407.198f, 489.240f, 2.2689f}, // priest2 spawn point
350 {6419.778f, 421.404f, 510.972f, 5.7421f}, // priest2 intro pos
351};
352
354{
355 {6464.371f, 400.944f, 489.186f, 6.1610f}, // priest3 spawn point
356 {6423.516f, 425.782f, 510.774f, 5.7421f}, // priest3 intro pos
357};
358
360{
361 {6462.929f, 409.826f, 489.392f, 3.0968f}, // mason1 spawn point
362 {6428.163f, 421.960f, 508.297f, 0.0f}, // mason1 intro pos
363 {6414.335f, 454.904f, 511.395f, 2.8972f}, // mason1 action pos
364};
365
367{
368 {6462.650f, 405.670f, 489.576f, 2.9414f}, // mason2 spawn point
369 {6426.250f, 419.194f, 508.219f, 0.0f}, // mason2 intro pos
370 {6415.014f, 446.849f, 511.395f, 3.1241f}, // mason2 action pos
371};
372
374{
375 {6462.646f, 401.218f, 489.601f, 2.7864f}, // mason3 spawn point
376 {6423.855f, 416.598f, 508.305f, 0.0f}, // mason3 intro pos
377 {6417.070f, 438.824f, 511.395f, 3.6651f}, // mason3 action pos
378};
379
381{
383 {
384 HalofSpawned = false;
385 PhaseCount = 0;
386
387 SetCombatMovement(false);
388 }
389
391
393
395
397
402
403 void Reset() override
404 {
405 me->SetRegenerateHealth(false);
409 }
410
411 void JustEngagedWith(Unit* /*who*/) override { }
412
413 void MoveInLineOfSight(Unit* /*who*/) override { }
414
415 void JustSummoned(Creature* summon) override
416 {
417 Summons.Summon(summon);
419 {
420 summon->SetHomePosition(DalforsPos[2]);
422 summon->EngageWithTarget(me);
423 SetAggressiveStateAfter(2s, summon, true);
424 }
425 }
426
427 void JustDied(Unit* /*killer*/) override
428 {
429 Summons.DespawnAll();
431 }
432
433 void UpdateAI(uint32 diff) override
434 {
435 events.Update(diff);
436
437 switch (events.ExecuteEvent())
438 {
439 case EVENT_SPAWN:
440 {
442 {
443 guidDalfors = Dalfors->GetGUID();
444 Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[1]);
445 }
447 {
448 guidPriest[0] = Priest1->GetGUID();
449 Priest1->GetMotionMaster()->MovePoint(0, Priest1Pos[1]);
450 }
452 {
453 guidPriest[1] = Priest2->GetGUID();
454 Priest2->GetMotionMaster()->MovePoint(0, Priest2Pos[1]);
455 }
457 {
458 guidPriest[2] = Priest3->GetGUID();
459 Priest3->GetMotionMaster()->MovePoint(0, Priest3Pos[1]);
460 }
461 if (Creature* Mason1 = DoSummon(NPC_ARGENT_MASON, Mason1Pos[0]))
462 {
463 guidMason[0] = Mason1->GetGUID();
464 Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[1]);
465 }
466 if (Creature* Mason2 = DoSummon(NPC_ARGENT_MASON, Mason2Pos[0]))
467 {
468 guidMason[1] = Mason2->GetGUID();
469 Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[1]);
470 }
471 if (Creature* Mason3 = DoSummon(NPC_ARGENT_MASON, Mason3Pos[0]))
472 {
473 guidMason[2] = Mason3->GetGUID();
474 Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[1]);
475 }
477 }
478 break;
479 case EVENT_INTRO_1:
480 {
482 Dalfors->AI()->Talk(DALFORS_SAY_PRE_1);
484 }
485 break;
486 case EVENT_INTRO_2:
487 {
489 {
490 Dalfors->SetFacingTo(6.215f);
491 Dalfors->AI()->Talk(DALFORS_SAY_PRE_2);
492 }
494 }
495 break;
496 case EVENT_INTRO_3:
497 {
499 {
500 Dalfors->GetMotionMaster()->MovePoint(0, DalforsPos[2]);
501 Dalfors->SetHomePosition(DalforsPos[2]);
502 }
504 {
505 Priest1->SetFacingTo(5.7421f);
506 Priest1->SetHomePosition(Priest1Pos[1]);
507 }
509 {
510 Priest2->SetFacingTo(5.7421f);
511 Priest2->SetHomePosition(Priest2Pos[1]);
512 }
514 {
515 Priest3->SetFacingTo(5.7421f);
516 Priest3->SetHomePosition(Priest3Pos[1]);
517 }
519 {
520 Mason1->GetMotionMaster()->MovePoint(0, Mason1Pos[2]);
521 Mason1->SetHomePosition(Mason1Pos[2]);
522 }
524 {
525 Mason2->GetMotionMaster()->MovePoint(0, Mason2Pos[2]);
526 Mason2->SetHomePosition(Mason2Pos[2]);
527 }
529 {
530 Mason3->GetMotionMaster()->MovePoint(0, Mason3Pos[2]);
531 Mason3->SetHomePosition(Mason3Pos[2]);
532 }
535 }
536 break;
538 {
540 {
541 Mason1->SetFacingTo(2.8972f);
542 Mason1->AI()->SetData(1, 1); // triggers SAI actions on npc
543 }
545 {
546 Mason2->SetFacingTo(3.1241f);
547 Mason2->AI()->SetData(1, 1); // triggers SAI actions on npc
548 }
550 {
551 Mason3->SetFacingTo(3.6651f);
552 Mason3->AI()->SetData(1, 1); // triggers SAI actions on npc
553 }
554 }
555 break;
557 {
559 LK->AI()->Talk(LK_TALK_1);
561 Dalfors->AI()->Talk(DALFORS_SAY_START);
563 }
564 break;
565 case EVENT_WAVE_SPAWN:
566 {
567 if (PhaseCount == 3)
568 {
570 LK->AI()->Talk(LK_TALK_2);
571 }
572 else if (PhaseCount == 6)
573 {
575 LK->AI()->Talk(LK_TALK_3);
576 }
578 if (urand(0, 1) == 0)
579 {
582 }
583 else
584 {
587 }
588
589 PhaseCount++;
590
591 if (PhaseCount < 8)
593 else
595 }
596 break;
597 case EVENT_HALOF:
598 {
600 LK->AI()->Talk(LK_TALK_4);
601
604
606 {
607 HalofSpawned = true;
608 guidHalof = tempsum->GetGUID();
609 }
610 }
611 break;
612 case EVENT_ENDED:
613 {
614 Summons.DespawnAll();
616 }
617 break;
618 }
619
620 if (PhaseCount == 8)
622 if (Halof->isDead())
623 {
625 Summons.DespawnEntry(NPC_HIDEOUS_PLAGEBRINGER);
626 Summons.DespawnEntry(NPC_REANIMATED_CAPTAIN);
627 Summons.DespawnEntry(NPC_SCOURGE_DRUDGE);
630 Dalfors->AI()->Talk(DALFORS_YELL_FINISHED);
632 }
633 }
634};
635
636/*######
637## Borrowed Technology - Id: 13291, The Solution Solution (daily) - Id: 13292, Volatility - Id: 13239, Volatiliy - Id: 13261 (daily)
638######*/
639
641{
642 // Spells
643 SPELL_GRAB = 59318,
647 SPELL_RIDE = 59319,
648
649 // Points
652
653 // Events
656
658{
659 npc_frostbrood_skytalon(Creature* creature) : VehicleAI(creature) { }
660
662
663 void IsSummonedBy(WorldObject* summoner) override
664 {
665 me->GetMotionMaster()->MovePoint(POINT_GRAB_DECOY, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
666 }
667
668 void MovementInform(uint32 type, uint32 id) override
669 {
670 if (type != POINT_MOTION_TYPE)
671 return;
672
673 if (id == POINT_GRAB_DECOY)
674 if (TempSummon* summon = me->ToTempSummon())
675 if (Unit* summoner = summon->GetSummonerUnit())
676 DoCast(summoner, SPELL_GRAB);
677 }
678
679 void UpdateAI(uint32 diff) override
680 {
682 events.Update(diff);
683
684 while (uint32 eventId = events.ExecuteEvent())
685 {
686 if (eventId == EVENT_FLY_AWAY)
687 {
688 Position randomPosOnRadius;
689 randomPosOnRadius.m_positionZ = (me->GetPositionZ() + 40.0f);
690 me->GetNearPoint2D(nullptr, randomPosOnRadius.m_positionX, randomPosOnRadius.m_positionY, 40.0f, me->GetAbsoluteAngle(me));
691 me->GetMotionMaster()->MovePoint(POINT_FLY_AWAY, randomPosOnRadius);
692 }
693 }
694 }
695
696 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
697 {
698 switch (spellInfo->Id)
699 {
700 case SPELL_EXPLOSION:
702 break;
703 case SPELL_RIDE:
706 break;
707 }
708 }
709};
710
711/*######
712## Quest 12887, 12892: It's All Fun and Games
713######*/
714
715// 55288 - It's All Fun and Games: The Ocular On Death
717{
719
720 bool Validate(SpellInfo const* spellInfo) override
721 {
722 return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
723 }
724
725 void HandleScript(SpellEffIndex /*effIndex*/)
726 {
727 if (Player* target = GetHitPlayer())
728 target->CastSpell(target, uint32(GetEffectValue()));
729 }
730
735};
736
737/*######
738## Quest 14077, 14144: The Light's Mercy
739######*/
740
741// 66411 - Summon Tualiq Proxy
757
758/*######
759## Quest 14076 & 14092: Breakfast Of Champions
760######*/
761
767
768// 66512 - Pound Drum
788
789/*######
790## Quest 14112 & 14145: What Do You Feed a Yeti, Anyway?
791######*/
792
800
808
809// 66741 - Chum the Water
830
831/*######
832## Quest 13121: Through the Eye
833######*/
834
842
843// 25732 - Through the Eye: Eye of the Lich King
873
874// 57884 - Through the Eye: Kill Credit to Master
894
895/*######
896## Quest 13008: Scourge Tactics
897######*/
898
899// 56515 - Summon Freed Crusader
919
920/*######
921## Quest 13236, 13395: Army of the Damned
922######*/
923
929
930// 58916 - Gift of the Lich King
950
951// 58917 - Consume Minions
971
972/*######
973## Quest 12995: Leave Our Mark
974######*/
975
980
981// 23301 - Ebon Blade Banner
997
998/*######
999## Quest 13400: The Hunter and the Prince
1000######*/
1001
1006
1007// 61752 - Illidan Kill Credit Master
1009{
1011
1012 bool Validate(SpellInfo const* /*spellInfo*/) override
1013 {
1015 }
1016
1017 void HandleDummy(SpellEffIndex /*effIndex*/)
1018 {
1019 Unit* caster = GetCaster();
1020 if (caster->IsVehicle())
1021 if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(0))
1022 passenger->CastSpell(passenger, SPELL_ILLIDAN_KILL_CREDIT, true);
1023 }
1024
1029};
1030
1031/*######
1032## Quest 13280, 13283: King of the Mountain
1033######*/
1034
1043
1044// 4338 - Plant Alliance Battle Standard
1045// 59643 - Plant Horde Battle Standard
1047{
1049
1050 void HandleDummy(SpellEffIndex /*effIndex*/)
1051 {
1052 Unit* caster = GetCaster();
1053 Unit* target = GetHitUnit();
1055
1057 if (caster->IsVehicle())
1058 if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
1059 player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC);
1060
1062 triggeredSpellID = SPELL_HORDE_BATTLE_STANDARD_STATE;
1063
1064 target->RemoveAllAuras();
1065 target->CastSpell(target, triggeredSpellID, true);
1066 }
1067
1072};
1073
1074// 4336 - Jump Jets
1076{
1078
1080 {
1081 Unit* caster = GetCaster();
1082 if (caster->IsVehicle())
1083 if (Unit* rocketBunny = caster->GetVehicleKit()->GetPassenger(1))
1084 rocketBunny->CastSpell(rocketBunny, SPELL_JUMP_ROCKET_BLAST, true);
1085 }
1086
1087 void Register() override
1088 {
1090 }
1091};
1092
1093/*######
1094## Quest 13291: Borrowed Technology / 13292: The Solution Solution (Daily) / 13239: Volatility / 13261: Volatiliy (Daily)
1095######*/
1096
1101
1102// 59318 - Grab Fake Soldier
1104{
1106
1107 bool Validate(SpellInfo const* /*spell*/) override
1108 {
1110 }
1111
1112 void HandleDummy(SpellEffIndex /*effIndex*/)
1113 {
1114 if (!GetHitCreature())
1115 return;
1116 // TO DO: Being triggered is hack, but in checkcast it doesn't pass aurastate requirements.
1117 // Beside that the decoy won't keep it's freeze animation state when enter.
1119 }
1120
1125};
1126
1127// 59303 - Summon Frost Wyrm
1129{
1131
1133 {
1134 // Adjust effect summon position
1135 Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f };
1136 dest.RelocateOffset(offset);
1137 }
1138
1143};
1144
1145/*######
1146## Quest 12847: Second Chances
1147######*/
1148
1149// 12601 - Second Chances: Summon Landgren's Soul Moveto Target Bunny
1151{
1153
1155 {
1156 // Adjust effect summon position
1157 Position const offset = { 0.0f, 0.0f, 2.5f, 0.0f };
1158 dest.RelocateOffset(offset);
1159 }
1160
1165};
1166
1167/*######
1168## Quest 13086: The Last Line Of Defense
1169######*/
1170
1175
1176// 57387 - Argent Cannon Assault
1196
1197// 57385 - Argent Cannon
1198// 57412 - Reckoning Bomb
1200{
1202
1203 bool Validate(SpellInfo const* spellInfo) override
1204 {
1205 return ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
1206 }
1207
1208 void HandleDummy(SpellEffIndex /*effIndex*/)
1209 {
1210 if (WorldLocation const* pos = GetExplTargetDest())
1211 GetCaster()->CastSpell(pos->GetPosition(), GetEffectValue(), true);
1212 }
1213
1218};
1219
1220/*######
1221## Quest 13790, 13793, 13811, 13814: Among the Champions / 13665, 13745, 13750, 13756, 13761, 13767, 13772, 13777, 13782, 13787: The Grand Melee
1222######*/
1223
1225{
1227
1228 bool Validate(SpellInfo const* spellInfo) override
1229 {
1230 return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
1231 }
1232
1233 void HandleScript(SpellEffIndex /*effIndex*/)
1234 {
1236 target->CastSpell(target, uint32(GetEffectValue()), true);
1237 }
1238
1243};
1244
1245/*######
1246## Quest 13264, 13276, 13288, 13289: That's Abominable!
1247######*/
1248
1284
1285// 59576 - Burst at the Seams
1287{
1289
1302
1303 void HandleScript(SpellEffIndex /*effIndex*/)
1304 {
1305 if (Creature* creature = GetCaster()->ToCreature())
1306 {
1307 creature->CastSpell(creature, SPELL_BLOATED_ABOMINATION_FEIGN_DEATH, true);
1308 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59579, true);
1309 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1310 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1311 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1312 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1313 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1314 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1315 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1316 }
1317 }
1318
1323};
1324
1325// 59579 - Burst at the Seams
1327{
1329
1330 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1331 {
1332 Unit* target = GetTarget();
1333 target->CastSpell(target, SPELL_TROLL_EXPLOSION, true);
1334 target->CastSpell(target, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1335 target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
1336 target->CastSpell(target, SPELL_EXPLODE_TROLL_MEAT, true);
1337 target->CastSpell(target, SPELL_EXPLODE_TROLL_BLOODY_MEAT, true);
1338 target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1339 }
1340
1341 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1342 {
1343 Unit* target = GetTarget();
1344 if (Unit* caster = GetCaster())
1345 {
1346 switch (target->GetEntry())
1347 {
1348 case NPC_ICY_GHOUL:
1350 break;
1351 case NPC_VICIOUS_GEIST:
1353 break;
1356 break;
1357 }
1358 }
1359 target->CastSpell(target, SPELL_BURST_AT_THE_SEAMS_59580, true);
1360 }
1361
1367};
1368
1369// 52593 - Bloated Abomination Feign Death
1371{
1373
1374 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1375 {
1376 Unit* target = GetTarget();
1379
1380 if (Creature* creature = target->ToCreature())
1381 creature->SetReactState(REACT_PASSIVE);
1382 }
1383
1384 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1385 {
1386 Unit* target = GetTarget();
1387 if (Creature* creature = target->ToCreature())
1388 creature->DespawnOrUnsummon();
1389 }
1390
1396};
1397
1398// 76245 - Area Restrict Abom
1400{
1402
1403 void HandleScript(SpellEffIndex /*effIndex*/)
1404 {
1405 if (Creature* creature = GetHitCreature()) {
1406 uint32 area = creature->GetAreaId();
1408 creature->DespawnOrUnsummon();
1409 }
1410 }
1411
1416};
1417
1418// 59590 - Assign Ghoul Kill Credit to Master
1419// 60039 - Assign Skeleton Kill Credit to Master
1420// 60041 - Assign Geist Kill Credit to Master
1422{
1424
1425 void HandleScript(SpellEffIndex /*effIndex*/)
1426 {
1427 if (Unit* target = GetHitUnit())
1428 {
1429 if (Unit* owner = target->GetOwner())
1430 {
1431 owner->CastSpell(owner, GetEffectValue(), true);
1432 }
1433 }
1434 }
1435
1440};
1441
1442// 52510 - Burst at the Seams
1444{
1446
1459
1460 bool Load() override
1461 {
1462 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1463 }
1464
1466 {
1467 if (Unit* creature = GetHitCreature())
1468 {
1469 if (Unit* charmer = GetCaster()->GetCharmerOrOwner())
1470 {
1471 if (Player* player = charmer->ToPlayer())
1472 {
1473 if (player->GetQuestStatus(QUEST_FUEL_FOR_THE_FIRE) == QUEST_STATUS_INCOMPLETE)
1474 {
1475 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
1476 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_MEAT, true);
1477 creature->CastSpell(creature, SPELL_EXPLODE_ABOMINATION_BLOODY_MEAT, true);
1478 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_52508, true);
1479 creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_59580, true);
1480
1481 player->CastSpell(player, SPELL_DRAKKARI_SKULLCRUSHER_CREDIT, true);
1482 uint16 count = player->GetReqKillOrCastCurrentCount(QUEST_FUEL_FOR_THE_FIRE, NPC_DRAKKARI_CHIEFTAINK);
1483 if ((count % 20) == 0)
1484 player->CastSpell(player, SPELL_SUMMON_DRAKKARI_CHIEFTAIN, true);
1485 }
1486 }
1487 }
1488 }
1489 }
1490
1491 void HandleScript(SpellEffIndex /*effIndex*/)
1492 {
1494 }
1495
1501};
1502
1503/*######
1504## Quest 13082: The Boon of A'dal
1505######*/
1506
1516
1517// 57787 - Forcecast Bridenbrad Ascension
1551
1553{
1585}
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
@ 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
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterCreatureAI(ai_name)
Definition ScriptMgr.h:1139
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
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
@ UNIT_DYNFLAG_DEAD
@ 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)
@ UNIT_FLAG2_FEIGN_DEATH
@ REACT_PASSIVE
@ UNIT_STATE_STUNNED
Definition Unit.h:223
DamageEffectType
Definition Unit.h:352
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetCaster() const
Unit * GetTarget() const
int32 GetDuration() const
Definition SpellAuras.h:148
uint8 GetStackAmount() const
Definition SpellAuras.h:164
@ EVADE_REASON_OTHER
Definition CreatureAI.h:98
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
Creature * DoSummon(uint32 entry, Position const &pos, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:293
void SetReactState(ReactStates st)
Definition Creature.h:119
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetRegenerateHealth(bool value)
Definition Creature.h:285
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:52
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
static Creature * ToCreature(Object *o)
Definition Object.h:186
static Unit * ToUnit(Object *o)
Definition Object.h:192
TypeID GetTypeId() const
Definition Object.h:93
virtual void SetDynamicFlag(uint32 flag)
Definition Object.h:89
uint32 GetEntry() const
Definition Object.h:81
static Player * ToPlayer(Object *o)
Definition Object.h:180
TeamId GetTeamId() const
Definition Player.h:1833
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
HookList< CastHandler > AfterCast
Creature * GetHitCreature() const
Player * GetHitPlayer() const
Unit * GetCaster() const
HookList< DestinationTargetSelectHandler > OnDestinationTargetSelect
HookList< EffectHandler > OnEffectHit
Unit * GetHitUnit() const
int32 GetEffectValue() const
HookList< EffectHandler > OnEffectHitTarget
HookList< CastHandler > OnCast
WorldLocation const * GetExplTargetDest() const
SpellInfo const * GetSpellInfo() const
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool IsVehicle() const
Definition Unit.h:887
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4439
void SetControlled(bool apply, UnitState state)
Definition Unit.cpp:11256
void SetFaction(uint32 faction) override
Definition Unit.h:974
bool isInBackInMap(Unit const *target, float distance, float arc=float(M_PI)) const
Definition Unit.cpp:3149
Unit * GetVehicleBase() const
Definition Unit.cpp:11826
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:960
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
uint32 GetHealth() const
Definition Unit.h:913
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
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void HandleEmoteCommand(Emote emoteId)
Definition Unit.cpp:1568
void RemoveAllAuras()
Definition Unit.cpp:4157
Vehicle * GetVehicleKit() const
Definition Unit.h:1735
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition Vehicle.cpp:296
Unit * GetCharmerOrOwnerOrSelf() const
Definition Object.cpp:2195
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
bool IsHostileTo(WorldObject const *target) const
Definition Object.cpp:2796
Unit * GetOwner() const
Definition Object.cpp:2180
void GetNearPoint2D(WorldObject const *searcher, float &x, float &y, float distance, float absAngle) const
Definition Object.cpp:3180
uint32 GetAreaId() const
Definition Object.h:374
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareSpellScript(spell_icecrown_area_restrict_abom)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_argent_cannon_assault)
PrepareSpellScript(spell_icecrown_assign_credit_to_master)
PrepareSpellScript(spell_icecrown_bested_trigger)
bool Validate(SpellInfo const *spellInfo) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_icecrown_bloated_abom_feign_death)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_burst_at_the_seams_52510)
PrepareSpellScript(spell_icecrown_burst_at_the_seams_59576)
bool Validate(SpellInfo const *) override
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_icecrown_burst_at_the_seams_59579)
bool Validate(SpellInfo const *spellInfo) override
PrepareSpellScript(spell_icecrown_cannons_target)
void HandleScript(SpellEffIndex)
PrepareSpellScript(spell_icecrown_chum_the_water)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_consume_minions)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_ebon_blade_banner)
PrepareSpellScript(spell_icecrown_forcecast_bridenbrad_ascension)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_gift_of_the_lich_king)
PrepareSpellScript(spell_icecrown_grab_fake_soldier)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_illidan_kill_credit_master)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_jump_jets)
PrepareSpellScript(spell_icecrown_plant_battle_standard)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_icecrown_pound_drum)
PrepareSpellScript(spell_icecrown_summon_freed_crusader)
bool Validate(SpellInfo const *spellInfo) override
PrepareSpellScript(spell_icecrown_summon_frost_wyrm)
void SetDest(SpellDestination &dest)
void SetDest(SpellDestination &dest)
PrepareSpellScript(spell_icecrown_summon_soul_moveto_bunny)
void SetDest(SpellDestination &dest)
PrepareSpellScript(spell_icecrown_summon_tualiq_proxy)
bool Validate(SpellInfo const *spellInfo) override
PrepareSpellScript(spell_icecrown_the_ocular_on_death)
PrepareSpellScript(spell_icecrown_through_the_eye_kill_credit_to_master)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_icecrown_through_the_eye_the_eye_of_the_lk)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
float m_positionZ
Definition Position.h:58
float m_positionX
Definition Position.h:56
float GetPositionZ() const
Definition Position.h:81
float m_positionY
Definition Position.h:57
float GetOrientation() const
Definition Position.h:82
float GetAbsoluteAngle(float x, float y) const
Definition Position.h:128
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
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:110
void UpdateAI(uint32 diff) override
Definition CombatAI.cpp:279
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]