TrinityCore
boss_sindragosa.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 "icecrown_citadel.h"
19#include "Containers.h"
20#include "DB2Stores.h"
21#include "GridNotifiers.h"
22#include "InstanceScript.h"
23#include "Map.h"
24#include "MotionMaster.h"
25#include "ObjectAccessor.h"
26#include "ObjectMgr.h"
27#include "ScriptedCreature.h"
28#include "ScriptMgr.h"
29#include "Spell.h"
30#include "SpellAuraEffects.h"
31#include "SpellAuras.h"
32#include "SpellInfo.h"
33#include "SpellScript.h"
34#include "TemporarySummon.h"
35
37{
38 SAY_AGGRO = 0, // You are fools to have come to this place! The icy winds of Northrend will consume your souls!
39 SAY_UNCHAINED_MAGIC = 1, // Suffer, mortals, as your pathetic magic betrays you!
40 EMOTE_WARN_BLISTERING_COLD = 2, // %s prepares to unleash a wave of blistering cold!
41 SAY_BLISTERING_COLD = 3, // Can you feel the cold hand of death upon your heart?
42 SAY_RESPITE_FOR_A_TORMENTED_SOUL = 4, // Aaah! It burns! What sorcery is this?!
43 SAY_AIR_PHASE = 5, // Your incursion ends here! None shall survive!
44 SAY_PHASE_2 = 6, // Now feel my master's limitless power and despair!
45 EMOTE_WARN_FROZEN_ORB = 7, // %s fires a frozen orb towards $N!
46 SAY_KILL = 8, // Perish!
47 // A flaw of mortality...
48 SAY_BERSERK = 9, // Enough! I tire of these games!
49 SAY_DEATH = 10, // Free...at last...
51};
52
54{
55 // Sindragosa
60 SPELL_CLEAVE = 19983,
80
81 // Spinestalker
85
86 // Rimefang
91
92 // Frostwarden Handler
96
97 // Frost Infusion
101};
102
104{
105 // Sindragosa
122
123 // Spinestalker
127
128 // Rimefang
132
133 // Trash
136
137 // event groups
139};
140
142{
150
152{
160};
161
163{
166
167Position const RimefangFlyPos = {4413.309f, 2456.421f, 233.3795f, 2.890186f};
168Position const RimefangLandPos = {4413.309f, 2456.421f, 203.3848f, 2.890186f};
169Position const SpinestalkerFlyPos = {4418.895f, 2514.233f, 230.4864f, 3.396045f};
170Position const SpinestalkerLandPos = {4418.895f, 2514.233f, 203.3848f, 3.396045f};
171Position const SindragosaSpawnPos = {4818.700f, 2483.710f, 287.0650f, 3.089233f};
172Position const SindragosaFlyPos = {4475.190f, 2484.570f, 234.8510f, 3.141593f};
173Position const SindragosaLandPos = {4419.190f, 2484.570f, 203.3848f, 3.141593f};
174Position const SindragosaAirPos = {4475.990f, 2484.430f, 247.9340f, 3.141593f};
175Position const SindragosaAirPosFar = {4525.600f, 2485.150f, 245.0820f, 3.141593f};
176Position const SindragosaFlyInPos = {4419.190f, 2484.360f, 232.5150f, 3.141593f};
177
179{
180 public:
181 FrostwyrmLandEvent(Creature& owner, Position const& dest) : _owner(owner), _dest(dest) { }
182
183 bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
184 {
186 return true;
187 }
188
189 private:
192};
193
195{
196 public:
197 FrostBombExplosion(Creature* owner, ObjectGuid sindragosaGUID) : _owner(owner), _sindragosaGUID(sindragosaGUID) { }
198
199 bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override
200 {
201 _owner->CastSpell(nullptr, SPELL_FROST_BOMB, CastSpellExtraArgs().SetOriginalCaster(_sindragosaGUID));
203 return true;
204 }
205
206 private:
209};
210
212{
213 public:
214 FrostBeaconSelector(Unit* source) : NonTankTargetSelector(source, true) { }
215
216 bool operator()(WorldObject* target) const
217 {
218 if (Unit* unitTarget = target->ToUnit())
219 return !NonTankTargetSelector::operator()(unitTarget) ||
220 unitTarget->HasAura(SPELL_ICE_TOMB_UNTARGETABLE);
221
222 return false;
223 }
224};
225
226struct boss_sindragosa : public BossAI
227{
229 {
230 Initialize();
231 }
232
234 {
236 _isInAirPhase = false;
237 _isThirdPhase = false;
238 }
239
240 void Reset() override
241 {
251 Initialize();
252
254 {
255 me->SetCanFly(true);
256 me->SetDisableGravity(true);
257 }
258 }
259
260 void JustDied(Unit* /* killer */) override
261 {
262 _JustDied();
264
267
268 }
269
270 void JustEngagedWith(Unit* victim) override
271 {
273 {
276 return;
277 }
278
284 me->setActive(true);
285 me->SetFarVisible(true);
287 }
288
289 void EnterEvadeMode(EvadeReason why) override
290 {
292 return;
294 }
295
296 void JustReachedHome() override
297 {
300 me->SetCanFly(false);
301 me->SetDisableGravity(false);
303 }
304
305 void KilledUnit(Unit* victim) override
306 {
307 if (victim->GetTypeId() == TYPEID_PLAYER)
308 Talk(SAY_KILL);
309 }
310
311 void DoAction(int32 action) override
312 {
313 if (action == ACTION_START_FROSTWYRM)
314 {
315
317 if (TempSummon* summon = me->ToTempSummon())
318 summon->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN);
319
320 if (me->isDead())
321 return;
322
323 me->setActive(true);
324 me->SetFarVisible(true);
325 me->SetCanFly(true);
326 me->SetDisableGravity(true);
333 }
334 }
335
336 uint32 GetData(uint32 type) const override
337 {
338 switch (type)
339 {
341 return _mysticBuffetStack;
343 return _isThirdPhase;
344 default:
345 return 0xFFFFFFFF;
346 }
347 }
348
349 void MovementInform(uint32 type, uint32 point) override
350 {
351 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
352 return;
353
354 switch (point)
355 {
357 me->setActive(false);
358 me->SetFarVisible(false);
359 me->SetCanFly(false);
360 me->SetDisableGravity(false);
364
365 // Sindragosa enters combat as soon as she lands
367 break;
368 case POINT_TAKEOFF:
370 break;
371 case POINT_AIR_PHASE:
372 {
374 args.AddSpellMod(SPELLVALUE_MAX_TARGETS, RAID_MODE<int32>(2, 5, 2, 6));
375 me->CastSpell(nullptr, SPELL_ICE_TOMB_TARGET, args);
376 me->SetFacingTo(float(M_PI), true);
379 break;
380 }
382 me->SetFacingTo(float(M_PI), true);
384 break;
385 case POINT_LAND:
387 break;
389 {
390 me->SetCanFly(false);
391 me->SetDisableGravity(false);
393
394 _isInAirPhase = false;
395 // trigger Asphyxiation
398 break;
399 }
400 default:
401 break;
402 }
403 }
404
405 void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
406 {
407 if (!_isThirdPhase && !HealthAbovePct(35))
408 {
411 _isThirdPhase = true;
412 }
413 }
414
415 void JustSummoned(Creature* summon) override
416 {
417 summons.Summon(summon);
418 if (summon->GetEntry() == NPC_FROST_BOMB)
419 {
420 summon->CastSpell(summon, SPELL_FROST_BOMB_VISUAL, true);
421 summon->CastSpell(summon, SPELL_BIRTH_NO_VISUAL, true);
422 summon->m_Events.AddEvent(new FrostBombExplosion(summon, me->GetGUID()), summon->m_Events.CalculateTime(5500ms));
423 }
424 }
425
426 void SummonedCreatureDespawn(Creature* summon) override
427 {
429 if (summon->GetEntry() == NPC_ICE_TOMB)
430 summon->AI()->JustDied(summon);
431 }
432
433 void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
434 {
435 Unit* unitTarget = target->ToUnit();
436 if (!unitTarget)
437 return;
438
439 if (70127 == spellInfo->Id)
440 if (Aura const* mysticBuffet = unitTarget->GetAura(spellInfo->Id))
441 _mysticBuffetStack = std::max<uint8>(_mysticBuffetStack, mysticBuffet->GetStackAmount());
442 }
443
444 void UpdateAI(uint32 diff) override
445 {
446 if (!UpdateVictim())
447 return;
448
449 events.Update(diff);
450
452 return;
453
454 while (uint32 eventId = events.ExecuteEvent())
455 {
456 switch (eventId)
457 {
458 case EVENT_BERSERK:
462 break;
463 case EVENT_CLEAVE:
466 break;
467 case EVENT_TAIL_SMASH:
470 break;
474 break;
479 break;
480 case EVENT_ICY_GRIP:
483 break;
488 break;
491 break;
492 case EVENT_AIR_PHASE:
493 {
494 _isInAirPhase = true;
496 me->SetCanFly(true);
497 me->SetDisableGravity(true);
499 me->AttackStop();
500 Position pos;
501 pos.Relocate(me);
502 pos.m_positionZ += 17.0f;
506 break;
507 }
510 break;
513 break;
514 case EVENT_ICE_TOMB:
515 {
518 me->CastSpell(nullptr, SPELL_ICE_TOMB_TARGET, args);
520 break;
521 }
522 case EVENT_FROST_BOMB:
523 {
524 float destX, destY, destZ;
525 destX = rand_norm() * 75.0f + 4350.0f;
526 destY = rand_norm() * 75.0f + 2450.0f;
527 destZ = 205.0f; // random number close to ground, get exact in next call
528 me->UpdateGroundPositionZ(destX, destY, destZ);
529 me->CastSpell(Position{ destX, destY, destZ }, SPELL_FROST_BOMB_TRIGGER, false);
531 break;
532 }
533 case EVENT_LAND:
534 {
537 break;
538 }
546 break;
548 {
549 if (!_isInAirPhase)
550 {
555 }
556 else
558 break;
559 }
560 default:
561 break;
562 }
563
565 return;
566 }
567 }
568
569private:
573};
574
576{
577 npc_ice_tomb(Creature* creature) : ScriptedAI(creature)
578 {
580 SetCombatMovement(false);
581 }
582
583 void Reset() override
584 {
586 }
587
588 void SetGUID(ObjectGuid const& guid, int32 id) override
589 {
590 if (id == DATA_TRAPPED_PLAYER)
591 {
592 _trappedPlayerGUID = guid;
594 }
595 }
596
597 void DoAction(int32 action) override
598 {
599 if (action == ACTION_TRIGGER_ASPHYXIATION)
601 player->CastSpell(player, SPELL_ASPHYXIATION, true);
602 }
603
604 void JustDied(Unit* /*killer*/) override
605 {
607
609 {
611 player->RemoveAurasDueToSpell(SPELL_ICE_TOMB_DAMAGE);
612 player->RemoveAurasDueToSpell(SPELL_ASPHYXIATION);
613 player->RemoveAurasDueToSpell(SPELL_ICE_TOMB_UNTARGETABLE);
614 }
615 }
616
617 void UpdateAI(uint32 diff) override
618 {
620 return;
621
622 if (_existenceCheckTimer <= diff)
623 {
625 if (!player || player->isDead() || !player->HasAura(SPELL_ICE_TOMB_DAMAGE))
626 {
627 // Remove object
628 JustDied(me);
630 return;
631 }
633 }
634 else
635 _existenceCheckTimer -= diff;
636 }
637
638private:
641};
642
644{
645 npc_spinestalker(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { }
646
647 void InitializeAI() override
648 {
649 // Increase add count
650 if (!me->isDead())
651 {
652 _instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid::Create<HighGuid::Creature>(631, me->GetEntry(), me->GetSpawnId())); // this cannot be in Reset because reset also happens on evade
653 Reset();
654 }
655 }
656
657 void Reset() override
658 {
659 _events.Reset();
663
664 if (!_summoned)
665 {
666 me->SetCanFly(true);
667 me->SetDisableGravity(true);
668 }
669 }
670
671 void JustAppeared() override
672 {
674 _instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid::Create<HighGuid::Creature>(631, me->GetEntry(), me->GetSpawnId())); // this cannot be in Reset because reset also happens on evade
675 }
676
677 void JustDied(Unit* /*killer*/) override
678 {
679 _events.Reset();
680 }
681
682 void DoAction(int32 action) override
683 {
684 if (action == ACTION_START_FROSTWYRM)
685 {
686 if (_summoned)
687 return;
688
689 _summoned = true;
690 if (me->isDead())
691 return;
692
693 me->setActive(true);
694 me->SetFarVisible(true);
701 me->StopMoving();
704 }
705 }
706
707 void MovementInform(uint32 type, uint32 point) override
708 {
709 if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
710 return;
711
712 me->setActive(false);
713 me->SetFarVisible(false);
714 me->SetCanFly(false);
715 me->SetDisableGravity(false);
720 }
721
722 void UpdateAI(uint32 diff) override
723 {
724 if (!UpdateVictim())
725 return;
726
727 _events.Update(diff);
728
730 return;
731
732 while (uint32 eventId = _events.ExecuteEvent())
733 {
734 switch (eventId)
735 {
739 break;
743 break;
744 case EVENT_TAIL_SWEEP:
747 break;
748 default:
749 break;
750 }
751 }
752 }
753
754private:
758};
759
761{
762 npc_rimefang_icc(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false)
763 {
764 Initialize();
765 }
766
768 {
770 }
771
772 void InitializeAI() override
773 {
774 // Increase add count
775 if (!me->isDead())
776 {
777 _instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid::Create<HighGuid::Creature>(631, me->GetEntry(), me->GetSpawnId())); // this cannot be in Reset because reset also happens on evade
778 Reset();
779 }
780 }
781
782 void Reset() override
783 {
784 _events.Reset();
787 Initialize();
788
789 if (!_summoned)
790 {
791 me->SetCanFly(true);
792 me->SetDisableGravity(true);
793 }
794 }
795
796 void JustAppeared() override
797 {
799 _instance->SetGuidData(DATA_SINDRAGOSA_FROSTWYRMS, ObjectGuid::Create<HighGuid::Creature>(631, me->GetEntry(), me->GetSpawnId())); // this cannot be in Reset because reset also happens on evade
800 }
801
802 void JustDied(Unit* /*killer*/) override
803 {
804 _events.Reset();
805 }
806
807 void DoAction(int32 action) override
808 {
809 if (action == ACTION_START_FROSTWYRM)
810 {
811 if (_summoned)
812 return;
813
814 _summoned = true;
815 if (me->isDead())
816 return;
817
818 me->setActive(true);
819 me->SetFarVisible(true);
821 me->SetImmuneToPC(true);
826 me->StopMoving();
829 }
830 }
831
832 void MovementInform(uint32 type, uint32 point) override
833 {
834 if (type != EFFECT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
835 return;
836
837 me->setActive(false);
838 me->SetFarVisible(false);
839 me->SetCanFly(false);
840 me->SetDisableGravity(false);
843 me->SetImmuneToPC(false);
845 }
846
847 void JustEngagedWith(Unit* /*victim*/) override
848 {
850 }
851
852 void UpdateAI(uint32 diff) override
853 {
854 if (!UpdateVictim())
855 return;
856
857 _events.Update(diff);
858
860 return;
861
862 while (uint32 eventId = _events.ExecuteEvent())
863 {
864 switch (eventId)
865 {
869 break;
870 case EVENT_ICY_BLAST:
871 {
872 _icyBlastCounter = RAID_MODE<uint8>(5, 7, 6, 8);
874 me->AttackStop();
875 me->SetCanFly(true);
878 _events.ScheduleEvent(EVENT_ICY_BLAST, moveTime + 60s, moveTime + 70s);
879 _events.ScheduleEvent(EVENT_ICY_BLAST_CAST, moveTime + 250ms);
880 break;
881 }
883 if (--_icyBlastCounter)
884 {
885 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
886 {
887 me->SetFacingToObject(target);
888 DoCast(target, SPELL_ICY_BLAST);
889 }
891 }
892 else if (Unit* victim = me->SelectVictim())
893 {
895 AttackStart(victim);
896 me->SetCanFly(false);
897 }
898 break;
899 default:
900 break;
901 }
902 }
903 }
904
905private:
910};
911
913{
915 {
916 Initialize();
917 _instance = creature->GetInstanceScript();
918 _frostwyrmId = 0;
919 }
920
922 {
923 _isTaunted = false;
924 }
925
926 void InitializeAI() override
927 {
928 _frostwyrmId = (me->GetHomePosition().GetPositionY() < 2484.35f) ? DATA_RIMEFANG : DATA_SPINESTALKER;
929 // Increase add count
930 if (!me->isDead())
931 {
933 _instance->SetGuidData(_frostwyrmId, ObjectGuid::Create<HighGuid::Creature>(631, me->GetEntry(), me->GetSpawnId())); // this cannot be in Reset because reset also happens on evade
934 Reset();
935 }
936 }
937
938 void Reset() override
939 {
940 // This is shared AI for handler and whelps
942 {
945 }
946
947 Initialize();
948 }
949
950 void JustAppeared() override
951 {
953
954 // Increase add count
956 _instance->SetGuidData(_frostwyrmId, ObjectGuid::Create<HighGuid::Creature>(631, me->GetEntry(), me->GetSpawnId())); // this cannot be in Reset because reset also happens on evade
957 }
958
959 void SetData(uint32 type, uint32 data) override
960 {
961 if (type == DATA_WHELP_MARKER)
962 _isTaunted = data != 0;
963 }
964
965 uint32 GetData(uint32 type) const override
966 {
967 if (type == DATA_FROSTWYRM_OWNER)
968 return _frostwyrmId;
969 else if (type == DATA_WHELP_MARKER)
970 return uint32(_isTaunted);
971 return 0;
972 }
973
974 void UpdateAI(uint32 diff) override
975 {
976 if (!UpdateVictim())
977 return;
978
979 _events.Update(diff);
980
982 return;
983
984 while (uint32 eventId = _events.ExecuteEvent())
985 {
986 switch (eventId)
987 {
991 break;
995 break;
996 default:
997 break;
998 }
999 }
1000 }
1001
1002private:
1006 bool _isTaunted; // Frostwing Whelp only
1007};
1008
1009// 70598 - Sindragosa's Fury
1011{
1012 bool Load() override
1013 {
1014 // This script should execute only in Icecrown Citadel
1016 }
1017
1019 {
1020 if (WorldLocation const* dest = GetExplTargetDest())
1021 {
1022 float destX = rand_norm() * 75.0f + 4350.0f;
1023 float destY = rand_norm() * 75.0f + 2450.0f;
1024 float destZ = 205.0f; // random number close to ground, get exact in next call
1025 GetCaster()->UpdateGroundPositionZ(destX, destY, destZ);
1026 SetExplTargetDest(WorldLocation(dest->GetMapId(), destX, destY, destZ));
1027 }
1028 }
1029
1030 void FilterTargets(std::list<WorldObject*>& targets)
1031 {
1032 targets.remove_if([](WorldObject* obj) -> bool
1033 {
1034 // remove GMs
1035 if (Player* player = obj->ToPlayer())
1036 return player->IsGameMaster();
1037
1038 // remove non-players too
1039 return true;
1040 });
1041
1042 _targetCount = targets.size();
1043 }
1044
1046 {
1047 PreventHitDefaultEffect(effIndex);
1048
1049 if (!GetHitUnit()->IsAlive() || !_targetCount)
1050 return;
1051
1052 if (GetHitUnit()->IsImmunedToDamage(GetSpellInfo(), &GetEffectInfo()))
1053 {
1055 return;
1056 }
1057
1058 float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask)));
1059 uint32 minResistFactor = uint32((resistance / (resistance + 510.0f)) * 10.0f) * 2;
1060 uint32 randomResist = urand(0, (9 - minResistFactor) * 100) / 100 + minResistFactor;
1061
1062 uint32 damage = (uint32(GetEffectValue() / _targetCount) * randomResist) / 10;
1063
1064 SpellNonMeleeDamage damageInfo(GetCaster(), GetHitUnit(), GetSpellInfo(), GetSpell()->m_SpellVisual, GetSpellInfo()->SchoolMask);
1065 damageInfo.damage = damage;
1066 GetCaster()->DealSpellDamage(&damageInfo, false);
1067 GetCaster()->SendSpellNonMeleeDamageLog(&damageInfo);
1068 }
1069
1070 void Register() override
1071 {
1075 }
1076
1078};
1079
1080// 69762 - Unchained Magic
1082{
1083 void FilterTargets(std::list<WorldObject*>& targets)
1084 {
1085 std::vector<WorldObject*> healers;
1086 std::vector<WorldObject*> casters;
1087 for (WorldObject* target : targets)
1088 {
1089 Player* player = target->ToPlayer();
1090 if (!player)
1091 continue;
1092
1093 ChrSpecializationEntry const* specialization = player->GetPrimarySpecializationEntry();
1094 if (!specialization)
1095 continue;
1096
1097 if (specialization->GetRole() == ChrSpecializationRole::Healer)
1098 {
1099 healers.push_back(target);
1100 continue;
1101 }
1102
1103 if (specialization->GetFlags().HasFlag(ChrSpecializationFlag::Caster))
1104 casters.push_back(target);
1105 }
1106
1107 targets.clear();
1108
1109 bool const is25ManRaid = GetCaster()->GetMap()->Is25ManRaid();
1110 if (!healers.empty())
1111 {
1112 Trinity::Containers::RandomResize(healers, size_t(is25ManRaid ? 3 : 1));
1113 while (!healers.empty())
1114 {
1115 targets.push_back(healers.back());
1116 healers.pop_back();
1117 }
1118 }
1119 if (!casters.empty())
1120 {
1122 size_t const maxSize = is25ManRaid ? 6 : 2;
1123 while (!casters.empty() && targets.size() < maxSize)
1124 {
1125 targets.push_back(casters.back());
1126 casters.pop_back();
1127 }
1128 }
1129 }
1130
1131 void Register() override
1132 {
1134 }
1135};
1136
1137// 69649, 71056, 71057, 71058 - Frost Breath
1138// 73061, 73062, 73063, 73064 - Frost Breath
1140{
1142 {
1143 Player* target = GetHitPlayer();
1144 if (!target)
1145 return;
1146
1147 // Check difficulty and quest status
1149 return;
1150
1151 // Check if player has Shadow's Edge equipped and not ready for infusion
1153 return;
1154
1155 Aura* infusion = target->GetAura(SPELL_FROST_INFUSION, target->GetGUID());
1156 if (infusion && infusion->GetStackAmount() >= 3)
1157 {
1158 target->RemoveAura(infusion);
1160 }
1161 else
1163 }
1164
1165 void Register() override
1166 {
1168 }
1169};
1170
1171// 69766 - Instability
1173{
1174 bool Validate(SpellInfo const* /*spell*/) override
1175 {
1177 }
1178
1179 void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
1180 {
1181 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
1182 {
1183 CastSpellExtraArgs args(aurEff);
1185 args.AddSpellBP0(aurEff->GetAmount());
1187 }
1188 }
1189
1190 void Register() override
1191 {
1193 }
1194};
1195
1196// 70126 - Frost Beacon
1198{
1199 bool Validate(SpellInfo const* /*spell*/) override
1200 {
1202 }
1203
1204 void PeriodicTick(AuraEffect const* /*aurEff*/)
1205 {
1207 if (Unit* caster = GetCaster())
1208 caster->CastSpell(GetTarget(), SPELL_ICE_TOMB_DAMAGE, true);
1209 }
1210
1211 void Register() override
1212 {
1214 }
1215};
1216
1217// 70157 - Ice Tomb (Trap)
1219{
1220 bool Validate(SpellInfo const* /*spell*/) override
1221 {
1222 if (!sObjectMgr->GetCreatureTemplate(NPC_ICE_TOMB))
1223 return false;
1224 if (!sObjectMgr->GetGameObjectTemplate(GO_ICE_BLOCK))
1225 return false;
1226 return true;
1227 }
1228
1229 void PeriodicTick(AuraEffect const* aurEff)
1230 {
1232
1233 if (aurEff->GetTickNumber() == 1)
1234 {
1235 if (Unit* caster = GetCaster())
1236 {
1237 Position pos = GetTarget()->GetPosition();
1238
1239 if (TempSummon* summon = caster->SummonCreature(NPC_ICE_TOMB, pos))
1240 {
1241 summon->AI()->SetGUID(GetTarget()->GetGUID(), DATA_TRAPPED_PLAYER);
1243 if (GameObject* go = summon->SummonGameObject(GO_ICE_BLOCK, pos, QuaternionData::fromEulerAnglesZYX(pos.GetOrientation(), 0.0f, 0.0f), 0s))
1244 {
1245 go->SetSpellId(SPELL_ICE_TOMB_DAMAGE);
1246 summon->AddGameObject(go);
1247 }
1248 }
1249 }
1250 }
1251 }
1252
1253 void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1254 {
1256 }
1257
1258 void Register() override
1259 {
1262 }
1263};
1264
1265// 70117 - Icy Grip
1267{
1268 bool Validate(SpellInfo const* /*spell*/) override
1269 {
1271 }
1272
1274 {
1275 PreventHitDefaultEffect(effIndex);
1277 }
1278
1279 void Register() override
1280 {
1282 }
1283};
1284
1286{
1287 public:
1288 explicit MysticBuffetTargetFilter(Unit* caster) : _caster(caster) { }
1289
1290 bool operator()(WorldObject* unit) const
1291 {
1292 return !unit->IsWithinLOSInMap(_caster);
1293 }
1294
1295 private:
1297};
1298
1299// 70127, 72528, 72529, 72530 - Mystic Buffet
1301{
1302 void FilterTargets(std::list<WorldObject*>& targets)
1303 {
1304 targets.remove_if(MysticBuffetTargetFilter(GetCaster()));
1305 }
1306
1307 void Register() override
1308 {
1310 }
1311};
1312
1313// 71376 - Icy Blast
1315{
1316 bool Validate(SpellInfo const* /*spell*/) override
1317 {
1319 }
1320
1322 {
1323 PreventHitDefaultEffect(effIndex);
1324 if (Position const* pos = GetExplTargetDest())
1325 if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICY_BLAST, *pos, TEMPSUMMON_TIMED_DESPAWN, 40s))
1326 summon->CastSpell(summon, SPELL_ICY_BLAST_AREA, true);
1327 }
1328
1329 void Register() override
1330 {
1332 }
1333};
1334
1336{
1337 public:
1338 explicit OrderWhelpTargetSelector(Creature* owner) : _owner(owner) { }
1339
1340 bool operator()(Creature* creature)
1341 {
1342 if (!creature->AI()->GetData(DATA_WHELP_MARKER) && creature->AI()->GetData(DATA_FROSTWYRM_OWNER) == _owner->AI()->GetData(DATA_FROSTWYRM_OWNER))
1343 return false;
1344 return true;
1345 }
1346
1347 private:
1349};
1350
1351// 71357 - Order Whelp
1353{
1354 bool Validate(SpellInfo const* /*spell*/) override
1355 {
1357 }
1358
1359 void FilterTargets(std::list<WorldObject*>& targets)
1360 {
1361 targets.remove_if(Trinity::ObjectTypeIdCheck(TYPEID_PLAYER, false));
1362 if (targets.empty())
1363 return;
1364
1366 targets.clear();
1367 targets.push_back(target);
1368 }
1369
1371 {
1372 // caster is Frostwarden Handler, target is player, caster of triggered is whelp
1373 PreventHitDefaultEffect(effIndex);
1374 std::list<Creature*> unitList;
1376 if (Creature* creature = GetCaster()->ToCreature())
1377 unitList.remove_if(OrderWhelpTargetSelector(creature));
1378
1379 if (unitList.empty())
1380 return;
1381
1383 }
1384
1385 void Register() override
1386 {
1389 }
1390};
1391
1392// 71350 - Focus Fire
1394{
1396 {
1397 PreventHitDefaultEffect(effIndex);
1400 }
1401
1402 void Register() override
1403 {
1405 }
1406};
1407
1409{
1410 bool Validate(SpellInfo const* spellInfo) override
1411 {
1412 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } });
1413 }
1414
1415 void PeriodicTick(AuraEffect const* /*aurEff*/)
1416 {
1418 if (Unit* caster = GetCaster())
1419 {
1420 caster->GetThreatManager().AddThreat(GetTarget(), -float(GetEffectInfo(EFFECT_1).CalcValue()), GetSpellInfo(), true, true);
1421 caster->GetAI()->SetData(DATA_WHELP_MARKER, 0);
1422 }
1423 }
1424
1425 void Register() override
1426 {
1428 }
1429};
1430
1431// 69712 - Ice Tomb (Target)
1433{
1434 void FilterTargets(std::list<WorldObject*>& unitList)
1435 {
1436 Unit* caster = GetCaster();
1437 unitList.remove_if(FrostBeaconSelector(caster));
1438 }
1439
1441 {
1442 if (Creature* creatureCaster = GetCaster()->ToCreature())
1443 if (creatureCaster->GetAI()->GetData(DATA_IS_THIRD_PHASE))
1444 creatureCaster->AI()->Talk(EMOTE_WARN_FROZEN_ORB, GetHitUnit());
1445 }
1446
1447 void Register() override
1448 {
1451 }
1452};
1453
1455{
1456 public:
1457 at_sindragosa_lair() : AreaTriggerScript("at_sindragosa_lair") { }
1458
1459 bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
1460 {
1461 if (InstanceScript* instance = player->GetInstanceScript())
1462 {
1463 if (!instance->GetData(DATA_SPINESTALKER))
1464 if (Creature* spinestalker = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_SPINESTALKER)))
1465 spinestalker->AI()->DoAction(ACTION_START_FROSTWYRM);
1466
1467 if (!instance->GetData(DATA_RIMEFANG))
1468 if (Creature* rimefang = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_RIMEFANG)))
1469 rimefang->AI()->DoAction(ACTION_START_FROSTWYRM);
1470
1471 if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && !instance->GetGuidData(DATA_SINDRAGOSA) && instance->GetBossState(DATA_SINDRAGOSA) != DONE)
1472 {
1474 if (Creature* sindragosa = player->GetMap()->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos))
1475 sindragosa->AI()->DoAction(ACTION_START_FROSTWYRM);
1476 }
1477 }
1478
1479 return true;
1480 }
1481};
1482
1484{
1485 public:
1486 achievement_all_you_can_eat() : AchievementCriteriaScript("achievement_all_you_can_eat") { }
1487
1488 bool OnCheck(Player* /*source*/, Unit* target) override
1489 {
1490 if (!target)
1491 return false;
1492 return target->GetAI()->GetData(DATA_MYSTIC_BUFFET_STACK) <= 5;
1493 }
1494};
1495
1497{
1498 // Creatures
1504
1505 // Spells
1520
1521 // AreaTriggers
1522 new at_sindragosa_lair();
1523
1524 // Achievements
1526}
Texts
#define M_PI
Definition: Common.h:115
TC_GAME_API bool InstanceHasScript(WorldObject const *obj, char const *scriptName)
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
@ IN_PROGRESS
@ FAIL
@ DONE
@ IDLE_MOTION_TYPE
@ POINT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
@ TEMPSUMMON_DEAD_DESPAWN
Definition: ObjectDefines.h:69
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
#define sObjectMgr
Definition: ObjectMgr.h:1946
Spells
Definition: PlayerAI.cpp:32
@ SPELL_BERSERK
Definition: PlayerAI.cpp:371
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:145
float rand_norm()
Definition: Random.cpp:75
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition: ScriptMgr.h:1371
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition: ScriptMgr.h:1368
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
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_DEST_AREA_ENEMY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ TARGET_UNIT_DEST_AREA_ENTRY
SpellSchoolMask
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_TRIGGER_MISSILE
@ SPELL_EFFECT_FORCE_CAST
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_DUMMY
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ TRIGGERED_IGNORE_SET_FACING
Will not adjust facing to target (if any)
Definition: SpellDefines.h:256
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:230
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define SpellCastFn(F)
Definition: SpellScript.h:825
#define SpellHitFn(F)
Definition: SpellScript.h:854
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2040
EvadeReason
Definition: UnitAICommon.h:30
@ MOVE_FLIGHT
Definition: UnitDefines.h:123
@ REACT_DEFENSIVE
Definition: UnitDefines.h:507
@ REACT_PASSIVE
Definition: UnitDefines.h:506
@ REACT_AGGRESSIVE
Definition: UnitDefines.h:508
DamageEffectType
Definition: UnitDefines.h:131
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
@ UNIT_STATE_CASTING
Definition: Unit.h:270
Position const SindragosaFlyInPos
@ SPELL_FROST_BREATH_P1
@ SPELL_TANK_MARKER
@ SPELL_FROST_BOMB_VISUAL
@ SPELL_CLEAVE
@ SPELL_PERMAEATING_CHILL
@ SPELL_FROST_BOMB_TRIGGER
@ SPELL_CLEAVE_SPINESTALKER
@ SPELL_FROST_BREATH
@ SPELL_UNCHAINED_MAGIC
@ SPELL_BACKLASH
@ SPELL_FROST_INFUSION
@ SPELL_BELLOWING_ROAR
@ SPELL_ICE_TOMB_DAMAGE
@ SPELL_FOCUS_FIRE
@ SPELL_ICE_TOMB_TARGET
@ SPELL_FROST_AURA_RIMEFANG
@ SPELL_ICE_TOMB_UNTARGETABLE
@ SPELL_ORDER_WHELP
@ SPELL_ASPHYXIATION
@ SPELL_FROST_AURA
@ SPELL_FROST_BEACON
@ SPELL_FROST_IMBUED_BLADE
@ SPELL_ICY_BLAST_AREA
@ SPELL_ICY_GRIP_JUMP
@ SPELL_FROST_INFUSION_CREDIT
@ SPELL_TAIL_SMASH
@ SPELL_ICY_BLAST
@ SPELL_FROST_BOMB
@ SPELL_ICE_TOMB_DUMMY
@ SPELL_FROST_BREATH_P2
@ SPELL_CONCUSSIVE_SHOCK
@ SPELL_MYSTIC_BUFFET
@ SPELL_TAIL_SWEEP
@ SPELL_SINDRAGOSA_S_FURY
@ SPELL_BLISTERING_COLD
@ SPELL_BIRTH_NO_VISUAL
@ SPELL_ICY_GRIP
void AddSC_boss_sindragosa()
FrostwingData
@ DATA_LINKED_GAMEOBJECT
@ DATA_MYSTIC_BUFFET_STACK
@ DATA_WHELP_MARKER
@ DATA_FROSTWYRM_OWNER
@ DATA_IS_THIRD_PHASE
@ DATA_TRAPPED_PLAYER
Position const SpinestalkerFlyPos
Position const SpinestalkerLandPos
Position const SindragosaFlyPos
@ POINT_FROSTWYRM_LAND
@ POINT_TAKEOFF
@ POINT_FROSTWYRM_FLY_IN
@ POINT_AIR_PHASE
@ POINT_LAND
@ POINT_LAND_GROUND
@ POINT_AIR_PHASE_FAR
Position const RimefangLandPos
@ SAY_DEATH
@ EMOTE_WARN_FROZEN_ORB
@ EMOTE_BERSERK_RAID
@ SAY_UNCHAINED_MAGIC
@ SAY_AGGRO
@ EMOTE_WARN_BLISTERING_COLD
@ SAY_PHASE_2
@ SAY_KILL
@ SAY_BLISTERING_COLD
@ SAY_AIR_PHASE
@ SAY_BERSERK
@ SAY_RESPITE_FOR_A_TORMENTED_SOUL
@ QUEST_FROST_INFUSION
Position const RimefangFlyPos
Position const SindragosaAirPosFar
Position const SindragosaLandPos
Position const SindragosaSpawnPos
@ EVENT_ICY_BLAST_CAST
@ EVENT_AIR_MOVEMENT
@ EVENT_TAIL_SWEEP
@ EVENT_TAIL_SMASH
@ EVENT_AIR_PHASE
@ EVENT_AIR_MOVEMENT_FAR
@ EVENT_FROST_BREATH
@ EVENT_GROUP_LAND_PHASE
@ EVENT_LAND_GROUND
@ EVENT_FROST_BOMB
@ EVENT_BLISTERING_COLD
@ EVENT_UNCHAINED_MAGIC
@ EVENT_ICE_TOMB
@ EVENT_THIRD_PHASE_CHECK
@ EVENT_BLISTERING_COLD_YELL
@ EVENT_CLEAVE_SPINESTALKER
@ EVENT_CONCUSSIVE_SHOCK
@ EVENT_FROST_BREATH_RIMEFANG
@ EVENT_BERSERK
@ EVENT_BELLOWING_ROAR
@ EVENT_ICY_BLAST
@ EVENT_ICY_GRIP
@ EVENT_FROSTWARDEN_ORDER_WHELP
@ EVENT_CLEAVE
@ EVENT_LAND
Position const SindragosaAirPos
uint32 GetTickNumber() const
int32 GetAmount() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2039
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
SpellInfo const * GetSpellInfo() const
Unit * GetCaster() const
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
Unit * GetTarget() const
ObjectGuid GetCasterGUID() const
uint8 GetStackAmount() const
Definition: SpellAuras.h:189
InstanceScript *const instance
void JustReachedHome() override
SummonList summons
EventMap events
void SummonedCreatureDespawn(Creature *summon) override
void Reset() override
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
virtual void JustDied(Unit *)
Definition: CreatureAI.h:105
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
virtual void JustAppeared()
Definition: CreatureAI.cpp:194
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetCombatPulseDelay(uint32 delay)
Definition: Creature.h:345
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:373
void SetReactState(ReactStates st)
Definition: Creature.h:160
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:98
Unit * SelectVictim()
Definition: Creature.cpp:1211
CreatureAI * AI() const
Definition: Creature.h:214
void SetDefaultMovementType(MovementGeneratorType mgt)
Definition: Creature.h:150
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void CancelEventGroup(uint32 group)
Definition: EventMap.cpp:153
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:131
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:52
void Reset()
Definition: EventMap.cpp:21
void AddEvent(BasicEvent *event, Milliseconds e_time, bool set_addtime=true)
Milliseconds CalculateTime(Milliseconds t_offset) const
bool operator()(WorldObject *target) const
FrostBeaconSelector(Unit *source)
bool Execute(uint64, uint32) override
FrostBombExplosion(Creature *owner, ObjectGuid sindragosaGUID)
bool Execute(uint64, uint32) override
FrostwyrmLandEvent(Creature &owner, Position const &dest)
Position const & _dest
virtual bool SetBossState(uint32 id, EncounterState state)
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
void LoadGrid(float x, float y)
Definition: Map.cpp:405
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, Milliseconds duration=0ms, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty, SmoothPhasingInfo const *smoothPhasingInfo=nullptr)
Definition: Object.cpp:1836
bool Is25ManRaid() const
Definition: Map.cpp:3320
void MoveTakeoff(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveLand(uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
MysticBuffetTargetFilter(Unit *caster)
bool operator()(WorldObject *unit) const
void Clear()
Definition: ObjectGuid.h:286
static Unit * ToUnit(Object *o)
Definition: Object.h:225
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
static Player * ToPlayer(Object *o)
Definition: Object.h:213
OrderWhelpTargetSelector(Creature *owner)
bool operator()(Creature *creature)
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: Player.cpp:16050
ChrSpecializationEntry const * GetPrimarySpecializationEntry() const
Definition: Player.cpp:29827
uint32 const Id
Definition: SpellInfo.h:325
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
Player * GetHitPlayer() const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Definition: SpellScript.h:852
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:839
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
void SetExplTargetDest(WorldLocation const &loc)
HookList< CastHandler > BeforeCast
Definition: SpellScript.h:820
Spell * GetSpell() const
Definition: SpellScript.h:987
HookList< EffectHandler > OnEffectLaunchTarget
Definition: SpellScript.h:838
WorldLocation const * GetExplTargetDest() const
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
void Summon(Creature const *summon)
void DoAction(int32 info, Predicate &&predicate, uint16 max=0)
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
virtual void SetData(uint32, uint32)
Definition: UnitAI.h:74
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:73
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
float GetSpeed(UnitMoveType mtype) const
Definition: Unit.cpp:8515
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3685
ThreatManager & GetThreatManager()
Definition: Unit.h:1063
void RemoveAllGameObjects()
Definition: Unit.cpp:5302
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
Definition: Unit.cpp:1248
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void SetFacingToObject(WorldObject const *object, bool force=true)
Definition: Unit.cpp:12671
void StopMoving()
Definition: Unit.cpp:10049
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
Definition: Unit.cpp:5378
TempSummon * ToTempSummon()
Definition: Unit.h:1756
UnitAI * GetAI() const
Definition: Unit.h:660
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition: Unit.cpp:12725
void SendSpellDamageImmune(Unit *target, uint32 spellId, bool isPeriodic)
Definition: Unit.cpp:5478
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4560
bool SetCanFly(bool enable)
Definition: Unit.cpp:12820
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition: Unit.cpp:8525
void SetFacingTo(float const ori, bool force=true)
Definition: Unit.cpp:12653
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 SetUnitFlag(UnitFlags flags)
Definition: Unit.h:833
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
bool isDead() const
Definition: Unit.h:1166
Map * GetMap() const
Definition: Object.h:624
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1042
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
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2065
void SetFarVisible(bool on)
Definition: Object.cpp:973
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
Definition: Object.cpp:1181
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition: Object.cpp:1360
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
virtual void SetGuidData(uint32, ObjectGuid)
Definition: ZoneScript.h:84
bool OnCheck(Player *, Unit *target) override
bool OnTrigger(Player *player, AreaTriggerEntry const *) override
bool Validate(SpellInfo const *spellInfo) override
void HandleScript(SpellEffIndex effIndex)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void HandleForcedCast(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void HandleTriggerMissile(SpellEffIndex effIndex)
void PeriodicTick(AuraEffect const *)
bool Validate(SpellInfo const *) override
void HandleSindragosaTalk(SpellEffIndex)
void FilterTargets(std::list< WorldObject * > &unitList)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void PeriodicTick(AuraEffect const *aurEff)
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
void HandleDummy(SpellEffIndex effIndex)
void FilterTargets(std::list< WorldObject * > &targets)
void FilterTargets(std::list< WorldObject * > &targets)
@ SPELL_UNSATED_CRAVING
@ SPELL_SHADOWS_FATE
@ LIGHT_S_HAMMER_TELEPORT
#define RegisterIcecrownCitadelCreatureAI(ai_name)
@ GO_ICE_BLOCK
#define ICCScriptName
@ ACTION_START_FROSTWYRM
@ ACTION_TRIGGER_ASPHYXIATION
@ DATA_SINDRAGOSA_FROSTWYRMS
@ DATA_SINDRAGOSA
@ DATA_SINDRAGOSA_INTRO
@ DATA_SPINESTALKER
@ NPC_FROST_BOMB
@ NPC_SINDRAGOSA
@ NPC_ICE_TOMB
@ NPC_FROSTWARDEN_HANDLER
@ NPC_FROSTWING_WHELP
MovementPoints
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
void RandomShuffle(Iterator begin, Iterator end)
Reorder the elements of the iterator range randomly.
Definition: Containers.h:170
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:67
@ DATA_RIMEFANG
Definition: pit_of_saron.h:37
@ NPC_ICY_BLAST
Definition: pit_of_saron.h:94
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:474
ObjectGuid OriginalCaster
Definition: SpellDefines.h:482
EnumFlag< ChrSpecializationFlag > GetFlags() const
Definition: DB2Structure.h:872
ChrSpecializationRole GetRole() const
Definition: DB2Structure.h:873
bool operator()(Unit const *target) const
constexpr float GetPositionX() const
Definition: Position.h:76
float m_positionZ
Definition: Position.h:55
constexpr float GetPositionY() const
Definition: Position.h:77
float GetExactDist(float x, float y, float z) const
Definition: Position.h:118
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:81
constexpr void Relocate(float x, float y)
Definition: Position.h:63
constexpr float GetOrientation() const
Definition: Position.h:79
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
Definition: GameObject.cpp:118
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
void SetCombatMovement(bool allowMovement)
bool HealthAbovePct(uint32 pct) const
bool Is25ManRaid() const
uint32 damage
Definition: Unit.h:556
void Reset() override
void JustSummoned(Creature *summon) override
void KilledUnit(Unit *victim) override
void EnterEvadeMode(EvadeReason why) override
uint32 GetData(uint32 type) const override
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
void SpellHitTarget(WorldObject *target, SpellInfo const *spellInfo) override
void JustEngagedWith(Unit *victim) override
void SummonedCreatureDespawn(Creature *summon) override
void JustReachedHome() override
void DamageTaken(Unit *, uint32 &, DamageEffectType, SpellInfo const *) override
void DoAction(int32 action) override
void MovementInform(uint32 type, uint32 point) override
boss_sindragosa(Creature *creature)
uint32 _existenceCheckTimer
npc_ice_tomb(Creature *creature)
void DoAction(int32 action) override
ObjectGuid _trappedPlayerGUID
void SetGUID(ObjectGuid const &guid, int32 id) override
void Reset() override
void JustDied(Unit *) override
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
InstanceScript * _instance
void MovementInform(uint32 type, uint32 point) override
void DoAction(int32 action) override
void InitializeAI() override
void Reset() override
void JustAppeared() override
void JustEngagedWith(Unit *) override
npc_rimefang_icc(Creature *creature)
void UpdateAI(uint32 diff) override
InstanceScript * _instance
void UpdateAI(uint32 diff) override
npc_sindragosa_trash(Creature *creature)
void SetData(uint32 type, uint32 data) override
void InitializeAI() override
void JustAppeared() override
uint32 GetData(uint32 type) const override
void JustAppeared() override
void InitializeAI() override
InstanceScript * _instance
void JustDied(Unit *) override
void DoAction(int32 action) override
void MovementInform(uint32 type, uint32 point) override
npc_spinestalker(Creature *creature)
void UpdateAI(uint32 diff) override
void Reset() override