TrinityCore
boss_freya.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 "ObjectAccessor.h"
22#include "Player.h"
23#include "ScriptedCreature.h"
24#include "SpellAuras.h"
25#include "SpellScript.h"
26#include "TemporarySummon.h"
27#include "ulduar.h"
28
30{
31 // Freya
44
45 // Elder Brightleaf / Elder Ironbranch / Elder Stonebark
49};
50
52{
53 // Freya
60 SPELL_ENRAGE = 47008,
68
69 // Stonebark
74
75 // Ironbranch
76 SPELL_IMPALE = 62310,
79
80 // Brightleaf
82 SPELL_FLUX = 62262,
86 SPELL_UNSTABLE_SUN_BEAM_SUMMON = 62207, // Trigger 62221
87
88 // Stack Removing of Attuned to Nature
92
93 // Achievement spells
96
97 // Wave summoning spells
101
102 // Detonating Lasher
105
106 // Ancient Water Spirit
109
110 // Storm Lasher
113
114 // Snaplasher
117
118 // Ancient Conservator
122 SPELL_SPORE_SUMMON_NW = 62582, // Not used, triggered by SPELL_SUMMON_PERIODIC
126
127 // Healthly Spore
129 SPELL_GROW = 62559,
131
132 // Eonar's Gift
136
137 // Nature Bomb
141
142 // Unstable Sun Beam
147 SPELL_FREYA_UNSTABLE_SUNBEAM = 62450, // Or maybe 62866?
148
149 // Sun Beam
152
153 // Attuned To Nature spells
158
160{
174
175 OBJECT_NATURE_BOMB = 194902
177
179{
182
184{
185 // Freya
194
195 // Elder Stonebark
199
200 // Elder Ironbranch
204
205 // Elder Brightleaf
208 EVENT_FLUX = 17
210
212{
213 TIME_DIFFERENCE = 10000, // If difference between waveTime and WAVE_TIME is bigger then TIME_DIFFERENCE, schedule EVENT_WAVE in 10 seconds
217
219{
220 PATH_FREYA_IDLE = 10924320,
221};
222
223constexpr Seconds FREYA_WAVE_TIME = 60s; // Normal wave is one minute
224
226{
227 public:
228 npc_iron_roots() : CreatureScript("npc_iron_roots") { }
229
231 {
232 npc_iron_rootsAI(Creature* creature) : ScriptedAI(creature)
233 {
234 SetCombatMovement(false);
235
236 me->ApplySpellImmune(0, IMMUNITY_ID, 49560, true); // Death Grip
239 }
240
241 void IsSummonedBy(WorldObject* summonerWO) override
242 {
243 Player* summoner = summonerWO->ToPlayer();
244 if (!summoner)
245 return;
246 // Summoner is a player, who should have root aura on self
247 summonerGUID = summoner->GetGUID();
248 me->SetFacingToObject(summoner);
249 me->SetInCombatWith(summoner);
250 }
251
252 void JustDied(Unit* /*killer*/) override
253 {
255 {
256 target->RemoveAurasDueToSpell(SPELL_ROOTS_IRONBRANCH);
257 target->RemoveAurasDueToSpell(SPELL_ROOTS_FREYA);
258 }
259
261 }
262
263 private:
265 };
266
267 CreatureAI* GetAI(Creature* creature) const override
268 {
269 return GetUlduarAI<npc_iron_rootsAI>(creature);
270 }
271};
272
274{
275 public:
276 boss_freya() : CreatureScript("boss_freya") { }
277
278 struct boss_freyaAI : public BossAI
279 {
280 boss_freyaAI(Creature* creature) : BossAI(creature, DATA_FREYA)
281 {
282 _encounterFinished = false;
283 Initialize();
284 memset(elementalTimer, 0, sizeof(elementalTimer));
285 diffTimer = 0;
286 attunedToNature = 0;
287 }
288
290 {
291 trioWaveCount = 0;
293 waveCount = 0;
294 elderCount = 0;
295
296 for (uint8 i = 0; i < 3; ++i)
297 for (uint8 n = 0; n < 2; ++n)
298 ElementalGUID[i][n].Clear();
299 for (uint8 i = 0; i < 6; ++i)
300 for (uint8 n = 0; n < 2; ++n)
301 deforestation[i][n] = 0;
302 for (uint8 n = 0; n < 2; ++n)
303 {
304 checkElementalAlive[n] = true;
305 trioDefeated[n] = false;
306 }
307 for (uint8 n = 0; n < 3; ++n)
308 random[n] = false;
309 }
310
312
321
324 bool random[3];
326
327 void Reset() override
328 {
330 return;
331
332 _Reset();
333 Initialize();
334 }
335
336 void KilledUnit(Unit* who) override
337 {
338 if (who->GetTypeId() == TYPEID_PLAYER)
339 Talk(SAY_SLAY);
340 }
341
342 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
343 {
344 if (damage >= me->GetHealth())
345 {
346 damage = 0;
347 JustDied(who);
348 }
349 }
350
351 void JustEngagedWith(Unit* who) override
352 {
355 Creature* Elder[3];
356 for (uint8 n = 0; n < 3; ++n)
357 {
359 if (Elder[n] && Elder[n]->IsAlive())
360 {
362 Elder[n]->CastSpell(me, SPELL_IRONBRANCH_ESSENCE, true);
363 Elder[n]->RemoveLootMode(LOOT_MODE_DEFAULT); // Why?
364 Elder[n]->AI()->AttackStart(who);
365 AddThreat(who, 250.0f, Elder[n]);
366 ++elderCount;
367 }
368 }
369
370 if (Elder[0] && Elder[0]->IsAlive())
371 {
372 Elder[0]->CastSpell(me, SPELL_BRIGHTLEAF_ESSENCE, true);
374 }
375
376 if (Elder[1] && Elder[1]->IsAlive())
377 {
378 Elder[1]->CastSpell(me, SPELL_STONEBARK_ESSENCE, true);
380 }
381
382 if (Elder[2] && Elder[2]->IsAlive())
383 {
384 Elder[2]->CastSpell(me, SPELL_IRONBRANCH_ESSENCE, true);
386 }
387
388 if (elderCount == 0)
390 else
392
396
401 }
402
403 uint32 GetData(uint32 type) const override
404 {
405 switch (type)
406 {
408 return attunedToNature;
410 return elderCount;
411 }
412
413 return 0;
414 }
415
416 void UpdateAI(uint32 diff) override
417 {
418 if (!UpdateVictim())
419 return;
420
421 events.Update(diff);
422
424 return;
425
426 while (uint32 eventId = events.ExecuteEvent())
427 {
428 switch (eventId)
429 {
430 case EVENT_ENRAGE:
433 break;
434 case EVENT_SUNBEAM:
435 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
436 DoCast(target, SPELL_SUNBEAM);
438 break;
442 break;
444 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
447 break;
448 case EVENT_WAVE:
449 SpawnWave();
450 if (waveCount <= 6) // If set to 6 The Bombs appear during the Final Add wave
452 else
454 break;
455 case EVENT_EONAR_GIFT:
459 break;
462 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, true, -SPELL_ROOTS_FREYA))
463 target->CastSpell(target, SPELL_ROOTS_FREYA, true); // This must be cast by Target self
465 break;
470 break;
471 }
472
474 return;
475 }
476
479
480 // For achievement check
482 attunedToNature = aura->GetStackAmount();
483 else
484 attunedToNature = 0;
485
486 diffTimer += diff; // For getting time difference for Deforestation achievement
487
488 // Elementals must be killed within 12 seconds of each other, or they will all revive and heal
489 Creature* Elemental[3][2];
490 for (uint8 i = 0; i < 2; ++i)
491 {
492 if (checkElementalAlive[i])
493 elementalTimer[i] = 0;
494 else
495 {
496 elementalTimer[i] += diff;
497 for (uint8 k = 0; k < 3; ++k)
498 Elemental[k][i] = ObjectAccessor::GetCreature(*me, ElementalGUID[k][i]);
499 if (elementalTimer[i] > 12000)
500 {
501 if (!trioDefeated[i]) // Do *NOT* merge this bool with bool few lines below!
502 {
503 if (Elemental[0][i] && Elemental[1][i] && Elemental[2][i])
504 {
505 for (uint8 n = 0; n < 3; ++n)
506 {
507 if (Elemental[n][i]->IsAlive())
508 Elemental[n][i]->SetHealth(Elemental[n][i]->GetMaxHealth());
509 else
510 Elemental[n][i]->Respawn();
511 }
512 }
513 }
514 checkElementalAlive[i] = true;
515 }
516 else
517 {
518 if (!trioDefeated[i])
519 {
520 if (Elemental[0][i] && Elemental[1][i] && Elemental[2][i])
521 {
522 if (Elemental[0][i]->isDead() && Elemental[1][i]->isDead() && Elemental[2][i]->isDead())
523 {
524 for (uint8 n = 0; n < 3; ++n)
525 {
526 summons.Despawn(Elemental[n][i]);
527 Elemental[n][i]->DespawnOrUnsummon(5s);
528 trioDefeated[i] = true;
529 Elemental[n][i]->CastSpell(me, SPELL_REMOVE_10STACK, true);
530 }
531 }
532 }
533 }
534 }
535 }
536 }
537 }
538
539 // Check if all Trio NPCs are dead - achievement check
540 void LasherDead(uint32 type) // Type must be in format of a binary mask
541 {
542 uint8 n = 0;
543
544 // Handling received data
545 for (uint8 i = 0; i < 5; ++i) // We have created "instances" for keeping informations about last 6 death lashers - needed because of respawning
546 {
547 deforestation[i][0] = deforestation[(i + 1)][0]; // Time
548 deforestation[i][1] = deforestation[(i + 1)][1]; // Type
549 }
550 deforestation[5][0] = diffTimer;
551 deforestation[5][1] = type;
552
553 // Check for achievement completion
554 if (deforestation[0][1]) // Check for proper functionality of binary masks (overflow would not be problem)
555 {
556 for (uint8 i = 0; i < 6; ++i) // Count binary mask
557 {
558 n += deforestation[i][1];
559 }
560 if ((deforestation[5][0] - deforestation[0][0]) < 10000) // Time check
561 {
562 if (n == 14 && instance) // Binary mask check - verification of lasher types
563 {
565 }
566 }
567 }
568 }
569
570 // Random order of spawning waves
572 {
573 if (random[0] && random[1] && random[2])
574 for (uint8 n = 0; n < 3; ++n)
575 random[n] = false;
576
577 uint8 randomId = urand(0, 2);
578
579 while (random[randomId])
580 randomId = urand(0, 2);
581
582 random[randomId] = true;
583 return randomId;
584 }
585
587 {
588 switch (GetWaveId())
589 {
590 case 0:
592 for (uint8 n = 0; n < 10; ++n)
594 break;
595 case 1:
599 break;
600 case 2:
603 break;
604 }
606 waveCount++;
607 }
608
609 void JustDied(Unit* /*killer*/) override
610 {
612 return;
613
614 _encounterFinished = true;
615
617 const uint32 summonSpell[2][4] =
618 {
619 /* 0Elder, 1Elder, 2Elder, 3Elder */
620 /* 10N */ {62950, 62952, 62953, 62954},
621 /* 25N */ {62955, 62956, 62957, 62958}
622 };
623
624 me->CastSpell(nullptr, summonSpell[me->GetMap()->GetDifficultyID() - DIFFICULTY_10_N][elderCount], true);
625
627
631 me->AttackStop();
633 me->DespawnOrUnsummon(7500ms);
635 _JustDied();
636
637 for (uint8 n = 0; n < 3; ++n)
638 {
640 if (Elder && Elder->IsAlive())
641 {
642 Elder->RemoveAllAuras();
643 Elder->AttackStop();
644 Elder->CombatStop(true);
647 }
648 }
649 }
650
651 void JustSummoned(Creature* summoned) override
652 {
653 switch (summoned->GetEntry())
654 {
655 case NPC_SNAPLASHER:
657 case NPC_STORM_LASHER:
659 summons.Summon(summoned);
661 if (trioWaveController > 2)
663 break;
666 default:
667 summons.Summon(summoned);
668 break;
669 }
670
671 // Need to have it there, or summoned units would do nothing untill attacked
672 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 250.0f, true))
673 {
674 summoned->AI()->AttackStart(target);
675 AddThreat(target, 250.0f, summoned);
676 DoZoneInCombat(summoned);
677 }
678 }
679
680 void SummonedCreatureDies(Creature* summoned, Unit* who) override
681 {
682 switch (summoned->GetEntry())
683 {
685 summoned->CastSpell(me, SPELL_REMOVE_2STACK, true);
686 summoned->CastSpell(who, SPELL_DETONATE, true);
687 summoned->DespawnOrUnsummon(5s);
688 summons.Despawn(summoned);
689 break;
691 summoned->CastSpell(me, SPELL_REMOVE_25STACK, true);
692 summoned->DespawnOrUnsummon(5s);
693 summons.Despawn(summoned);
694 break;
695 }
696 }
697
698 void WaypointReached(uint32 waypointId, uint32 pathId) override
699 {
700 if (pathId != PATH_FREYA_IDLE)
701 return;
702
703 if (waypointId == 4)
704 {
707 }
708 else if (waypointId == 10)
709 {
712 }
713 else if (waypointId == 18)
714 {
717 }
718 }
719 };
720
721 CreatureAI* GetAI(Creature* creature) const override
722 {
723 return GetUlduarAI<boss_freyaAI>(creature);
724 }
725};
726
728{
729 public:
730 boss_elder_brightleaf() : CreatureScript("boss_elder_brightleaf") { }
731
733 {
735 {
736 }
737
738 void Reset() override
739 {
740 _Reset();
746 }
747
748 void KilledUnit(Unit* who) override
749 {
750 if (who->GetTypeId() == TYPEID_PLAYER)
752 }
753
754 void JustDied(Unit* /*killer*/) override
755 {
756 _JustDied();
758 }
759
760 void JustEngagedWith(Unit* who) override
761 {
765 }
766
767 void UpdateAI(uint32 diff) override
768 {
770 return;
771
772 events.Update(diff);
773
775 return;
776
777 while (uint32 eventId = events.ExecuteEvent())
778 {
779 switch (eventId)
780 {
784 break;
786 {
787 uint8 stackAmount = 0;
788 if (Aura* aura = me->GetAura(SPELL_FLUX_AURA))
789 stackAmount = aura->GetStackAmount();
791 args.AddSpellMod(SPELLVALUE_MAX_TARGETS, stackAmount);
794 break;
795 }
796 case EVENT_FLUX:
799 if (Aura* Flux = me->GetAura(SPELL_FLUX_AURA))
800 Flux->SetStackAmount(urand(1, 8));
802 break;
803 }
804
806 return;
807 }
808 }
809
810 void DoAction(int32 action) override
811 {
812 switch (action)
813 {
815 me->DespawnOrUnsummon(10s);
816 _JustDied();
817 break;
818 }
819 }
820 };
821
822 CreatureAI* GetAI(Creature* creature) const override
823 {
824 return GetUlduarAI<boss_elder_brightleafAI>(creature);
825 }
826};
827
829{
830 public:
831 boss_elder_stonebark() : CreatureScript("boss_elder_stonebark") { }
832
834 {
836 {
837 }
838
839 void Reset() override
840 {
841 _Reset();
846 events.ScheduleEvent(EVENT_BARK, 37500ms, 40s);
847 }
848
849 void KilledUnit(Unit* who) override
850 {
851 if (who->GetTypeId() == TYPEID_PLAYER)
853 }
854
855 void JustDied(Unit* /*killer*/) override
856 {
857 _JustDied();
859 }
860
861 void JustEngagedWith(Unit* who) override
862 {
866 }
867
868 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
869 {
870 if (!who || who == me)
871 return;
872
875 {
877 args.AddSpellBP0(damage);
878 who->CastSpell(who, SPELL_PETRIFIED_BARK_DMG, args);
879 damage = 0;
880 }
881 }
882
883 void UpdateAI(uint32 diff) override
884 {
886 return;
887
888 events.Update(diff);
889
891 return;
892
893 while (uint32 eventId = events.ExecuteEvent())
894 {
895 switch (eventId)
896 {
897 case EVENT_BARK:
900 break;
901 case EVENT_FISTS:
904 break;
905 case EVENT_TREMOR:
909 break;
910 }
911
913 return;
914 }
915 }
916
917 void DoAction(int32 action) override
918 {
919 switch (action)
920 {
922 me->DespawnOrUnsummon(10s);
923 _JustDied();
924 break;
925 }
926 }
927 };
928
929 CreatureAI* GetAI(Creature* creature) const override
930 {
931 return GetUlduarAI<boss_elder_stonebarkAI>(creature);
932 }
933};
934
936{
937 public:
938 boss_elder_ironbranch() : CreatureScript("boss_elder_ironbranch") { }
939
941 {
943 {
944 }
945
946 void Reset() override
947 {
948 _Reset();
953 events.ScheduleEvent(EVENT_THORN_SWARM, 7500ms, 12500ms);
954 }
955
956 void KilledUnit(Unit* who) override
957 {
958 if (who->GetTypeId() == TYPEID_PLAYER)
960 }
961
962 void JustDied(Unit* /*killer*/) override
963 {
964 _JustDied();
966 }
967
968 void JustEngagedWith(Unit* who) override
969 {
973 }
974
975 void UpdateAI(uint32 diff) override
976 {
978 return;
979
980 events.Update(diff);
981
983 return;
984
985 while (uint32 eventId = events.ExecuteEvent())
986 {
987 switch (eventId)
988 {
989 case EVENT_IMPALE:
992 break;
993 case EVENT_IRON_ROOTS:
994 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, true, -SPELL_ROOTS_IRONBRANCH))
995 target->CastSpell(target, SPELL_ROOTS_IRONBRANCH, true);
997 break;
1001 break;
1002 }
1003
1005 return;
1006 }
1007 }
1008
1009 void DoAction(int32 action) override
1010 {
1011 switch (action)
1012 {
1014 me->DespawnOrUnsummon(10s);
1015 _JustDied();
1016 break;
1017 }
1018 }
1019 };
1020
1021 CreatureAI* GetAI(Creature* creature) const override
1022 {
1023 return GetUlduarAI<boss_elder_ironbranchAI>(creature);
1024 }
1025};
1026
1028{
1029 public:
1030 npc_detonating_lasher() : CreatureScript("npc_detonating_lasher") { }
1031
1033 {
1035 {
1036 Initialize();
1038 }
1039
1041 {
1042 lashTimer = 5000;
1043 changeTargetTimer = 7500;
1044 }
1045
1046 void Reset() override
1047 {
1048 Initialize();
1049 }
1050
1051 void UpdateAI(uint32 diff) override
1052 {
1053 if (!UpdateVictim())
1054 return;
1055
1056 if (lashTimer <= diff)
1057 {
1059 lashTimer = urand(5000, 10000);
1060 }
1061 else
1062 lashTimer -= diff;
1063
1064 if (changeTargetTimer <= diff)
1065 {
1066 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
1067 {
1068 // Switching to other target - modify aggro of new target by 20% from current target's aggro
1069 AddThreat(target, GetThreat(me->GetVictim()) * 1.2f);
1070 AttackStart(target);
1071 }
1072 changeTargetTimer = urand(5000, 10000);
1073 }
1074 else
1075 changeTargetTimer -= diff;
1076 }
1077
1078 private:
1081 };
1082
1083 CreatureAI* GetAI(Creature* creature) const override
1084 {
1085 return GetUlduarAI<npc_detonating_lasherAI>(creature);
1086 }
1087};
1088
1090{
1091 public:
1092 npc_ancient_water_spirit() : CreatureScript("npc_ancient_water_spirit") { }
1093
1095 {
1097 {
1098 Initialize();
1100 if (Creature* freya = instance->GetCreature(DATA_FREYA))
1101 waveCount = ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->trioWaveCount;
1102 else
1103 waveCount = 0;
1104 }
1105
1107 {
1108 tidalWaveTimer = 10000;
1109 }
1110
1111 void Reset() override
1112 {
1113 Initialize();
1114 }
1115
1116 void UpdateAI(uint32 diff) override
1117 {
1118 if (!UpdateVictim())
1119 return;
1120
1121 if (tidalWaveTimer <= diff)
1122 {
1123 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
1124 {
1125 DoCast(target, SPELL_TIDAL_WAVE);
1126 DoCast(target, SPELL_TIDAL_WAVE_EFFECT, true);
1127 }
1128 tidalWaveTimer = urand(12000, 25000);
1129 }
1130 else
1131 tidalWaveTimer -= diff;
1132 }
1133
1134 void JustDied(Unit* /*killer*/) override
1135 {
1136 if (Creature* freya = instance->GetCreature(DATA_FREYA))
1137 {
1138 ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->checkElementalAlive[waveCount] = false;
1139 ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->LasherDead(1);
1140 }
1141 }
1142
1143 private:
1147 };
1148
1149 CreatureAI* GetAI(Creature* creature) const override
1150 {
1151 return GetUlduarAI<npc_ancient_water_spiritAI>(creature);
1152 }
1153};
1154
1156{
1157 public:
1158 npc_storm_lasher() : CreatureScript("npc_storm_lasher") { }
1159
1161 {
1163 {
1164 Initialize();
1166 if (Creature* freya = instance->GetCreature(DATA_FREYA))
1167 waveCount = ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->trioWaveCount;
1168 else
1169 waveCount = 0;
1170 }
1171
1173 {
1174 lightningLashTimer = 10000;
1175 stormboltTimer = 5000;
1176 }
1177
1178 void Reset() override
1179 {
1180 Initialize();
1181 }
1182
1183 void UpdateAI(uint32 diff) override
1184 {
1185 if (!UpdateVictim())
1186 return;
1187
1188 if (lightningLashTimer <= diff)
1189 {
1191 lightningLashTimer = urand(7000, 14000);
1192 }
1193 else
1194 lightningLashTimer -= diff;
1195
1196 if (stormboltTimer <= diff)
1197 {
1198 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
1199 DoCast(target, SPELL_STORMBOLT);
1200 stormboltTimer = urand(8000, 12000);
1201 }
1202 else
1203 stormboltTimer -= diff;
1204 }
1205
1206 void JustDied(Unit* /*killer*/) override
1207 {
1208 if (Creature* freya = instance->GetCreature(DATA_FREYA))
1209 {
1210 ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->checkElementalAlive[waveCount] = false;
1211 ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->LasherDead(2);
1212 }
1213 }
1214
1215 private:
1220 };
1221
1222 CreatureAI* GetAI(Creature* creature) const override
1223 {
1224 return GetUlduarAI<npc_storm_lasherAI>(creature);
1225 }
1226};
1227
1229{
1230 public:
1231 npc_snaplasher() : CreatureScript("npc_snaplasher") { }
1232
1234 {
1235 npc_snaplasherAI(Creature* creature) : ScriptedAI(creature)
1236 {
1238 if (Creature* freya = instance->GetCreature(DATA_FREYA))
1239 waveCount = ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->trioWaveCount;
1240 else
1241 waveCount = 0;
1242 }
1243
1244 void UpdateAI(uint32 /*diff*/) override
1245 {
1246 if (!UpdateVictim())
1247 return;
1248
1249 if (!me->HasAura(SPELL_BARK_AURA))
1251 }
1252
1253 void JustDied(Unit* /*killer*/) override
1254 {
1255 if (Creature* freya = instance->GetCreature(DATA_FREYA))
1256 {
1257 ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->checkElementalAlive[waveCount] = false;
1258 ENSURE_AI(boss_freya::boss_freyaAI, freya->AI())->LasherDead(4);
1259 }
1260 }
1261
1262 private:
1265 };
1266
1267 CreatureAI* GetAI(Creature* creature) const override
1268 {
1269 return GetUlduarAI<npc_snaplasherAI>(creature);
1270 }
1271};
1272
1274{
1275 public:
1276 npc_ancient_conservator() : CreatureScript("npc_ancient_conservator") { }
1277
1279 {
1281 {
1282 Initialize();
1283 }
1284
1286 {
1287 natureFuryTimer = 7500;
1288 healthySporeTimer = 3500;
1289 }
1290
1291 void Reset() override
1292 {
1293 Initialize();
1295 }
1296
1297 void SummonHealthySpores(uint8 sporesCount)
1298 {
1299 for (uint8 n = 0; n < sporesCount; ++n)
1300 {
1305 }
1306 }
1307
1308 void JustEngagedWith(Unit* who) override
1309 {
1310 DoCast(who, SPELL_CONSERVATOR_GRIP, true);
1311 }
1312
1313 void UpdateAI(uint32 diff) override
1314 {
1315 if (!UpdateVictim())
1316 return;
1317
1318 if (healthySporeTimer <= diff)
1319 {
1321 healthySporeTimer = urand(15000, 17500);
1322 }
1323 else
1324 healthySporeTimer -= diff;
1325
1326 if (natureFuryTimer <= diff)
1327 {
1328 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, true, -SPELL_NATURE_FURY))
1329 DoCast(target, SPELL_NATURE_FURY);
1331 natureFuryTimer = 5000;
1332 }
1333 else
1334 natureFuryTimer -= diff;
1335 }
1336
1337 private:
1340 };
1341
1342 CreatureAI* GetAI(Creature* creature) const override
1343 {
1344 return GetUlduarAI<npc_ancient_conservatorAI>(creature);
1345 }
1346};
1347
1349{
1350 public:
1351 npc_sun_beam() : CreatureScript("npc_sun_beam") { }
1352
1354 {
1355 npc_sun_beamAI(Creature* creature) : ScriptedAI(creature)
1356 {
1357 SetCombatMovement(false);
1361 }
1362 };
1363
1364 CreatureAI* GetAI(Creature* creature) const override
1365 {
1366 return GetUlduarAI<npc_sun_beamAI>(creature);
1367 }
1368};
1369
1371{
1372 public:
1373 npc_healthy_spore() : CreatureScript("npc_healthy_spore") { }
1374
1376 {
1378 {
1379 SetCombatMovement(false);
1381 me->SetImmuneToPC(true);
1382 me->SetUninteractible(true);
1387 lifeTimer = urand(22000, 30000);
1388 }
1389
1390 void UpdateAI(uint32 diff) override
1391 {
1392 if (lifeTimer <= diff)
1393 {
1395 me->DespawnOrUnsummon(2200ms);
1396 lifeTimer = urand(22000, 30000);
1397 }
1398 else
1399 lifeTimer -= diff;
1400 }
1401
1402 private:
1404 };
1405
1406 CreatureAI* GetAI(Creature* creature) const override
1407 {
1408 return GetUlduarAI<npc_healthy_sporeAI>(creature);
1409 }
1410};
1411
1413{
1414 public:
1415 npc_eonars_gift() : CreatureScript("npc_eonars_gift") { }
1416
1418 {
1420 {
1421 SetCombatMovement(false);
1422
1423 lifeBindersGiftTimer = 12000;
1425 DoCast(me, SPELL_PHEROMONES, true);
1427 }
1428
1429 void UpdateAI(uint32 diff) override
1430 {
1431 if (lifeBindersGiftTimer <= diff)
1432 {
1435 me->DespawnOrUnsummon(2500ms);
1436 lifeBindersGiftTimer = 12000;
1437 }
1438 else
1439 lifeBindersGiftTimer -= diff;
1440 }
1441
1442 private:
1444 };
1445
1446 CreatureAI* GetAI(Creature* creature) const override
1447 {
1448 return GetUlduarAI<npc_eonars_giftAI>(creature);
1449 }
1450};
1451
1453{
1454 public:
1455 npc_nature_bomb() : CreatureScript("npc_nature_bomb") { }
1456
1458 {
1460 {
1461 SetCombatMovement(false);
1462
1463 bombTimer = urand(8000, 10000);
1465 }
1466
1467 void UpdateAI(uint32 diff) override
1468 {
1469 if (bombTimer <= diff)
1470 {
1472 {
1474 me->RemoveGameObject(go, true);
1476 }
1477
1478 bombTimer = 10000;
1479 }
1480 else
1481 bombTimer -= diff;
1482 }
1483
1484 private:
1486 };
1487
1488 CreatureAI* GetAI(Creature* creature) const override
1489 {
1490 return GetUlduarAI<npc_nature_bombAI>(creature);
1491 }
1492};
1493
1495{
1496 public:
1497 npc_unstable_sun_beam() : CreatureScript("npc_unstable_sun_beam") { }
1498
1500 {
1502 {
1503 SetCombatMovement(false);
1504
1505 despawnTimer = urand(7000, 12000);
1510 }
1511
1512 void UpdateAI(uint32 diff) override
1513 {
1514 if (despawnTimer <= diff)
1515 {
1518 }
1519 else
1520 despawnTimer -= diff;
1521 }
1522
1523 void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
1524 {
1525 Unit* unitTarget = target->ToUnit();
1526 if (!unitTarget)
1527 return;
1528
1529 if (spellInfo->Id == SPELL_UNSTABLE_ENERGY)
1530 {
1533 }
1534 }
1535
1536 private:
1539 };
1540
1541 CreatureAI* GetAI(Creature* creature) const override
1542 {
1543 return GetUlduarAI<npc_unstable_sun_beamAI>(creature);
1544 }
1545};
1546
1547// 62521 - Attuned to Nature 25 Dose Reduction
1548// 62524 - Attuned to Nature 2 Dose Reduction
1549// 62525 - Attuned to Nature 10 Dose Reduction
1551{
1552 public:
1553 spell_freya_attuned_to_nature_dose_reduction() : SpellScriptLoader("spell_freya_attuned_to_nature_dose_reduction") { }
1554
1556 {
1557 void HandleScript(SpellEffIndex /*effIndex*/)
1558 {
1559 Unit* target = GetHitUnit();
1560
1561 switch (GetSpellInfo()->Id)
1562 {
1564 if (target->HasAura(GetEffectValue()))
1565 for (uint8 n = 0; n < 2; ++n)
1567 break;
1569 if (target->HasAura(GetEffectValue()))
1570 for (uint8 n = 0; n < 10; ++n)
1572 break;
1574 if (target->HasAura(GetEffectValue()))
1575 for (uint8 n = 0; n < 25; ++n)
1577 break;
1578 default:
1579 break;
1580 }
1581 }
1582
1583 void Register() override
1584 {
1586 }
1587 };
1588
1589 SpellScript* GetSpellScript() const override
1590 {
1592 }
1593};
1594
1595// 65158 - Strengthened Iron Roots Summon Effect
1596// 65160 - Iron Roots Summon Effect
1598{
1599 public:
1600 spell_freya_iron_roots() : SpellScriptLoader("spell_freya_iron_roots") { }
1601
1603 {
1605 {
1606 PreventHitDefaultEffect(effIndex);
1607 uint32 entry = uint32(GetEffectInfo().MiscValue);
1608
1609 Position pos = GetCaster()->GetPosition();
1610 // Not good at all, but this prevents having roots in a different position then player
1611 if (Creature* Roots = GetCaster()->SummonCreature(entry, pos))
1612 GetCaster()->NearTeleportTo(Roots->GetPositionX(), Roots->GetPositionY(), Roots->GetPositionZ(), GetCaster()->GetOrientation());
1613 }
1614
1615 void Register() override
1616 {
1618 }
1619 };
1620
1621 SpellScript* GetSpellScript() const override
1622 {
1624 }
1625};
1626
1628{
1629 public:
1630 achievement_getting_back_to_nature() : AchievementCriteriaScript("achievement_getting_back_to_nature") { }
1631
1632 bool OnCheck(Player* /*player*/, Unit* target) override
1633 {
1634 return target && target->GetAI()->GetData(DATA_GETTING_BACK_TO_NATURE) >= 25;
1635 }
1636};
1637
1639{
1640 public:
1641 achievement_knock_on_wood() : AchievementCriteriaScript("achievement_knock_on_wood") { }
1642
1643 bool OnCheck(Player* /*player*/, Unit* target) override
1644 {
1645 return target && target->GetAI()->GetData(DATA_KNOCK_ON_WOOD) >= 1;
1646 }
1647};
1648
1650{
1651 public:
1652 achievement_knock_knock_on_wood() : AchievementCriteriaScript("achievement_knock_knock_on_wood") { }
1653
1654 bool OnCheck(Player* /*player*/, Unit* target) override
1655 {
1656 return target && target->GetAI()->GetData(DATA_KNOCK_ON_WOOD) >= 2;
1657 }
1658};
1659
1661{
1662 public:
1663 achievement_knock_knock_knock_on_wood() : AchievementCriteriaScript("achievement_knock_knock_knock_on_wood") { }
1664
1665 bool OnCheck(Player* /*player*/, Unit* target) override
1666 {
1667 return target && target->GetAI()->GetData(DATA_KNOCK_ON_WOOD) == 3;
1668 }
1669};
1670
1672{
1673 new boss_freya();
1678 new npc_snaplasher();
1679 new npc_storm_lasher();
1682 new npc_sun_beam();
1683 new npc_nature_bomb();
1684 new npc_eonars_gift();
1685 new npc_healthy_spore();
1687 new npc_iron_roots();
1694}
@ DIFFICULTY_10_N
Definition: DBCEnums.h:877
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_SUMMON
@ IMMUNITY_STATE
@ IMMUNITY_ID
@ LOOT_MODE_DEFAULT
Definition: SharedDefines.h:77
@ FACTION_FRIENDLY
@ FACTION_MONSTER
@ SPELL_AURA_MOD_TAUNT
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
@ SPELLVALUE_AURA_STACK
Definition: SpellDefines.h:231
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:230
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define ENSURE_AI(a, b)
Definition: UnitAI.h:29
@ REACT_PASSIVE
Definition: UnitDefines.h:506
DamageEffectType
Definition: UnitDefines.h:131
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:145
@ UNIT_STATE_CASTING
Definition: Unit.h:270
void AddSC_boss_freya()
FreyaYells
Definition: boss_freya.cpp:30
@ SAY_DEATH
Definition: boss_freya.cpp:35
@ SAY_SUMMON_CONSERVATOR
Definition: boss_freya.cpp:37
@ SAY_AGGRO_WITH_ELDER
Definition: boss_freya.cpp:33
@ SAY_ELDER_AGGRO
Definition: boss_freya.cpp:46
@ EMOTE_IRON_ROOTS
Definition: boss_freya.cpp:43
@ SAY_ELDER_DEATH
Definition: boss_freya.cpp:48
@ SAY_AGGRO
Definition: boss_freya.cpp:32
@ SAY_SUMMON_TRIO
Definition: boss_freya.cpp:38
@ SAY_SUMMON_LASHERS
Definition: boss_freya.cpp:39
@ SAY_ELDER_SLAY
Definition: boss_freya.cpp:47
@ EMOTE_ALLIES_OF_NATURE
Definition: boss_freya.cpp:41
@ SAY_SLAY
Definition: boss_freya.cpp:34
@ EMOTE_GROUND_TREMOR
Definition: boss_freya.cpp:42
@ EMOTE_LIFEBINDERS_GIFT
Definition: boss_freya.cpp:40
@ SAY_BERSERK
Definition: boss_freya.cpp:36
constexpr Seconds FREYA_WAVE_TIME
Definition: boss_freya.cpp:223
FreyaEvents
Definition: boss_freya.cpp:184
@ EVENT_THORN_SWARM
Definition: boss_freya.cpp:203
@ EVENT_IRON_ROOTS
Definition: boss_freya.cpp:202
@ EVENT_EONAR_GIFT
Definition: boss_freya.cpp:187
@ EVENT_ENRAGE
Definition: boss_freya.cpp:193
@ EVENT_GROUND_TREMOR
Definition: boss_freya.cpp:191
@ EVENT_UNSTABLE_ENERGY
Definition: boss_freya.cpp:189
@ EVENT_SOLAR_FLARE
Definition: boss_freya.cpp:206
@ EVENT_STRENGTHENED_IRON_ROOTS
Definition: boss_freya.cpp:190
@ EVENT_TREMOR
Definition: boss_freya.cpp:196
@ EVENT_FLUX
Definition: boss_freya.cpp:208
@ EVENT_FISTS
Definition: boss_freya.cpp:198
@ EVENT_BARK
Definition: boss_freya.cpp:197
@ EVENT_SUNBEAM
Definition: boss_freya.cpp:192
@ EVENT_WAVE
Definition: boss_freya.cpp:186
@ EVENT_UNSTABLE_SUN_BEAM
Definition: boss_freya.cpp:207
@ EVENT_IMPALE
Definition: boss_freya.cpp:201
@ EVENT_NATURE_BOMB
Definition: boss_freya.cpp:188
FreyaSpells
Definition: boss_freya.cpp:52
@ SPELL_FISTS_OF_STONE
Definition: boss_freya.cpp:70
@ SPELL_SUMMON_ANCIENT_CONSERVATOR
Definition: boss_freya.cpp:100
@ SPELL_ATTUNED_TO_NATURE_10_DOSE_REDUCTION
Definition: boss_freya.cpp:155
@ SPELL_DETONATE
Definition: boss_freya.cpp:103
@ SPELL_FREYA_DUMMY_YELLOW
Definition: boss_freya.cpp:55
@ SPELL_REMOVE_25STACK
Definition: boss_freya.cpp:89
@ SPELL_SUNBEAM
Definition: boss_freya.cpp:59
@ SPELL_HEALTHY_SPORE_VISUAL
Definition: boss_freya.cpp:128
@ SPELL_UNSTABLE_SUN_BEAM_TRIGGERED
Definition: boss_freya.cpp:146
@ SPELL_IRONBRANCH_ESSENCE
Definition: boss_freya.cpp:64
@ SPELL_DEFORESTATION_CREDIT
Definition: boss_freya.cpp:94
@ SPELL_FREYA_UNSTABLE_ENERGY_VISUAL
Definition: boss_freya.cpp:151
@ SPELL_SOLAR_FLARE
Definition: boss_freya.cpp:85
@ SPELL_ENRAGE
Definition: boss_freya.cpp:60
@ SPELL_EONAR_VISUAL
Definition: boss_freya.cpp:135
@ SPELL_OBJECT_BOMB
Definition: boss_freya.cpp:139
@ SPELL_POTENT_PHEROMONES
Definition: boss_freya.cpp:130
@ SPELL_SPORE_SUMMON_NE
Definition: boss_freya.cpp:123
@ SPELL_ROOTS_IRONBRANCH
Definition: boss_freya.cpp:77
@ SPELL_DRAINED_OF_POWER
Definition: boss_freya.cpp:66
@ SPELL_BRIGHTLEAF_ESSENCE
Definition: boss_freya.cpp:65
@ SPELL_FLUX_PLUS
Definition: boss_freya.cpp:83
@ SPELL_SUMMON_PERIODIC
Definition: boss_freya.cpp:121
@ SPELL_UNSTABLE_SUN_BEAM
Definition: boss_freya.cpp:143
@ SPELL_LIGHTNING_LASH
Definition: boss_freya.cpp:111
@ SPELL_BARK_AURA
Definition: boss_freya.cpp:116
@ SPELL_UNSTABLE_ENERGY
Definition: boss_freya.cpp:144
@ SPELL_UNSTABLE_SUN_BEAM_SUMMON
Definition: boss_freya.cpp:86
@ SPELL_SUMMON_EONAR_GIFT
Definition: boss_freya.cpp:67
@ SPELL_SPORE_SUMMON_SE
Definition: boss_freya.cpp:124
@ SPELL_SPORE_SUMMON_NW
Definition: boss_freya.cpp:122
@ SPELL_PHEROMONES
Definition: boss_freya.cpp:134
@ SPELL_THORN_SWARM
Definition: boss_freya.cpp:78
@ SPELL_SUMMON_NATURE_BOMB
Definition: boss_freya.cpp:140
@ SPELL_PETRIFIED_BARK_DMG
Definition: boss_freya.cpp:73
@ SPELL_STORMBOLT
Definition: boss_freya.cpp:112
@ SPELL_NATURE_BOMB
Definition: boss_freya.cpp:138
@ SPELL_FREYA_DUMMY_BLUE
Definition: boss_freya.cpp:56
@ SPELL_ATTUNED_TO_NATURE_25_DOSE_REDUCTION
Definition: boss_freya.cpp:156
@ SPELL_NATURE_FURY
Definition: boss_freya.cpp:120
@ SPELL_HARDENED_BARK
Definition: boss_freya.cpp:115
@ SPELL_SPORE_SUMMON_SW
Definition: boss_freya.cpp:125
@ SPELL_PHOTOSYNTHESIS
Definition: boss_freya.cpp:145
@ SPELL_LIFEBINDERS_GIFT
Definition: boss_freya.cpp:133
@ SPELL_TIDAL_WAVE_EFFECT
Definition: boss_freya.cpp:108
@ SPELL_ROOTS_FREYA
Definition: boss_freya.cpp:62
@ SPELL_PETRIFIED_BARK
Definition: boss_freya.cpp:72
@ SPELL_GROUND_TREMOR
Definition: boss_freya.cpp:71
@ SPELL_FLUX_MINUS
Definition: boss_freya.cpp:84
@ SPELL_TIDAL_WAVE
Definition: boss_freya.cpp:107
@ SPELL_FREYA_UNSTABLE_ENERGY
Definition: boss_freya.cpp:150
@ SPELL_FLAME_LASH
Definition: boss_freya.cpp:104
@ SPELL_FREYA_GROUND_TREMOR
Definition: boss_freya.cpp:61
@ SPELL_SUMMON_LASHERS
Definition: boss_freya.cpp:98
@ SPELL_FREYA_UNSTABLE_SUNBEAM
Definition: boss_freya.cpp:147
@ SPELL_KNOCK_ON_WOOD_CREDIT
Definition: boss_freya.cpp:95
@ SPELL_REMOVE_2STACK
Definition: boss_freya.cpp:91
@ SPELL_FLUX_AURA
Definition: boss_freya.cpp:81
@ SPELL_CONSERVATOR_GRIP
Definition: boss_freya.cpp:119
@ SPELL_STONEBARK_ESSENCE
Definition: boss_freya.cpp:63
@ SPELL_REMOVE_10STACK
Definition: boss_freya.cpp:90
@ SPELL_ATTUNED_TO_NATURE_2_DOSE_REDUCTION
Definition: boss_freya.cpp:154
@ SPELL_SUMMON_TRIO
Definition: boss_freya.cpp:99
@ SPELL_TOUCH_OF_EONAR
Definition: boss_freya.cpp:58
@ SPELL_GROW
Definition: boss_freya.cpp:129
@ SPELL_IMPALE
Definition: boss_freya.cpp:76
@ SPELL_FLUX
Definition: boss_freya.cpp:82
@ SPELL_ATTUNED_TO_NATURE
Definition: boss_freya.cpp:57
@ SPELL_FREYA_DUMMY_GREEN
Definition: boss_freya.cpp:54
FreyaPaths
Definition: boss_freya.cpp:219
@ PATH_FREYA_IDLE
Definition: boss_freya.cpp:220
FreyaNpcs
Definition: boss_freya.cpp:160
@ NPC_STRENGTHENED_IRON_ROOTS
Definition: boss_freya.cpp:173
@ NPC_IRON_ROOTS
Definition: boss_freya.cpp:172
@ OBJECT_NATURE_BOMB
Definition: boss_freya.cpp:175
@ NPC_SUN_BEAM
Definition: boss_freya.cpp:162
@ NPC_ANCIENT_WATER_SPIRIT
Definition: boss_freya.cpp:165
@ NPC_EONARS_GIFT
Definition: boss_freya.cpp:169
@ NPC_STORM_LASHER
Definition: boss_freya.cpp:166
@ NPC_DETONATING_LASHER
Definition: boss_freya.cpp:163
@ NPC_NATURE_BOMB
Definition: boss_freya.cpp:168
@ NPC_CHANNEL_STALKER_FREYA
Definition: boss_freya.cpp:161
@ NPC_HEALTHY_SPORE
Definition: boss_freya.cpp:170
@ NPC_UNSTABLE_SUN_BEAM
Definition: boss_freya.cpp:171
@ NPC_ANCIENT_CONSERVATOR
Definition: boss_freya.cpp:164
@ NPC_SNAPLASHER
Definition: boss_freya.cpp:167
FreyaMisc
Definition: boss_freya.cpp:212
@ TIME_DIFFERENCE
Definition: boss_freya.cpp:213
@ DATA_KNOCK_ON_WOOD
Definition: boss_freya.cpp:215
@ DATA_GETTING_BACK_TO_NATURE
Definition: boss_freya.cpp:214
FreyaActions
Definition: boss_freya.cpp:179
@ ACTION_ELDER_FREYA_KILLED
Definition: boss_freya.cpp:180
void SetStackAmount(uint8 num)
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
SummonList summons
EventMap events
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
Definition: CreatureAI.cpp:328
Creature *const me
Definition: CreatureAI.h:61
void EngagementOver()
Definition: CreatureAI.cpp:287
void RemoveLootMode(uint16 lootMode)
Definition: Creature.h:299
void Respawn(bool force=false)
Definition: Creature.cpp:2303
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void SetReactState(ReactStates st)
Definition: Creature.h:160
void RemoveFromWorld() override
Definition: Creature.cpp:349
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
CreatureAI * AI() const
Definition: Creature.h:214
void DisappearAndDie()
Definition: Creature.h:83
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
Creature * GetCreature(uint32 type)
virtual ObjectGuid GetGuidData(uint32 type) const override
Difficulty GetDifficultyID() const
Definition: Map.h:324
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
uint32 const Id
Definition: SpellInfo.h:325
Unit * GetCaster() const
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
SpellInfo const * GetSpellInfo() const
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
virtual void DoAction(int32)
Definition: UnitAI.h:72
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
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
Definition: Unit.cpp:7845
void RemoveGameObject(GameObject *gameObj, bool del)
Definition: Unit.cpp:5238
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition: Unit.cpp:5827
void SetHealth(uint64 val)
Definition: Unit.cpp:9346
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
Definition: Unit.h:1045
void SetFaction(uint32 faction) override
Definition: Unit.h:859
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3089
void SetFacingToObject(WorldObject const *object, bool force=true)
Definition: Unit.cpp:12671
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:11618
bool IsAlive() const
Definition: Unit.h:1164
UnitAI * GetAI() const
Definition: Unit.h:660
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4560
uint64 GetHealth() const
Definition: Unit.h:776
void NearTeleportTo(Position const &pos, bool casting=false)
Definition: Unit.cpp:12327
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint16 num=1)
Definition: Unit.cpp:3847
Unit * GetVictim() const
Definition: Unit.h:715
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
void RemoveAllAttackers()
Definition: Unit.cpp:5881
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
void RemoveAllAuras()
Definition: Unit.cpp:4242
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
GameObject * FindNearestGameObject(uint32 entry, float range, bool spawnedOnly=true) const
Definition: Object.cpp:2170
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
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2148
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
CreatureAI * GetAI(Creature *creature) const override
Definition: boss_freya.cpp:822
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
Definition: boss_freya.cpp:929
CreatureAI * GetAI(Creature *creature) const override
Definition: boss_freya.cpp:721
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
Definition: boss_freya.cpp:267
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
CreatureAI * GetAI(Creature *creature) const override
SpellScript * GetSpellScript() const override
SpellScript * GetSpellScript() const override
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:474
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:81
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
void SetCombatMovement(bool allowMovement)
float GetThreat(Unit const *victim, Unit const *who=nullptr)
void AddThreat(Unit *victim, float amount, Unit *who=nullptr)
void DoAction(int32 action) override
Definition: boss_freya.cpp:917
void DamageTaken(Unit *who, uint32 &damage, DamageEffectType, SpellInfo const *) override
Definition: boss_freya.cpp:868
void DamageTaken(Unit *who, uint32 &damage, DamageEffectType, SpellInfo const *) override
Definition: boss_freya.cpp:342
void LasherDead(uint32 type)
Definition: boss_freya.cpp:540
uint32 deforestation[6][2]
Definition: boss_freya.cpp:313
boss_freyaAI(Creature *creature)
Definition: boss_freya.cpp:280
ObjectGuid ElementalGUID[3][2]
Definition: boss_freya.cpp:311
uint32 GetData(uint32 type) const override
Definition: boss_freya.cpp:403
void JustSummoned(Creature *summoned) override
Definition: boss_freya.cpp:651
void JustEngagedWith(Unit *who) override
Definition: boss_freya.cpp:351
void Reset() override
Definition: boss_freya.cpp:327
void JustDied(Unit *) override
Definition: boss_freya.cpp:609
void WaypointReached(uint32 waypointId, uint32 pathId) override
Definition: boss_freya.cpp:698
void SummonedCreatureDies(Creature *summoned, Unit *who) override
Definition: boss_freya.cpp:680
void KilledUnit(Unit *who) override
Definition: boss_freya.cpp:336
void UpdateAI(uint32 diff) override
Definition: boss_freya.cpp:416
void UpdateAI(uint32 diff) override
npc_eonars_giftAI(Creature *creature)
void UpdateAI(uint32 diff) override
void JustDied(Unit *) override
Definition: boss_freya.cpp:252
void IsSummonedBy(WorldObject *summonerWO) override
Definition: boss_freya.cpp:241
npc_iron_rootsAI(Creature *creature)
Definition: boss_freya.cpp:232
void UpdateAI(uint32 diff) override
npc_nature_bombAI(Creature *creature)
void UpdateAI(uint32) override
void JustDied(Unit *) override
npc_snaplasherAI(Creature *creature)
void UpdateAI(uint32 diff) override
npc_storm_lasherAI(Creature *creature)
npc_sun_beamAI(Creature *creature)
void SpellHitTarget(WorldObject *target, SpellInfo const *spellInfo) override
@ DATA_STONEBARK
Definition: ulduar.h:53
@ DATA_BRIGHTLEAF
Definition: ulduar.h:51
@ DATA_IRONBRANCH
Definition: ulduar.h:52
@ DATA_FREYA
Definition: ulduar.h:46