TrinityCore
Loading...
Searching...
No Matches
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
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
194
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
277
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
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(int32 action) const
641 {
642 std::vector<Creature*> guardList;
644 for (Creature* guard : guardList)
645 guard->AI()->DoAction(action);
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);
685 break;
686 }
688 {
689 _events.Reset();
691 break;
692 }
693 default:
694 break;
695 }
696 }
697
698 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
699 {
700 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
701 {
702 me->SetDisableGravity(true);
704 }
705 }
706
707 void MovementInform(uint32 type, uint32 id) override
708 {
709 if (type == POINT_MOTION_TYPE)
710 {
711 switch (id)
712 {
713 case POINT_FIRST_STEP:
714 me->SetWalk(false);
721 deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO);
722 break;
723 case POINT_CORPSE:
725 {
726 deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs.
727 deathbringer->SetUninteractible(true);
728 deathbringer->SetUnitFlag2(UNIT_FLAG2_PLAY_DEATH_ANIM);
729 deathbringer->SetEmoteState(EMOTE_STATE_DROWNED);
730 }
733 break;
734 case POINT_FINAL:
736 deathbringer->DespawnOrUnsummon();
738 break;
739 default:
740 break;
741 }
742 }
743 else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT)
744 {
746 }
747 }
748
749 void UpdateAI(uint32 diff) override
750 {
751 _events.Update(diff);
752 while (uint32 eventId = _events.ExecuteEvent())
753 {
754 switch (eventId)
755 {
757 me->SetWalk(true);
759 break;
762 break;
765 break;
768 break;
772 me->GetMotionMaster()->MoveCharge(chargePos[0].GetPositionX(), chargePos[0].GetPositionY(), chargePos[0].GetPositionZ(), 8.5f, POINT_CHARGE);
773 break;
774 case EVENT_OUTRO_HORDE_2: // say
776 me->SetFacingToObject(deathbringer);
778 break;
779 case EVENT_OUTRO_HORDE_3: // say
781 break;
782 case EVENT_OUTRO_HORDE_4: // move
784 {
785 float x, y, z;
786 deathbringer->GetClosePoint(x, y, z, deathbringer->GetCombatReach());
787 me->SetWalk(true);
789 }
790 break;
791 case EVENT_OUTRO_HORDE_5: // move
793 break;
794 case EVENT_OUTRO_HORDE_6: // say
796 break;
797 }
798 }
799 }
800
801private:
804};
805
807{
809 {
811 }
812
813 void Reset() override
814 {
815 _events.Reset();
816 }
817
818 bool OnGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
819 {
821 {
822 CloseGossipMenuFor(player);
824 }
825 return false;
826 }
827
828 void GuardBroadcast(int32 action) const
829 {
830 std::vector<Creature*> guardList;
832 for (Creature* guard : guardList)
833 guard->AI()->DoAction(action);
834 }
835
836 void DoAction(int32 action) override
837 {
838 switch (action)
839 {
841 {
842 // Prevent crashes
844 return;
845
847 std::list<Creature*> guardList;
849 guardList.sort(Trinity::ObjectDistanceOrderPred(me));
850 uint32 x = 1;
851 for (auto itr = guardList.begin(); itr != guardList.end(); ++x, ++itr)
852 (*itr)->AI()->SetData(0, x);
853
859 deathbringer->AI()->DoAction(PHASE_INTRO_A);
860 break;
861 }
863 {
866 me->SetDisableGravity(false);
869
870 // temp until outro fully done - to put deathbringer on respawn timer (until next reset)
872 deathbringer->DespawnOrUnsummon(5s);
873 break;
874 }
876 _events.Reset();
878 break;
879 }
880 }
881
882 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
883 {
884 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
885 {
886 me->SetDisableGravity(true);
888 }
889 }
890
891 void MovementInform(uint32 type, uint32 id) override
892 {
893 if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP)
894 {
895 me->SetWalk(false);
899 deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO);
900 }
901 else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT)
902 {
904 }
905 }
906
907 void UpdateAI(uint32 diff) override
908 {
909 _events.Update(diff);
910 while (uint32 eventId = _events.ExecuteEvent())
911 {
912 switch (eventId)
913 {
915 me->SetWalk(true);
917 break;
921 me->GetMotionMaster()->MoveCharge(chargePos[0].GetPositionX(), chargePos[0].GetPositionY(), chargePos[0].GetPositionZ(), 8.5f, POINT_CHARGE);
922 break;
923 }
924 }
925 }
926
927private:
930};
931
933{
935 {
936 _index = 0;
937 }
938
939 void SetData(uint32 type, uint32 data) override
940 {
941 if (!(!type && data && data < 6))
942 return;
943 _index = data;
944 }
945
946 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
947 {
948 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
949 {
950 me->SetDisableGravity(true);
952 }
953 }
954
955 void DoAction(int32 action) override
956 {
957 if (action == ACTION_CHARGE && _index)
958 me->GetMotionMaster()->MoveCharge(chargePos[_index].GetPositionX(), chargePos[_index].GetPositionY(), chargePos[_index].GetPositionZ(), 13.0f, POINT_CHARGE);
959 else if (action == ACTION_DESPAWN)
961 }
962
963private:
965};
966
967// 72202 - Blood Link
988
989// 72178 - Blood Link
991{
992 bool Validate(SpellInfo const* /*spellInfo*/) override
993 {
995 }
996
997 void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
998 {
1000 if (GetUnitOwner()->GetPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
1001 if (Creature* saurfang = GetUnitOwner()->ToCreature())
1002 saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION);
1003 }
1004
1009};
1010
1011// 72371 - Blood Power
1013{
1015 {
1016 if (Aura* aura = GetHitAura())
1017 aura->RecalculateAmountOfEffects();
1018 }
1019
1024};
1025
1040
1041// 72409, 72447, 72448, 72449 - Rune of Blood
1043{
1044 bool Validate(SpellInfo const* /*spellInfo*/) override
1045 {
1047 }
1048
1050 {
1051 PreventHitDefaultEffect(effIndex); // make this the default handler
1053 }
1054
1059};
1060
1061// 72176 - Blood Beast's Blood Link
1063{
1064 bool Validate(SpellInfo const* /*spellInfo*/) override
1065 {
1067 }
1068
1069 void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo)
1070 {
1072 eventInfo.GetProcTarget()->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, CastSpellExtraArgs(aurEff).AddSpellBP0(3));
1073 }
1074
1079};
1080
1081// 72380, 72438, 72439, 72440 - Blood Nova
1083{
1084 bool Validate(SpellInfo const* /*spellInfo*/) override
1085 {
1087 }
1088
1090 {
1091 PreventHitDefaultEffect(effIndex); // make this the default handler
1093 }
1094
1099};
1100
1101// 72378, 73058 - Blood Nova
1103{
1104public:
1106 {
1107 target = nullptr;
1108 }
1109
1110private:
1111 void FilterTargetsInitial(std::list<WorldObject*>& targets)
1112 {
1113 if (targets.empty())
1114 return;
1115
1116 // select one random target, preferring ranged targets
1117 uint32 targetsAtRange = 0;
1118 uint32 const minTargets = uint32(GetCaster()->GetMap()->Is25ManRaid() ? 10 : 4);
1119 targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
1120
1121 // get target count at range
1122 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange)
1123 if ((*itr)->GetDistance(GetCaster()) < 12.0f)
1124 break;
1125
1126 // If not enough ranged targets are present just select anyone
1127 if (targetsAtRange < minTargets)
1128 targetsAtRange = uint32(targets.size());
1129
1130 std::list<WorldObject*>::const_iterator itr = targets.begin();
1131 std::advance(itr, urand(0, targetsAtRange - 1));
1132 target = *itr;
1133 targets.clear();
1134 targets.push_back(target);
1135 }
1136
1137 // use the same target for first and second effect
1138 void FilterTargetsSubsequent(std::list<WorldObject*>& unitList)
1139 {
1140 unitList.clear();
1141 if (!target)
1142 return;
1143
1144 unitList.push_back(target);
1145 }
1146
1151
1158
1160};
1161
1162// 72385, 72441, 72442, 72443 - Boiling Blood
1164{
1165 bool Load() override
1166 {
1167 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1168 }
1169
1170 void FilterTargets(std::list<WorldObject*>& targets)
1171 {
1172 targets.remove(GetCaster()->GetVictim());
1173 if (targets.empty())
1174 return;
1175
1177 targets.clear();
1178 targets.push_back(target);
1179 }
1180
1185};
1186
1187// 72257 - Remove Marks of the Fallen Champion
1201
1203{
1204 public:
1205 achievement_ive_gone_and_made_a_mess() : AchievementCriteriaScript("achievement_ive_gone_and_made_a_mess") { }
1206
1207 bool OnCheck(Player* /*source*/, Unit* target) override
1208 {
1209 if (target)
1210 if (Creature* saurfang = target->ToCreature())
1211 if (saurfang->AI()->GetData(DATA_MADE_A_MESS))
1212 return true;
1213
1214 return false;
1215 }
1216};
1217
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
#define ASSERT
Definition Errors.h:80
@ IN_PROGRESS
@ FAIL
@ WAYPOINT_MOTION_TYPE
@ POINT_MOTION_TYPE
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
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:1381
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
void CloseGossipMenuFor(Player *player)
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ 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
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define SpellHitFn(F)
EvadeReason
@ UNIT_FLAG2_PLAY_DEATH_ANIM
@ UNIT_NPC_FLAG_GOSSIP
DamageEffectType
@ UNIT_STATE_CASTING
Definition Unit.h:276
@ 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_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
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
TypeID GetTypeId() const
Definition BaseEntity.h:166
InstanceScript *const instance
void _JustReachedHome()
bool CanAIAttack(Unit const *target) const override
SummonList summons
EventMap events
void DoZoneInCombat()
Definition CreatureAI.h:169
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool UpdateVictim()
void AttackStart(Unit *victim) override
== Triggered Actions Requested ==================
Creature *const me
Definition CreatureAI.h:63
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:386
void SetImmuneToPC(bool apply) override
Definition Creature.h:184
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
bool IsImmuneToPC() const
Definition Unit.h:1045
CreatureAI * AI() const
Definition Creature.h:228
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
bool IsInPhase(uint8 phase) const
Definition EventMap.h:222
void SetPhase(uint8 phase)
Definition EventMap.cpp:32
void Reset()
Definition EventMap.cpp:25
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:2439
void MoveFall(uint32 id=0, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={}, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
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)
Player * ToPlayer()
Definition Object.h:126
Creature * ToCreature()
Definition Object.h:121
Unit * GetProcTarget() const
Definition Unit.h:501
uint32 const Id
Definition SpellInfo.h:328
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Aura * GetHitAura(bool dynObjAura=false, bool withRemoved=false) const
Unit * GetCaster() const
HookList< HitHandler > AfterHit
SpellEffectValue GetEffectValue() const
int32 GetEffectValueAsInt() const
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
bool empty() const
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
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:162
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
void SetFaction(uint32 faction) override
Definition Unit.h:872
void SetPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:10046
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
void SetFacingToObject(WorldObject const *object, bool force=true)
Definition Unit.cpp:13307
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:10037
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:998
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13361
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4700
uint64 GetHealth() const
Definition Unit.h:788
bool SetWalk(bool enable)
Definition Unit.cpp:13343
int32 GetPower(Powers power) const
Definition Unit.cpp:10028
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
Vehicle * GetVehicleKit() const
Definition Unit.h:1782
void RemoveAurasOnEvade()
Definition Unit.cpp:4443
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
Map * GetMap() const
Definition Object.h:411
InstanceScript * GetInstanceScript() const
Definition Object.cpp:396
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
TransportBase * GetTransport() const
Definition Object.h:537
void setActive(bool isActiveObject)
Definition Object.cpp:276
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 *, SpellEffectValue &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) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
CastSpellExtraArgs & AddSpellBP0(SpellEffectValue val)
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
constexpr float GetOrientation() const
Definition Position.h:90
constexpr float GetPositionZ() const
Definition Position.h:89
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 SpellHit(WorldObject *, SpellInfo const *spellInfo) override
void SummonedCreatureDies(Creature *summon, Unit *) override
void DoAction(int32 action) override
void AttackStart(Unit *victim) override
bool CanAIAttack(Unit const *target) const override
void JustSummoned(Creature *summon) 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 MovementInform(uint32 type, uint32 id) override
void SpellHit(WorldObject *, SpellInfo const *spellInfo) override
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