TrinityCore
boss_deathbringer_saurfang.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 "InstanceScript.h"
21#include "Map.h"
22#include "MotionMaster.h"
23#include "ObjectAccessor.h"
24#include "ScriptedCreature.h"
25#include "ScriptedGossip.h"
26#include "ScriptMgr.h"
27#include "SpellAuras.h"
28#include "SpellScript.h"
29
31{
32 // Deathbringer Saurfang
48
49 // High Overlord Saurfang
57 SAY_OUTRO_ALLIANCE_12 = 7, // kneel after WP reached
65
66 // Muradin Bronzebeard
80
81 // Lady Jaina Proudmoore
84
85 // King Varian Wrynn
90};
91
93{
94 // Deathbringer Saurfang
96 SPELL_GRIP_OF_AGONY = 70572, // Intro
100
102 SPELL_SUMMON_BLOOD_BEAST_25_MAN = 72356, // Additional cast, does not replace
112
113 // Blood Beast
116 SPELL_SCENT_OF_BLOOD = 72769, // Heroic only
117
118 SPELL_RIDE_VEHICLE = 70640, // Outro
123
124// Helper to get id of the aura on different modes (HasAura(baseId) wont work)
125#define BOILING_BLOOD_HELPER RAID_MODE<int32>(72385, 72441, 72442, 72443)
126
128{
136
146
148
155
177
186};
187
189{
192 PHASE_COMBAT = 3
194
196{
199 ACTION_CHARGE = -3781302,
201 ACTION_DESPAWN = -3781304,
204};
205
207{
208 DATA_MADE_A_MESS = 45374613, // 4537, 4613 are achievement IDs
209
212
214};
215
217{
218 POINT_SAURFANG = 3781300,
220 POINT_CHARGE = 3781302,
221 POINT_CHOKE = 3781303,
222 POINT_CORPSE = 3781304,
223 POINT_FINAL = 3781305,
224 POINT_EXIT = 5, // waypoint id
225};
226
227Position const deathbringerPos = {-496.3542f, 2211.33f, 541.1138f, 0.0f};
228Position const firstStepPos = {-541.3177f, 2211.365f, 539.2921f, 0.0f};
229
231{
232 {-509.6505f, 2211.377f, 539.2872f, 0.0f}, // High Overlord Saurfang/Muradin Bronzebeard
233 {-508.7480f, 2211.897f, 539.2870f, 0.0f}, // front left
234 {-509.2929f, 2211.411f, 539.2870f, 0.0f}, // front right
235 {-506.6607f, 2211.367f, 539.2870f, 0.0f}, // back middle
236 {-506.1137f, 2213.306f, 539.2870f, 0.0f}, // back left
237 {-509.0040f, 2211.743f, 539.2870f, 0.0f} // back right
238};
239
241{
242 {-514.4834f, 2211.334f, 549.2887f, 0.0f}, // High Overlord Saurfang/Muradin Bronzebeard
243 {-510.1081f, 2211.592f, 546.3773f, 0.0f}, // front left
244 {-513.3210f, 2211.396f, 551.2882f, 0.0f}, // front right
245 {-507.3684f, 2210.353f, 545.7497f, 0.0f}, // back middle
246 {-507.0486f, 2212.999f, 545.5512f, 0.0f}, // back left
247 {-510.7041f, 2211.069f, 546.5298f, 0.0f} // back right
248};
249
250Position const finalPos = {-563.7552f, 2211.328f, 538.7848f, 0.0f};
251
253{
255 {
256 ASSERT(creature->GetVehicleKit()); // we dont actually use it, just check if exists
258 }
259
260 void Reset() override
261 {
262 if (_dead)
263 return;
264 _Reset();
266 _frenzied = false;
267 _dead = false;
276 }
277
278 void JustEngagedWith(Unit* who) override
279 {
280 if (_dead)
281 return;
282
284 {
287 return;
288 }
289
290 // oh just screw intro, enter combat - no exploits please
291 me->setActive(true);
293
294 events.Reset();
296 me->SetImmuneToPC(false);
297 if (!_introDone)
298 {
301 creature->AI()->DoAction(ACTION_INTERRUPT_INTRO);
302 }
303
304 _introDone = true;
305
312
316 }
317
318 void JustDied(Unit* /*killer*/) override
319 {
320 }
321
322 void AttackStart(Unit* victim) override
323 {
324 if (me->IsImmuneToPC())
325 return;
326
328 }
329
330 void EnterEvadeMode(EvadeReason why) override
331 {
333 if (_introDone)
334 me->SetImmuneToPC(false);
335 }
336
337 void JustReachedHome() override
338 {
339 if (_dead)
340 return;
342 Reset();
345 }
346
347 void KilledUnit(Unit* victim) override
348 {
349 if (victim->GetTypeId() == TYPEID_PLAYER)
350 Talk(SAY_KILL);
351 }
352
353 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
354 {
355 if (damage >= me->GetHealth())
356 damage = me->GetHealth() - 1;
357
358 if (!_frenzied && HealthBelowPct(31)) // AT 30%, not below
359 {
360 _frenzied = true;
363 }
364
365 if (!_dead && me->GetHealth()-damage < FightWonValue)
366 {
367 _dead = true;
368 _JustDied();
370 me->SetUninteractible(true);
371 me->SetImmuneToPC(true);
379 creature->AI()->DoAction(ACTION_START_OUTRO);
380 }
381 }
382
383 void JustSummoned(Creature* summon) override
384 {
385 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
386 {
387 if (target->GetTransport())
388 {
389 summon->DespawnOrUnsummon(1ms);
391 return;
392 }
393
394 summon->AI()->AttackStart(target);
395 }
396
397 summon->CastSpell(summon, SPELL_BLOOD_LINK_BEAST, true);
398 summon->CastSpell(summon, SPELL_RESISTANT_SKIN, true);
399 summons.Summon(summon);
400 DoZoneInCombat(summon);
401 }
402
403 void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
404 {
405 summons.Despawn(summon);
406 }
407
408 void MovementInform(uint32 type, uint32 id) override
409 {
410 if (type != POINT_MOTION_TYPE && id != POINT_SAURFANG)
411 return;
412
414 }
415
416 void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
417 {
418 if (target->GetTransport())
419 {
421 return;
422 }
423
424 switch (spellInfo->Id)
425 {
428 break;
429 case 72255: // Mark of the Fallen Champion, triggered id
430 case 72444:
431 case 72445:
432 case 72446:
434 {
436 args.AddSpellBP0(1);
437 target->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, args);
438 }
439 break;
440 default:
441 break;
442 }
443 }
444
445 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
446 {
447 if (spellInfo->Id == SPELL_BLOOD_LINK_POWER)
448 if (Aura* bloodPower = me->GetAura(SPELL_BLOOD_POWER))
449 bloodPower->RecalculateAmountOfEffects();
450 }
451
452 void UpdateAI(uint32 diff) override
453 {
455 return;
456
457 events.Update(diff);
458
460 return;
461
462 while (uint32 eventId = events.ExecuteEvent())
463 {
464 switch (eventId)
465 {
467 me->SetUninteractible(false);
470 break;
473 break;
478 break;
480 me->SetUninteractible(false);
483 break;
486 break;
490 break;
493 _introDone = true;
494 me->SetImmuneToPC(false);
495 break;
497 for (uint32 i10 = 0; i10 < 2; ++i10)
499 if (Is25ManRaid())
500 for (uint32 i25 = 0; i25 < 3; ++i25)
504 if (IsHeroic())
506 break;
507 case EVENT_BLOOD_NOVA:
510 break;
514 break;
518 break;
519 case EVENT_BERSERK:
522 break;
524 if (!summons.empty())
525 {
528 }
529 break;
530 default:
531 break;
532 }
533
535 return;
536 }
537 }
538
539 uint32 GetData(uint32 type) const override
540 {
541 if (type == DATA_MADE_A_MESS)
542 if (_fallenChampionCastCount < RAID_MODE<uint32>(3, 5, 3, 5))
543 return 1;
544
545 return 0;
546 }
547
548 // intro setup
549 void DoAction(int32 action) override
550 {
551 switch (action)
552 {
553 case PHASE_INTRO_A:
554 case PHASE_INTRO_H:
555 {
556 // controls what events will execute
557 events.SetPhase(uint32(action));
558
561
564
566 break;
567 }
569 {
570 if (_introDone)
571 return;
572
575
579 break;
580 }
582 {
584 {
588 if (Aura* bloodPower = me->GetAura(SPELL_BLOOD_POWER))
589 bloodPower->RecalculateAmountOfEffects();
590 }
591 break;
592 }
593 default:
594 break;
595 }
596 }
597
598 bool CanAIAttack(Unit const* target) const override
599 {
600 if (target->GetTransport())
601 return false;
602
603 return BossAI::CanAIAttack(target);
604 }
605
606 static uint32 const FightWonValue;
607
608private:
611 bool _frenzied; // faster than iterating all auras to find Frenzy
612 bool _dead;
613};
614
616
618{
620 {
621 ASSERT(creature->GetVehicleKit());
623 }
624
625 void Reset() override
626 {
627 _events.Reset();
628 }
629
630 bool OnGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
631 {
633 {
634 CloseGossipMenuFor(player);
636 }
637 return false;
638 }
639
640 void GuardBroadcast(std::function<void(Creature*)>&& action) const
641 {
642 std::vector<Creature*> guardList;
644 for (Creature* guard : guardList)
645 action(guard);
646 }
647
648 void DoAction(int32 action) override
649 {
650 switch (action)
651 {
653 {
654 // Prevent crashes
656 return;
657
658 std::list<Creature*> guardList;
660 guardList.sort(Trinity::ObjectDistanceOrderPred(me));
661 uint32 x = 1;
662 for (auto itr = guardList.begin(); itr != guardList.end(); ++x, ++itr)
663 (*itr)->AI()->SetData(0, x);
664
671 deathbringer->AI()->DoAction(PHASE_INTRO_H);
672 break;
673 }
675 {
682 me->SetDisableGravity(false);
684 GuardBroadcast([](Creature* guard)
685 {
686 guard->AI()->DoAction(ACTION_DESPAWN);
687 });
688 break;
689 }
691 {
692 _events.Reset();
693 GuardBroadcast([](Creature* guard)
694 {
695 guard->AI()->DoAction(ACTION_DESPAWN);
696 });
697 break;
698 }
699 default:
700 break;
701 }
702 }
703
704 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
705 {
706 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
707 {
708 me->SetDisableGravity(true);
710 }
711 }
712
713 void MovementInform(uint32 type, uint32 id) override
714 {
715 if (type == POINT_MOTION_TYPE)
716 {
717 switch (id)
718 {
719 case POINT_FIRST_STEP:
720 me->SetWalk(false);
727 deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO);
728 break;
729 case POINT_CORPSE:
731 {
732 deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs.
733 deathbringer->SetUninteractible(true);
734 deathbringer->SetUnitFlag2(UNIT_FLAG2_PLAY_DEATH_ANIM);
735 deathbringer->SetEmoteState(EMOTE_STATE_DROWNED);
736 }
739 break;
740 case POINT_FINAL:
742 deathbringer->DespawnOrUnsummon();
744 break;
745 default:
746 break;
747 }
748 }
749 else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT)
750 {
752 }
753 }
754
755 void UpdateAI(uint32 diff) override
756 {
757 _events.Update(diff);
758 while (uint32 eventId = _events.ExecuteEvent())
759 {
760 switch (eventId)
761 {
763 me->SetWalk(true);
765 break;
768 break;
771 break;
774 break;
777 GuardBroadcast([](Creature* guard)
778 {
779 guard->AI()->DoAction(ACTION_CHARGE);
780 });
781 me->GetMotionMaster()->MoveCharge(chargePos[0].GetPositionX(), chargePos[0].GetPositionY(), chargePos[0].GetPositionZ(), 8.5f, POINT_CHARGE);
782 break;
783 case EVENT_OUTRO_HORDE_2: // say
785 me->SetFacingToObject(deathbringer);
787 break;
788 case EVENT_OUTRO_HORDE_3: // say
790 break;
791 case EVENT_OUTRO_HORDE_4: // move
793 {
794 float x, y, z;
795 deathbringer->GetClosePoint(x, y, z, deathbringer->GetCombatReach());
796 me->SetWalk(true);
798 }
799 break;
800 case EVENT_OUTRO_HORDE_5: // move
802 break;
803 case EVENT_OUTRO_HORDE_6: // say
805 break;
806 }
807 }
808 }
809
810private:
813};
814
816{
818 {
820 }
821
822 void Reset() override
823 {
824 _events.Reset();
825 }
826
827 bool OnGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
828 {
830 {
831 CloseGossipMenuFor(player);
833 }
834 return false;
835 }
836
837 void GuardBroadcast(std::function<void(Creature*)>&& action) const
838 {
839 std::vector<Creature*> guardList;
841 for (Creature* guard : guardList)
842 action(guard);
843 }
844
845 void DoAction(int32 action) override
846 {
847 switch (action)
848 {
850 {
851 // Prevent crashes
853 return;
854
856 std::list<Creature*> guardList;
858 guardList.sort(Trinity::ObjectDistanceOrderPred(me));
859 uint32 x = 1;
860 for (auto itr = guardList.begin(); itr != guardList.end(); ++x, ++itr)
861 (*itr)->AI()->SetData(0, x);
862
868 deathbringer->AI()->DoAction(PHASE_INTRO_A);
869 break;
870 }
872 {
875 me->SetDisableGravity(false);
877 GuardBroadcast([](Creature* guard)
878 {
879 guard->AI()->DoAction(ACTION_DESPAWN);
880 });
881
882 // temp until outro fully done - to put deathbringer on respawn timer (until next reset)
884 deathbringer->DespawnOrUnsummon(5s);
885 break;
886 }
888 _events.Reset();
889 GuardBroadcast([](Creature* guard)
890 {
891 guard->AI()->DoAction(ACTION_DESPAWN);
892 });
893 break;
894 }
895 }
896
897 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
898 {
899 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
900 {
901 me->SetDisableGravity(true);
903 }
904 }
905
906 void MovementInform(uint32 type, uint32 id) override
907 {
908 if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP)
909 {
910 me->SetWalk(false);
914 deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO);
915 }
916 else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT)
917 {
919 }
920 }
921
922 void UpdateAI(uint32 diff) override
923 {
924 _events.Update(diff);
925 while (uint32 eventId = _events.ExecuteEvent())
926 {
927 switch (eventId)
928 {
930 me->SetWalk(true);
932 break;
935 GuardBroadcast([](Creature* guard)
936 {
937 guard->AI()->DoAction(ACTION_CHARGE);
938 });
939 me->GetMotionMaster()->MoveCharge(chargePos[0].GetPositionX(), chargePos[0].GetPositionY(), chargePos[0].GetPositionZ(), 8.5f, POINT_CHARGE);
940 break;
941 }
942 }
943 }
944
945private:
948};
949
951{
953 {
954 _index = 0;
955 }
956
957 void SetData(uint32 type, uint32 data) override
958 {
959 if (!(!type && data && data < 6))
960 return;
961 _index = data;
962 }
963
964 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
965 {
966 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
967 {
968 me->SetDisableGravity(true);
970 }
971 }
972
973 void DoAction(int32 action) override
974 {
975 if (action == ACTION_CHARGE && _index)
976 me->GetMotionMaster()->MoveCharge(chargePos[_index].GetPositionX(), chargePos[_index].GetPositionY(), chargePos[_index].GetPositionZ(), 13.0f, POINT_CHARGE);
977 else if (action == ACTION_DESPAWN)
979 }
980
981private:
983};
984
985// 72202 - Blood Link
987{
988 bool Validate(SpellInfo const* /*spellInfo*/) override
989 {
991 }
992
993 void HandleDummy(SpellEffIndex /*effIndex*/)
994 {
999 }
1000
1001 void Register() override
1002 {
1004 }
1005};
1006
1007// 72178 - Blood Link
1009{
1010 bool Validate(SpellInfo const* /*spellInfo*/) override
1011 {
1013 }
1014
1015 void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
1016 {
1018 if (GetUnitOwner()->GetPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
1019 if (Creature* saurfang = GetUnitOwner()->ToCreature())
1020 saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION);
1021 }
1022
1023 void Register() override
1024 {
1026 }
1027};
1028
1029// 72371 - Blood Power
1031{
1033 {
1034 if (Aura* aura = GetHitAura())
1035 aura->RecalculateAmountOfEffects();
1036 }
1037
1038 void Register() override
1039 {
1041 }
1042};
1043
1045{
1046 void RecalculateHook(AuraEffect const* /*aurEffect*/, int32& amount, bool& canBeRecalculated)
1047 {
1048 amount = int32(GetUnitOwner()->GetPower(POWER_ENERGY));
1049 canBeRecalculated = true;
1050 }
1051
1052 void Register() override
1053 {
1056 }
1057};
1058
1059// 72409, 72447, 72448, 72449 - Rune of Blood
1061{
1062 bool Validate(SpellInfo const* /*spellInfo*/) override
1063 {
1065 }
1066
1068 {
1069 PreventHitDefaultEffect(effIndex); // make this the default handler
1071 }
1072
1073 void Register() override
1074 {
1076 }
1077};
1078
1079// 72176 - Blood Beast's Blood Link
1081{
1082 bool Validate(SpellInfo const* /*spellInfo*/) override
1083 {
1085 }
1086
1087 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1088 {
1090 eventInfo.GetProcTarget()->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, CastSpellExtraArgs(aurEff).AddSpellBP0(3));
1091 }
1092
1093 void Register() override
1094 {
1096 }
1097};
1098
1099// 72380, 72438, 72439, 72440 - Blood Nova
1101{
1102 bool Validate(SpellInfo const* /*spellInfo*/) override
1103 {
1105 }
1106
1108 {
1109 PreventHitDefaultEffect(effIndex); // make this the default handler
1111 }
1112
1113 void Register() override
1114 {
1116 }
1117};
1118
1119// 72378, 73058 - Blood Nova
1121{
1122public:
1124 {
1125 target = nullptr;
1126 }
1127
1128private:
1129 void FilterTargetsInitial(std::list<WorldObject*>& targets)
1130 {
1131 if (targets.empty())
1132 return;
1133
1134 // select one random target, preferring ranged targets
1135 uint32 targetsAtRange = 0;
1136 uint32 const minTargets = uint32(GetCaster()->GetMap()->Is25ManRaid() ? 10 : 4);
1137 targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
1138
1139 // get target count at range
1140 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange)
1141 if ((*itr)->GetDistance(GetCaster()) < 12.0f)
1142 break;
1143
1144 // If not enough ranged targets are present just select anyone
1145 if (targetsAtRange < minTargets)
1146 targetsAtRange = uint32(targets.size());
1147
1148 std::list<WorldObject*>::const_iterator itr = targets.begin();
1149 std::advance(itr, urand(0, targetsAtRange - 1));
1150 target = *itr;
1151 targets.clear();
1152 targets.push_back(target);
1153 }
1154
1155 // use the same target for first and second effect
1156 void FilterTargetsSubsequent(std::list<WorldObject*>& unitList)
1157 {
1158 unitList.clear();
1159 if (!target)
1160 return;
1161
1162 unitList.push_back(target);
1163 }
1164
1166 {
1168 }
1169
1170 void Register() override
1171 {
1175 }
1176
1178};
1179
1180// 72385, 72441, 72442, 72443 - Boiling Blood
1182{
1183 bool Load() override
1184 {
1185 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1186 }
1187
1188 void FilterTargets(std::list<WorldObject*>& targets)
1189 {
1190 targets.remove(GetCaster()->GetVictim());
1191 if (targets.empty())
1192 return;
1193
1195 targets.clear();
1196 targets.push_back(target);
1197 }
1198
1199 void Register() override
1200 {
1202 }
1203};
1204
1205// 72257 - Remove Marks of the Fallen Champion
1207{
1209 {
1210 PreventHitDefaultEffect(effIndex);
1212 }
1213
1214 void Register() override
1215 {
1217 }
1218};
1219
1221{
1222 public:
1223 achievement_ive_gone_and_made_a_mess() : AchievementCriteriaScript("achievement_ive_gone_and_made_a_mess") { }
1224
1225 bool OnCheck(Player* /*source*/, Unit* target) override
1226 {
1227 if (target)
1228 if (Creature* saurfang = target->ToCreature())
1229 if (saurfang->AI()->GetData(DATA_MADE_A_MESS))
1230 return true;
1231
1232 return false;
1233 }
1234};
1235
1237{
1238 // Creatures
1243
1244 // Spells
1254
1255 // Achievements
1257}
Actions
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
#define ASSERT
Definition: Errors.h:68
@ IN_PROGRESS
@ FAIL
@ WAYPOINT_MOTION_TYPE
@ POINT_MOTION_TYPE
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
@ SPELL_BERSERK
Definition: PlayerAI.cpp:371
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
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
void CloseGossipMenuFor(Player *player)
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ TARGET_UNIT_SRC_AREA_ENEMY
@ EMOTE_STATE_DROWNED
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_FORCE_CAST
@ POWER_ENERGY
@ FACTION_UNDEAD_SCOURGE
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOD_SCALE
@ SPELL_AURA_PERIODIC_DUMMY
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
Definition: SpellDefines.h:266
#define AuraEffectProcFn(F, I, N)
Definition: SpellScript.h:2160
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:842
#define AuraEffectCalcAmountFn(F, I, N)
Definition: SpellScript.h:2058
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:864
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
#define SpellHitFn(F)
Definition: SpellScript.h:854
EvadeReason
Definition: UnitAICommon.h:30
@ UNIT_FLAG2_PLAY_DEATH_ANIM
Definition: UnitDefines.h:211
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:297
DamageEffectType
Definition: UnitDefines.h:131
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ ACTION_MARK_OF_THE_FALLEN_CHAMPION
@ SPAWN_GROUP_ENTRANCE_THE_DAMNED_EVENT
@ GOSSIP_MENU_HIGH_OVERLORD_SAURFANG
@ GOSSIP_MENU_MURADIN_BRONZEBEARD
Position const deathbringerPos
Position const chargePos[6]
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION
@ SPELL_PERMANENT_FEIGN_DEATH
@ SPELL_SUMMON_BLOOD_BEAST_25_MAN
@ SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION
@ SPELL_MARK_OF_THE_FALLEN_CHAMPION_S
Position const finalPos
void AddSC_boss_deathbringer_saurfang()
Position const chokePos[6]
@ SAY_MARK_OF_THE_FALLEN_CHAMPION
Position const firstStepPos
MovePoints
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2045
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Definition: SpellScript.h:2057
HookList< EffectProcHandler > OnEffectProc
Definition: SpellScript.h:2155
Unit * GetUnitOwner() const
InstanceScript *const instance
void _JustReachedHome()
bool CanAIAttack(Unit const *target) const override
SummonList summons
EventMap events
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:299
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 SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:371
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Definition: Creature.cpp:2415
bool IsImmuneToPC() const
Definition: Unit.h:1030
CreatureAI * AI() const
Definition: Creature.h:214
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
bool IsInPhase(uint8 phase) const
Definition: EventMap.h:217
void SetPhase(uint8 phase)
Definition: EventMap.cpp:28
void Reset()
Definition: EventMap.cpp:21
virtual bool SetBossState(uint32 id, EncounterState state)
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
virtual ObjectGuid GetGuidData(uint32 type) const override
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
bool SpawnGroupDespawn(uint32 groupId, bool deleteRespawnTimes=false, size_t *count=nullptr)
Definition: Map.cpp:2437
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
void MoveFall(uint32 id=0)
static Creature * ToCreature(Object *o)
Definition: Object.h:219
TypeID GetTypeId() const
Definition: Object.h:173
static Player * ToPlayer(Object *o)
Definition: Object.h:213
Unit * GetProcTarget() const
Definition: Unit.h:495
uint32 const Id
Definition: SpellInfo.h:325
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Definition: SpellScript.h:852
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:840
Aura * GetHitAura(bool dynObjAura=false) const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:863
bool empty() const
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
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 SetFaction(uint32 faction) override
Definition: Unit.h:859
void SetPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition: Unit.cpp:9419
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void SetFacingToObject(WorldObject const *object, bool force=true)
Definition: Unit.cpp:12671
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:9410
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:983
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition: Unit.cpp:12725
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
bool SetWalk(bool enable)
Definition: Unit.cpp:12707
int32 GetPower(Powers power) const
Definition: Unit.cpp:9401
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
Vehicle * GetVehicleKit() const
Definition: Unit.h:1711
void RemoveAurasOnEvade()
Definition: Unit.cpp:4303
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3831
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
TransportBase * GetTransport() const
Definition: Object.h:750
void setActive(bool isActiveObject)
Definition: Object.cpp:922
bool OnCheck(Player *, Unit *target) override
void FilterTargetsSubsequent(std::list< WorldObject * > &unitList)
void FilterTargetsInitial(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
void RecalculateHook(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
@ SPELL_REPUTATION_BOSS_KILL
@ LIGHT_S_HAMMER_TELEPORT
#define RegisterIcecrownCitadelCreatureAI(ai_name)
@ GO_SAURFANG_S_DOOR
@ DATA_DEATHBRINGER_SAURFANG
@ DATA_SAURFANG_EVENT_NPC
@ NPC_SE_SKYBREAKER_MARINE
@ NPC_SE_KOR_KRON_REAVER
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
constexpr float GetOrientation() const
Definition: Position.h:79
constexpr float GetPositionZ() const
Definition: Position.h:78
bool IsHeroic() const
void AttackStart(Unit *) override
== Triggered Actions Requested ==================
bool HealthBelowPct(uint32 pct) const
bool Is25ManRaid() const
void SpellHitTarget(WorldObject *target, SpellInfo const *spellInfo) override
uint32 GetData(uint32 type) const override
void MovementInform(uint32 type, uint32 id) override
void JustEngagedWith(Unit *who) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void SummonedCreatureDies(Creature *summon, Unit *) override
void DoAction(int32 action) override
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
bool CanAIAttack(Unit const *target) const override
void JustSummoned(Creature *summon) override
void UpdateAI(uint32 diff) override
void KilledUnit(Unit *victim) override
void EnterEvadeMode(EvadeReason why) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
bool OnGossipSelect(Player *player, uint32 menuId, uint32) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void MovementInform(uint32 type, uint32 id) override
void GuardBroadcast(std::function< void(Creature *)> &&action) const
void MovementInform(uint32 type, uint32 id) override
void DoAction(int32 action) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void GuardBroadcast(std::function< void(Creature *)> &&action) const
bool OnGossipSelect(Player *player, uint32 menuId, uint32) override
npc_saurfang_event(Creature *creature)
void DoAction(int32 action) override
void SetData(uint32 type, uint32 data) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override