TrinityCore
boss_northrend_beasts.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 "InstanceScript.h"
20#include "Map.h"
21#include "MotionMaster.h"
22#include "ObjectAccessor.h"
23#include "Player.h"
24#include "ScriptedCreature.h"
25#include "SpellAuraEffects.h"
26#include "SpellScript.h"
27#include "TemporarySummon.h"
29#include "Vehicle.h"
30
32{
33 // Gormok
35
36 // Acidmaw & Dreadscale
39
40 // Icehowl
44};
45
47{
52};
53
55{
56 // Gormok
57 SPELL_IMPALE = 66331,
59 SPELL_TANKING_GORMOK = 66415, // No idea what it does (SERVERSIDE spell)
60
61 // Snobold
64 SPELL_BATTER = 66408,
70
71 // Acidmaw & Dreadscale Generic
72 SPELL_SWEEP = 66794,
74 SPELL_EMERGE = 66947,
77 SPELL_ENRAGE = 68335,
81 // Acidmaw
88 // Dreadscale
94
95 // Slime Pool
98
99 // Icehowl
102 SPELL_WHIRL = 67345,
108 SPELL_ROAR = 66736,
111 SPELL_BERSERK = 26662
113
115{
124
126{
127 // Gormok
132
133 // Snobold
139
140 // Beasts Combat Stalker
144
145 // Acidmaw & Dreadscale
154
155 // Icehowl
166
168{
176
178{
183
185{
191
192Position const CombatStalkerPosition = { 563.8941f, 137.3333f, 405.8467f };
193
195{
196public:
198
199 bool operator()(Unit* unit) const
200 {
201 return unit->GetTypeId() == TYPEID_PLAYER && !unit->HasAura(SPELL_RIDE_PLAYER) && !unit->HasAura(SPELL_SNOBOLLED);
202 }
203};
204
206{
207 boss_northrend_beastsAI(Creature* creature, uint32 bossId) : BossAI(creature, bossId)
208 {
210 }
211
212 void Reset() override
213 {
214 events.Reset();
220 }
221
223 {
224 switch (me->GetEntry())
225 {
226 case NPC_GORMOK:
227 case NPC_DREADSCALE:
229 break;
230 case NPC_ICEHOWL:
232 break;
233 default:
234 break;
235 }
236 }
237
239 {
241 {
242 if (me->GetEntry() == NPC_GORMOK)
243 combatStalker->AI()->DoAction(ACTION_START_JORMUNGARS);
244 else if (me->GetEntry() == NPC_DREADSCALE)
245 combatStalker->AI()->DoAction(ACTION_START_ICEHOWL);
246 }
247 }
248
249 void JustEngagedWith(Unit* /*who*/) override
250 {
252 me->setActive(true);
256 if (IsHeroic())
258 }
259
261 {
262 switch (me->GetEntry())
263 {
264 case NPC_GORMOK:
266 break;
267 case NPC_ACIDMAW:
268 case NPC_DREADSCALE:
271 break;
272 case NPC_ICEHOWL:
274 break;
275 default:
276 break;
277 }
278 }
279
280 void EnterEvadeMode(EvadeReason why) override
281 {
285 // prevent losing 2 attempts at once on heroics
289 combatStalker->DespawnOrUnsummon();
292 }
293
294 void JustDied(Unit* /*killer*/) override
295 {
297 if (me->GetEntry() == NPC_GORMOK)
298 {
301 combatStalker->AI()->DoAction(ACTION_GORMOK_DEAD);
302 }
303 else
305 }
306
307 void UpdateAI(uint32 diff) override
308 {
310 return;
311
312 events.Update(diff);
313
315 return;
316
317 while (uint32 eventId = events.ExecuteEvent())
318 {
319 ExecuteEvent(eventId);
321 return;
322 }
323 }
324};
325
327{
329
330 void ScheduleTasks() override
331 {
335 }
336
337 void PassengerBoarded(Unit* who, int8 seatId, bool apply) override
338 {
339 if (apply && seatId == GORMOK_HAND_SEAT)
340 who->CastSpell(who, SPELL_RISING_ANGER, true);
341 }
342
343 void MovementInform(uint32 type, uint32 pointId) override
344 {
345 if (type == SPLINE_CHAIN_MOTION_TYPE && pointId == POINT_INITIAL_MOVEMENT)
347 }
348
349 void ExecuteEvent(uint32 eventId) override
350 {
351 switch (eventId)
352 {
353 case EVENT_ENGAGE:
355 me->SetImmuneToPC(false);
357 // Npc that should keep raid in combat while boss change
359 {
360 DoZoneInCombat(combatStalker);
361 combatStalker->SetCombatPulseDelay(5);
362 }
366 break;
367 case EVENT_IMPALE:
369 events.Repeat(10s);
370 break;
373 events.Repeat(22s);
374 break;
375 case EVENT_THROW:
376 for (uint8 i = 0; i < MAX_SNOBOLDS; ++i)
377 {
378 if (Unit* snobold = me->GetVehicleKit()->GetPassenger(i))
379 {
380 snobold->ExitVehicle();
381 snobold->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
382 snobold->SetUninteractible(false);
383 snobold->GetAI()->DoAction(ACTION_DISABLE_FIRE_BOMB);
384 snobold->CastSpell(me, SPELL_JUMP_TO_HAND, true);
385 break;
386 }
387 }
388 events.Repeat(20s);
389 break;
390 default:
391 break;
392 }
393 }
394};
395
397{
398 npc_snobold_vassal(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _mountedOnPlayer(false), _gormokDead(false)
399 {
401 SetCombatMovement(false);
402 }
403
404 bool CanAIAttack(Unit const* who) const override
405 {
406 if (_mountedOnPlayer && who->GetGUID() != _targetGUID)
407 return false;
408
409 return ScriptedAI::CanAIAttack(who);
410 }
411
412 void AttackStart(Unit* victim) override
413 {
415 if (!_mountedOnPlayer && (!gormok || !gormok->IsAlive()))
416 AttackStartCaster(victim, 30.0f);
417 else
419 }
420
421 void JustEngagedWith(Unit* /*who*/) override
422 {
425 }
426
427 void JustDied(Unit* /*killer*/) override
428 {
430 }
431
432 void DoAction(int32 action) override
433 {
434 switch (action)
435 {
438 break;
441 break;
443 _mountedOnPlayer = true;
444 me->SetCanMelee(true);
445 break;
446 default:
447 break;
448 }
449 }
450
451 void SetGUID(ObjectGuid const& guid, int32 id) override
452 {
453 if (id == DATA_NEW_TARGET)
454 if (Unit* target = ObjectAccessor::GetPlayer(*me, guid))
455 {
456 _targetGUID = guid;
457 AttackStart(target);
461 }
462 }
463
465 {
467 if (gormok && gormok->IsAlive())
468 {
469 me->AttackStop();
470 me->SetCanMelee(false);
472 _mountedOnPlayer = false;
475
476 for (uint8 i = 0; i < MAX_SNOBOLDS; i++)
477 {
478 if (!gormok->GetVehicleKit()->GetPassenger(i))
479 {
480 me->EnterVehicle(gormok, i);
482 break;
483 }
484 }
485 }
486 else
487 {
489 me->SetUninteractible(false);
492 me->AttackStop();
493 me->SetCanMelee(true);
494 SetCombatMovement(true);
495 _gormokDead = true;
496 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
497 {
498 AttackStart(target);
499 me->GetMotionMaster()->MoveChase(target);
502 }
503 }
504 }
505
506 void UpdateAI(uint32 diff) override
507 {
508 if (!UpdateVictim())
509 return;
510
511 _events.Update(diff);
512
514 return;
515
516 while (uint32 eventId = _events.ExecuteEvent())
517 {
518 switch (eventId)
519 {
520 case EVENT_FIRE_BOMB:
521 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
522 me->CastSpell(target, SPELL_FIRE_BOMB);
523 _events.Repeat(20s, 30s);
524 break;
525 case EVENT_HEAD_CRACK:
526 if (Unit* target = me->GetVehicleBase())
527 DoCast(target, SPELL_HEAD_CRACK);
528 else
530 _events.Repeat(30s);
531 break;
532 case EVENT_BATTER:
533 if (Unit* target = me->GetVehicleBase())
534 DoCast(target, SPELL_BATTER);
535 else
537 _events.Repeat(10s, 15s);
538 break;
539 case EVENT_SNOBOLLED:
541 break;
543 if (!me->GetVehicleBase())
544 MountOnBoss();
545 _events.Repeat(3s);
546 break;
547 default:
548 break;
549 }
550
552 return;
553 }
554 }
555
556private:
562};
563
565{
566 npc_fire_bomb(Creature* creature) : ScriptedAI(creature) { }
567
568 void Reset() override
569 {
571 }
572};
573
575{
576 npc_beasts_combat_stalker(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
577
578 void Reset() override
579 {
581 _events.ScheduleEvent(EVENT_BERSERK, IsHeroic() ? 9min : 15min);
582 }
583
584 void DoAction(int32 action) override
585 {
586 switch (action)
587 {
590 break;
593 break;
596 break;
599 break;
600 default:
601 break;
602 }
603 }
604
605 void UpdateAI(uint32 diff) override
606 {
607 _events.Update(diff);
608
609 while (uint32 eventId = _events.ExecuteEvent())
610 {
611 switch (eventId)
612 {
613 case EVENT_BERSERK:
615 gormok->CastSpell(gormok, SPELL_BERSERK, true);
616
617 if (Creature* dreadscale = _instance->GetCreature(DATA_DREADSCALE))
618 dreadscale->CastSpell(dreadscale, SPELL_BERSERK, true);
619
621 acidmaw->CastSpell(acidmaw, SPELL_BERSERK, true);
622
624 icehowl->CastSpell(icehowl, SPELL_BERSERK, true);
625 break;
628 tirion->AI()->DoAction(ACTION_START_JORMUNGARS);
629 break;
632 tirion->AI()->DoAction(ACTION_START_ICEHOWL);
633 break;
634 default:
635 break;
636 }
637 }
638 }
639
640private:
643};
644
646{
647 boss_jormungarAI(Creature* creature, uint32 bossId) : boss_northrend_beastsAI(creature, bossId)
648 {
649 Initialize();
650 }
651
653 {
654 otherWormEntry = 0;
655 modelStationary = 0;
656 modelMobile = 0;
657 biteSpell = 0;
658 spewSpell = 0;
659 spitSpell = 0;
660 spraySpell = 0;
661 wasMobile = false;
662 }
663
664 void Reset() override
665 {
666 Initialize();
668 me->SetCanMelee(true);
669 }
670
671 void JustSummoned(Creature* summoned) override
672 {
673 if (summoned->GetEntry() == NPC_ACIDMAW)
674 BossAI::JustSummoned(summoned);
675 else
676 summons.Summon(summoned);
677 }
678
679 void ScheduleTasks() override
680 {
682 {
685 }
686 else
687 {
691 }
692
694 }
695
697 {
698 return wormEntry == NPC_ACIDMAW ? DATA_ACIDMAW : DATA_DREADSCALE;
699 }
700
701 void JustDied(Unit* /*killer*/) override
702 {
704 {
705 if (!otherWorm->IsAlive())
706 {
709 otherWorm->DespawnOrUnsummon();
711 combatStalker->AI()->DoAction(ACTION_JORMUNGARS_DEAD);
712 }
713 else
714 {
716 otherWorm->AI()->DoAction(ACTION_ENRAGE);
717 }
718 }
720 }
721
722 void DoAction(int32 action) override
723 {
724 if (action == ACTION_ENRAGE)
725 {
730 }
731 }
732
733 void Submerge()
734 {
736 me->AttackStop();
738
739 if (wasMobile)
740 {
742 me->SetSpeedRate(MOVE_RUN, 8.0f);
746 }
747 else
748 {
751 me->SetSpeedRate(MOVE_RUN, 1.1111f);
756 }
757
759 me->SetUninteractible(true);
760 me->SetCanMelee(false);
761 me->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionY() + frand(-40.0f, 40.0f), ToCCommonLoc[1].GetPositionZ() + me->GetCollisionHeight());
762 }
763
764 void Emerge()
765 {
768 me->RemoveAurasDueToSpell(submergeSpell);
773 me->SetUninteractible(false);
776 AttackStart(target);
777
778 // if the worm was mobile before submerging, make him stationary now
779 if (wasMobile)
780 {
783 me->SetCanMelee(false);
786 }
787 else
788 {
789 if (Unit* target = me->GetVictim())
790 me->GetMotionMaster()->MoveChase(target);
792 me->SetCanMelee(true);
794 }
797 }
798
799 void ExecuteEvent(uint32 eventId) override
800 {
801 switch (eventId)
802 {
803 case EVENT_ENGAGE:
804 if (me->GetEntry() == NPC_DREADSCALE)
805 {
807 me->SetImmuneToPC(false);
808 me->SetCanMelee(true);
813 }
814 else
815 {
818 }
819 break;
820 case EVENT_EMERGE:
821 Emerge();
822 break;
823 case EVENT_SUBMERGE:
824 Submerge();
825 break;
826 case EVENT_BITE:
828 events.Repeat(15s);
829 break;
830 case EVENT_SPEW:
832 events.Repeat(21s);
833 break;
834 case EVENT_SLIME_POOL:
836 events.Repeat(12s);
837 break;
840 break;
841 case EVENT_SPRAY:
842 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
843 DoCast(target, spraySpell);
844 events.Repeat(21s);
845 break;
846 case EVENT_SWEEP:
848 events.Repeat(17s);
849 break;
850 default:
851 break;
852 }
853 }
854
855 void UpdateAI(uint32 diff) override
856 {
858 return;
859
860 events.Update(diff);
861
863 return;
864
865 while (uint32 eventId = events.ExecuteEvent())
866 {
867 ExecuteEvent(eventId);
869 return;
870 }
871
874 }
875
876 protected:
885};
886
888{
890
891 void Reset() override
892 {
901 wasMobile = true;
902 }
903
904 void MovementInform(uint32 type, uint32 pointId) override
905 {
906 if (type == SPLINE_CHAIN_MOTION_TYPE && pointId == POINT_INITIAL_MOVEMENT)
908 }
909};
910
912{
914
915 void Reset() override
916 {
926 wasMobile = false;
930 }
931};
932
934{
936
937 void Reset() override
938 {
940 {
943 }, 1s);
944 }
945};
946
948{
950
951 void ScheduleTasks() override
952 {
957 }
958
960 {
965 }
966
967 void MovementInform(uint32 type, uint32 pointId) override
968 {
969 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE && type != SPLINE_CHAIN_MOTION_TYPE)
970 return;
971
972 switch (pointId)
973 {
976 break;
977 case POINT_MIDDLE:
980 break;
982 events.Reset();
987 break;
988 default:
989 break;
990 }
991 }
992
993 void DoAction(int32 action) override
994 {
995 if (action == ACTION_ENRAGE)
996 {
999 }
1000 else if (action == ACTION_TRAMPLE_FAIL)
1001 {
1004 events.DelayEvents(15s);
1005 }
1006 }
1007
1008 void ExecuteEvent(uint32 eventId) override
1009 {
1010 switch (eventId)
1011 {
1012 case EVENT_ENGAGE:
1014 me->SetImmuneToPC(false);
1018 break;
1021 me->AttackStop();
1023 me->GetMotionMaster()->MoveJump(ToCCommonLoc[1], 20.0f, 20.0f, POINT_MIDDLE);
1024 break;
1026 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
1027 {
1028 DoCast(target, SPELL_FURIOUS_CHARGE_SUMMON, true);
1029 me->SetTarget(target->GetGUID());
1030 Talk(EMOTE_TRAMPLE_ROAR, target);
1032 }
1033 break;
1034 case EVENT_ICEHOWL_ROAR:
1036 DoCast(stalker, SPELL_ROAR);
1038 break;
1039 case EVENT_JUMP_BACK:
1041 DoCast(stalker, SPELL_JUMP_BACK);
1043 break;
1044 case EVENT_TRAMPLE:
1046 me->GetMotionMaster()->MoveCharge(stalker->GetPositionX(), stalker->GetPositionY(), stalker->GetPositionZ(), 42.0f, POINT_ICEHOWL_CHARGE);
1048 break;
1051 events.Repeat(20s);
1052 break;
1054 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
1055 DoCast(target, SPELL_ARCTIC_BREATH);
1056 events.Repeat(24s);
1057 break;
1058 case EVENT_WHIRL:
1060 events.Repeat(16s);
1061 break;
1062 default:
1063 break;
1064 }
1065 }
1066};
1067
1068// 66342 - Jump to Hand
1070{
1071 bool Validate(SpellInfo const* /*spell*/) override
1072 {
1074 }
1075
1076 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1077 {
1078 Unit* caster = GetCaster();
1079 if (!caster || caster->GetEntry() != NPC_SNOBOLD_VASSAL)
1080 return;
1081
1082 if (Creature* gormok = GetTarget()->ToCreature())
1083 if (Unit* target = gormok->AI()->SelectTarget(SelectTargetMethod::Random, 0, SnobolledTargetSelector()))
1084 {
1085 gormok->AI()->Talk(EMOTE_SNOBOLLED);
1087 caster->CastSpell(target, SPELL_RIDE_PLAYER, true);
1088 }
1089 }
1090
1091 void Register() override
1092 {
1094 }
1095};
1096
1097// 66245 - Ride Vehicle
1099{
1100 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1101 {
1102 Unit* target = GetTarget();
1103 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
1104 return;
1105
1106 if (Unit *caster = GetCaster())
1107 if (caster->IsAIEnabled())
1108 caster->GetAI()->SetGUID(target->GetGUID(), DATA_NEW_TARGET);
1109 }
1110
1111 void Register() override
1112 {
1114 }
1115};
1116
1117// 66406 - Snobolled!
1119{
1120 bool Validate(SpellInfo const* /*spell*/) override
1121 {
1123 }
1124
1125 void OnPeriodic(AuraEffect const* /*aurEff*/)
1126 {
1128 Remove();
1129 }
1130
1131 void Register() override
1132 {
1134 }
1135};
1136
1137// 66823, 67618, 67619, 67620 - Paralytic Toxin
1139{
1140 bool Validate(SpellInfo const* /*spell*/) override
1141 {
1143 }
1144
1145 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1146 {
1147 Unit* caster = GetCaster();
1148 if (caster && caster->GetEntry() == NPC_ACIDMAW)
1149 if (Creature* acidmaw = caster->ToCreature())
1150 acidmaw->AI()->Talk(SAY_SPECIAL, GetTarget());
1151 }
1152
1153 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1154 {
1156 }
1157
1158 void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated)
1159 {
1160 if (!canBeRecalculated)
1161 amount = aurEff->GetAmount();
1162
1163 canBeRecalculated = false;
1164 }
1165
1166 void HandleDummy(AuraEffect const* /*aurEff*/)
1167 {
1168 if (AuraEffect* slowEff = GetEffect(EFFECT_0))
1169 {
1170 int32 newAmount = slowEff->GetAmount() - 10;
1171 if (newAmount < -100)
1172 newAmount = -100;
1173 slowEff->ChangeAmount(newAmount);
1174
1175 if (newAmount == -100 && !GetTarget()->HasAura(SPELL_PARALYSIS))
1176 GetTarget()->CastSpell(GetTarget(), SPELL_PARALYSIS, CastSpellExtraArgs(slowEff).SetOriginalCaster(GetCasterGUID()));
1177 }
1178 }
1179
1180 void Register() override
1181 {
1186 }
1187};
1188
1189// 66870, 67621, 67622, 67623 - Burning Bile
1191{
1193 {
1194 PreventHitDefaultEffect(effIndex);
1196 }
1197
1198 void Register() override
1199 {
1201 }
1202};
1203
1204// 66882 - Slime Pool
1206{
1207 bool Validate(SpellInfo const* spellInfo) override
1208 {
1209 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
1210 }
1211
1212 void PeriodicTick(AuraEffect const* aurEff)
1213 {
1215
1216 int32 const radius = static_cast<int32>(((aurEff->GetTickNumber() / 60.f) * 0.9f + 0.1f) * 10000.f * 2.f / 3.f);
1217 CastSpellExtraArgs args(aurEff);
1218 args.AddSpellMod(SPELLVALUE_RADIUS_MOD, radius);
1219 GetTarget()->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, args);
1220 }
1221
1222 void Register() override
1223 {
1225 }
1226};
1227
1228/* 66869 - Burning Bile
1229 66823 - Paralytic Toxin */
1231{
1232public:
1234
1235private:
1236 bool Validate(SpellInfo const* /*spell*/) override
1237 {
1238 return ValidateSpellInfo({ _spellId });
1239 }
1240
1241 void HandleScript(SpellEffIndex /*effIndex*/)
1242 {
1244 }
1245
1246 void Register() override
1247 {
1249 }
1250
1252};
1253
1254// 66830 - Paralysis
1256{
1257 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1258 {
1259 if (Unit* caster = GetCaster())
1260 if (InstanceScript* instance = caster->GetInstanceScript())
1261 if (instance->GetBossState(DATA_NORTHREND_BEASTS) == IN_PROGRESS)
1262 return;
1263
1264 Remove();
1265 }
1266
1267 void Register() override
1268 {
1270 }
1271};
1272
1273// 66688 - Arctic Breath
1275{
1276 bool Validate(SpellInfo const* spellInfo) override
1277 {
1278 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
1279 }
1280
1282 {
1283 uint32 spellId = GetEffectInfo().CalcValue();
1284 GetCaster()->CastSpell(GetHitUnit(), spellId, true);
1285 }
1286
1287 void Register() override
1288 {
1290 }
1291};
1292
1293// 66734 - Trample
1295{
1296 void CheckTargets(std::list<WorldObject*>& targets)
1297 {
1298 Creature* caster = GetCaster()->ToCreature();
1299 if (!caster || !caster->IsAIEnabled())
1300 return;
1301
1302 if (targets.empty())
1303 caster->AI()->DoAction(ACTION_TRAMPLE_FAIL);
1304 else
1305 caster->AI()->DoAction(ACTION_ENRAGE);
1306 }
1307
1308 void Register() override
1309 {
1311 }
1312};
1313
1314// 66683 - Massive Crash
1316{
1317 bool Validate(SpellInfo const* /*spell*/) override
1318 {
1320 }
1321
1322 void HandleSpeed(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1323 {
1324 if (Player* target = GetTarget()->ToPlayer())
1325 if (target->GetMap()->IsHeroic())
1326 target->CastSpell(target, SPELL_SURGE_OF_ADRENALINE, true);
1327 }
1328
1329 void Register() override
1330 {
1332 }
1333};
1334
1336{
1345
1358}
uint8_t uint8
Definition: Define.h:144
int8_t int8
Definition: Define.h:140
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ FAIL
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ SPLINE_CHAIN_MOTION_TYPE
@ POINT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
float frand(float min, float max)
Definition: Random.cpp:55
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition: ScriptMgr.h:1368
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ EFFECT_2
Definition: SharedDefines.h:32
@ TARGET_UNIT_SRC_AREA_ENEMY
@ EMOTE_ONESHOT_SUBMERGE
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_SCHOOL_DAMAGE
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_MOD_STUN
@ SPELLVALUE_RADIUS_MOD
Definition: SpellDefines.h:229
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:2058
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define AuraEffectApplyFn(F, I, N, M)
Definition: SpellScript.h:2029
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
EvadeReason
Definition: UnitAICommon.h:30
@ MOVE_RUN
Definition: UnitDefines.h:118
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
@ UNIT_STATE_ROOT
Definition: Unit.h:265
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ MODEL_ACIDMAW_MOBILE
@ MODEL_ACIDMAW_STATIONARY
@ MODEL_DREADSCALE_MOBILE
@ MODEL_DREADSCALE_STATIONARY
Position const CombatStalkerPosition
@ SPLINE_INITIAL_MOVEMENT
@ GORMOK_HAND_SEAT
@ EMOTE_TRAMPLE_ENRAGE
@ EMOTE_SNOBOLLED
@ EMOTE_TRAMPLE_FAIL
@ EMOTE_TRAMPLE_ROAR
@ PHASE_STATIONARY
void AddSC_boss_northrend_beasts()
@ SPELL_MASSIVE_CRASH
@ SPELL_FEROCIOUS_BUTT
@ SPELL_JUMP_TO_HAND
@ SPELL_FIRE_SPIT
@ SPELL_SLIME_POOL_EFFECT
@ SPELL_FIRE_BOMB
@ SPELL_FURIOUS_CHARGE_SUMMON
@ SPELL_BURNING_SPRAY
@ SPELL_RIDE_PLAYER
@ SPELL_PARALYTIC_BITE
@ SPELL_BURNING_BITE
@ SPELL_PARALYTIC_TOXIN
@ SUMMON_SLIME_POOL
@ SPELL_PARALYSIS
@ SPELL_SNOBOLLED
@ SPELL_FROTHING_RAGE
@ SPELL_RISING_ANGER
@ SPELL_HATE_TO_ZERO
@ SPELL_PACIFY_SELF
@ SPELL_PARALYTIC_SPRAY
@ SPELL_FIRE_BOMB_AURA
@ SPELL_TANKING_GORMOK
@ SPELL_GROUND_VISUAL_0
@ SPELL_STAGGERING_STOMP
@ SPELL_SURGE_OF_ADRENALINE
@ SPELL_ARCTIC_BREATH
@ SPELL_MOLTEN_SPEW
@ SPELL_ACID_SPEW
@ SPELL_HEAD_CRACK
@ SPELL_BURNING_BILE
@ SPELL_STAGGERED_DAZE
@ SPELL_SUBMERGE
@ SPELL_ACID_SPIT
@ SPELL_GROUND_VISUAL_1
@ SPELL_SUBMERGE_2
@ ACTION_ACTIVE_SNOBOLD
@ ACTION_JORMUNGARS_DEAD
@ ACTION_TRAMPLE_FAIL
@ ACTION_ENABLE_FIRE_BOMB
@ ACTION_DISABLE_FIRE_BOMB
@ ACTION_GORMOK_DEAD
@ POINT_ICEHOWL_CHARGE
@ POINT_INITIAL_MOVEMENT
@ EVENT_SUMMON_ACIDMAW
@ EVENT_MASSIVE_CRASH
@ EVENT_SELECT_CHARGE_TARGET
@ EVENT_CHECK_MOUNT
@ EVENT_ROAR_EMOTE
@ EVENT_START_ICEHOWL
@ EVENT_SLIME_POOL
@ EVENT_STAGGERING_STOMP
@ EVENT_ICEHOWL_ROAR
@ EVENT_HEAD_CRACK
@ EVENT_FEROCIOUS_BUTT
@ EVENT_START_JORGMUNGARS
@ EVENT_ARCTIC_BREATH
Yells
uint32 GetTickNumber() const
SpellEffectInfo const & GetSpellEffectInfo() const
int32 GetAmount() const
void PreventDefaultAction()
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
HookList< EffectApplyHandler > AfterEffectApply
Definition: SpellScript.h:2028
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:2057
Unit * GetCaster() const
AuraEffect * GetEffect(uint8 effIndex) const
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:2024
InstanceScript *const instance
void JustSummoned(Creature *summon) override
virtual void ExecuteEvent(uint32)
SummonList summons
EventMap events
virtual void ScheduleTasks()
void DoZoneInCombat()
Definition: CreatureAI.h:161
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
void SetBoundary(CreatureBoundary const *boundary, bool negativeBoundaries=false)
Definition: CreatureAI.cpp:446
Creature *const me
Definition: CreatureAI.h:61
void SetCombatPulseDelay(uint32 delay)
Definition: Creature.h:345
void SetCanMelee(bool canMelee, bool fleeFromMelee=false)
Definition: Creature.cpp:2822
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void SetReactState(ReactStates st)
Definition: Creature.h:160
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
void SetTarget(ObjectGuid const &guid) override
Definition: Creature.cpp:3419
void SetDisplayId(uint32 displayId, bool setNative=false) override
Definition: Creature.cpp:3402
CreatureAI * AI() const
Definition: Creature.h:214
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void DelayEvents(Milliseconds delay)
Definition: EventMap.cpp:96
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
bool IsInPhase(uint8 phase) const
Definition: EventMap.h:217
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:131
void SetPhase(uint8 phase)
Definition: EventMap.cpp:28
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:52
void Reset()
Definition: EventMap.cpp:21
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
void DoCloseDoorOrButton(ObjectGuid guid)
Creature * GetCreature(uint32 type)
virtual ObjectGuid GetGuidData(uint32 type) const override
void DoUseDoorOrButton(ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
CreatureBoundary const * GetBossBoundary(uint32 id) const
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
Definition: model.h:33
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=EVENT_JUMP, bool hasOrientation=false, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
void MoveChase(Unit *target, Optional< ChaseRange > dist={}, Optional< ChaseAngle > angle={})
void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
void Clear()
Definition: ObjectGuid.h:286
static Creature * ToCreature(Object *o)
Definition: Object.h:219
bool IsInWorld() const
Definition: Object.h:154
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
bool operator()(Unit *unit) const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:495
uint32 TriggerSpell
Definition: SpellInfo.h:237
uint32 const Id
Definition: SpellInfo.h:325
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition: SpellInfo.h:577
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
Definition: SpellScript.h:173
Unit * GetCaster() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
void Summon(Creature const *summon)
virtual void DoAction(int32)
Definition: UnitAI.h:72
void AttackStartCaster(Unit *victim, float dist)
Definition: UnitAI.cpp:55
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
virtual bool CanAIAttack(Unit const *) const
Definition: UnitAI.h:57
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
void EnterVehicle(Unit *base, int8 seatId=-1)
Definition: Unit.cpp:12118
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3812
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:10911
float GetCollisionHeight() const override
Definition: Unit.cpp:13733
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:8361
Unit * GetVehicleBase() const
Definition: Unit.cpp:11480
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
bool IsAlive() const
Definition: Unit.h:1164
UnitAI * GetAI() const
Definition: Unit.h:660
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
bool IsAIEnabled() const
Definition: Unit.h:658
Unit * GetVictim() const
Definition: Unit.h:715
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.cpp:8525
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
Definition: Unit.cpp:1598
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:833
Vehicle * GetVehicleKit() const
Definition: Unit.h:1711
bool AttackStop()
Definition: Unit.cpp:5781
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:834
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition: Vehicle.cpp:291
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
void setActive(bool isActiveObject)
Definition: Object.cpp:922
EventProcessor m_Events
Definition: Object.h:777
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:91
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnPeriodic(AuraEffect const *)
bool Validate(SpellInfo const *spellInfo) override
void HandleSpeed(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void CheckTargets(std::list< WorldObject * > &targets)
void HandleScriptEffect(SpellEffIndex effIndex)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
void CalculateAmount(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
void OnApply(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void PeriodicTick(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void apply(T *val)
Definition: ByteConverter.h:41
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:474
bool IsHeroic() const
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
void SetCombatMovement(bool allowMovement)
void Reset() override
boss_acidmaw(Creature *creature)
void MovementInform(uint32 type, uint32 pointId) override
boss_dreadscale(Creature *creature)
void PassengerBoarded(Unit *who, int8 seatId, bool apply) override
== Fields =======================================
void MovementInform(uint32 type, uint32 pointId) override
void ScheduleTasks() override
void ExecuteEvent(uint32 eventId) override
boss_gormok(Creature *creature)
void DoAction(int32 action) override
void MovementInform(uint32 type, uint32 pointId) override
void ExecuteEvent(uint32 eventId) override
boss_icehowl(Creature *creature)
void ScheduleTasks() override
void JustSummoned(Creature *summoned) override
void JustDied(Unit *) override
void ExecuteEvent(uint32 eventId) override
void ScheduleTasks() override
uint32 GetOtherWormData(uint32 wormEntry)
boss_jormungarAI(Creature *creature, uint32 bossId)
void DoAction(int32 action) override
void UpdateAI(uint32 diff) override
void EnterEvadeMode(EvadeReason why) override
void JustEngagedWith(Unit *) override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
boss_northrend_beastsAI(Creature *creature, uint32 bossId)
void UpdateAI(uint32 diff) override
void DoAction(int32 action) override
npc_beasts_combat_stalker(Creature *creature)
void Reset() override
npc_fire_bomb(Creature *creature)
npc_jormungars_slime_pool(Creature *creature)
void SetGUID(ObjectGuid const &guid, int32 id) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
void DoAction(int32 action) override
void JustDied(Unit *) override
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
npc_snobold_vassal(Creature *creature)
bool CanAIAttack(Unit const *who) const override
@ DATA_MAIN_GATE
constexpr Position ToCCommonLoc[]
@ NPC_SNOBOLD_VASSAL
@ NPC_DREADSCALE
@ NPC_BEASTS_COMBAT_STALKER
@ ACTION_START_JORMUNGARS
@ ACTION_START_ICEHOWL
@ DATA_DESPAWN_SNOBOLDS
@ DATA_DREADSCALE
@ DATA_GORMOK_THE_IMPALER
@ DATA_NORTHREND_BEASTS
@ DATA_ACIDMAW
@ DATA_ICEHOWL
@ DATA_FORDRING
@ TYPE_NORTHREND_BEASTS
@ DATA_SNOBOLD_COUNT
@ DATA_BEASTS_COMBAT_STALKER
@ DATA_FURIOUS_CHARGE
#define RegisterTrialOfTheCrusaderCreatureAI(ai_name)
@ GORMOK_IN_PROGRESS
@ SNAKES_SPECIAL
@ ICEHOWL_IN_PROGRESS
@ SNAKES_IN_PROGRESS
@ ICEHOWL_DONE