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
252// 37813 - Deathbringer Saurfang
254{
256 {
257 ASSERT(creature->GetVehicleKit()); // we dont actually use it, just check if exists
259 }
260
278
318
319 void JustDied(Unit* /*killer*/) override
320 {
321 }
322
323 void AttackStart(Unit* victim) override
324 {
325 if (me->IsImmuneToPC())
326 return;
327
329 }
330
331 void EnterEvadeMode(EvadeReason why) override
332 {
334 if (_introDone)
335 me->SetImmuneToPC(false);
336 }
337
347
348 void KilledUnit(Unit* victim) override
349 {
350 if (victim->GetTypeId() == TYPEID_PLAYER)
351 Talk(SAY_KILL);
352 }
353
354 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
355 {
356 if (damage >= me->GetHealth())
357 damage = me->GetHealth() - 1;
358
359 if (!_frenzied && HealthBelowPct(31)) // AT 30%, not below
360 {
361 _frenzied = true;
364 }
365
366 if (!_dead && me->GetHealth()-damage < FightWonValue)
367 {
368 _dead = true;
369 _JustDied();
372 me->SetImmuneToPC(true);
380 creature->AI()->DoAction(ACTION_START_OUTRO);
381 }
382 }
383
384 void JustSummoned(Creature* summon) override
385 {
386 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
387 {
388 if (target->GetTransport())
389 {
390 summon->DespawnOrUnsummon(1ms);
392 return;
393 }
394
395 summon->AI()->AttackStart(target);
396 }
397
398 summon->CastSpell(summon, SPELL_BLOOD_LINK_BEAST, true);
399 summon->CastSpell(summon, SPELL_RESISTANT_SKIN, true);
400 summons.Summon(summon);
401 DoZoneInCombat(summon);
402 }
403
404 void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
405 {
406 summons.Despawn(summon);
407 }
408
409 void MovementInform(uint32 type, uint32 id) override
410 {
411 if (type != POINT_MOTION_TYPE && id != POINT_SAURFANG)
412 return;
413
415 }
416
417 void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
418 {
419 if (target->GetTransport())
420 {
422 return;
423 }
424
425 switch (spellInfo->Id)
426 {
429 break;
430 case 72255: // Mark of the Fallen Champion, triggered id
431 case 72444:
432 case 72445:
433 case 72446:
435 {
437 args.AddSpellBP0(1);
438 target->CastSpell(nullptr, SPELL_BLOOD_LINK_DUMMY, args);
439 }
440 break;
441 default:
442 break;
443 }
444 }
445
446 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
447 {
448 if (spellInfo->Id == SPELL_BLOOD_LINK_POWER)
449 if (Aura* bloodPower = me->GetAura(SPELL_BLOOD_POWER))
450 bloodPower->RecalculateAmountOfEffects();
451 }
452
453 void UpdateAI(uint32 diff) override
454 {
456 return;
457
458 events.Update(diff);
459
461 return;
462
463 while (uint32 eventId = events.ExecuteEvent())
464 {
465 switch (eventId)
466 {
471 break;
474 break;
479 break;
484 break;
487 break;
491 break;
494 _introDone = true;
495 me->SetImmuneToPC(false);
496 break;
498 for (uint32 i10 = 0; i10 < 2; ++i10)
500 if (Is25ManRaid())
501 for (uint32 i25 = 0; i25 < 3; ++i25)
505 if (IsHeroic())
507 break;
508 case EVENT_BLOOD_NOVA:
511 break;
515 break;
519 break;
520 case EVENT_BERSERK:
523 break;
525 if (!summons.empty())
526 {
529 }
530 break;
531 default:
532 break;
533 }
534
536 return;
537 }
538
540 }
541
542 uint32 GetData(uint32 type) const override
543 {
544 if (type == DATA_MADE_A_MESS)
545 if (_fallenChampionCastCount < RAID_MODE<uint32>(3, 5, 3, 5))
546 return 1;
547
548 return 0;
549 }
550
551 // intro setup
552 void DoAction(int32 action) override
553 {
554 switch (action)
555 {
556 case PHASE_INTRO_A:
557 case PHASE_INTRO_H:
558 {
559 // controls what events will execute
560 events.SetPhase(uint32(action));
561
564
567
569 break;
570 }
572 {
573 if (_introDone)
574 return;
575
578
582 break;
583 }
585 {
587 {
591 if (Aura* bloodPower = me->GetAura(SPELL_BLOOD_POWER))
592 bloodPower->RecalculateAmountOfEffects();
593 }
594 break;
595 }
596 default:
597 break;
598 }
599 }
600
601 bool CanAIAttack(Unit const* target) const override
602 {
603 if (target->GetTransport())
604 return false;
605
606 return BossAI::CanAIAttack(target);
607 }
608
609 static uint32 const FightWonValue;
610
611private:
614 bool _frenzied; // faster than iterating all auras to find Frenzy
615 bool _dead;
616};
617
619
620// 37187 - High Overlord Saurfang
622{
624 {
625 ASSERT(creature->GetVehicleKit());
627 }
628
629 void Reset() override
630 {
631 _events.Reset();
632 }
633
634 bool OnGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
635 {
637 {
638 CloseGossipMenuFor(player);
640 }
641 return false;
642 }
643
644 void GuardBroadcast(std::function<void(Creature*)>&& action) const
645 {
646 std::vector<Creature*> guardList;
648 for (Creature* guard : guardList)
649 action(guard);
650 }
651
652 void DoAction(int32 action) override
653 {
654 switch (action)
655 {
657 {
658 // Prevent crashes
660 return;
661
662 std::list<Creature*> guardList;
664 guardList.sort(Trinity::ObjectDistanceOrderPred(me));
665 uint32 x = 1;
666 for (auto itr = guardList.begin(); itr != guardList.end(); ++x, ++itr)
667 (*itr)->AI()->SetData(0, x);
668
675 deathbringer->AI()->DoAction(PHASE_INTRO_H);
676 break;
677 }
679 {
686 me->SetDisableGravity(false);
688 GuardBroadcast([](Creature* guard)
689 {
690 guard->AI()->DoAction(ACTION_DESPAWN);
691 });
692 break;
693 }
695 {
696 _events.Reset();
697 GuardBroadcast([](Creature* guard)
698 {
699 guard->AI()->DoAction(ACTION_DESPAWN);
700 });
701 break;
702 }
703 default:
704 break;
705 }
706 }
707
708 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
709 {
710 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
711 {
712 me->SetDisableGravity(true);
714 }
715 }
716
717 void MovementInform(uint32 type, uint32 id) override
718 {
719 if (type == POINT_MOTION_TYPE)
720 {
721 switch (id)
722 {
723 case POINT_FIRST_STEP:
724 me->SetWalk(false);
731 deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO);
732 break;
733 case POINT_CORPSE:
735 {
736 deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs.
737 deathbringer->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
738 deathbringer->SetUnitFlag2(UNIT_FLAG2_PLAY_DEATH_ANIM);
739 deathbringer->SetEmoteState(EMOTE_STATE_DROWNED);
740 }
743 break;
744 case POINT_FINAL:
746 deathbringer->DespawnOrUnsummon();
748 break;
749 default:
750 break;
751 }
752 }
753 else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT)
754 {
756 }
757 }
758
759 void UpdateAI(uint32 diff) override
760 {
761 _events.Update(diff);
762 while (uint32 eventId = _events.ExecuteEvent())
763 {
764 switch (eventId)
765 {
767 me->SetWalk(true);
769 break;
772 break;
775 break;
778 break;
781 GuardBroadcast([](Creature* guard)
782 {
783 guard->AI()->DoAction(ACTION_CHARGE);
784 });
785 me->GetMotionMaster()->MoveCharge(chargePos[0].GetPositionX(), chargePos[0].GetPositionY(), chargePos[0].GetPositionZ(), 8.5f, POINT_CHARGE);
786 break;
787 case EVENT_OUTRO_HORDE_2: // say
789 me->SetFacingToObject(deathbringer);
791 break;
792 case EVENT_OUTRO_HORDE_3: // say
794 break;
795 case EVENT_OUTRO_HORDE_4: // move
797 {
798 float x, y, z;
799 deathbringer->GetClosePoint(x, y, z, deathbringer->GetCombatReach());
800 me->SetWalk(true);
802 }
803 break;
804 case EVENT_OUTRO_HORDE_5: // move
806 break;
807 case EVENT_OUTRO_HORDE_6: // say
809 break;
810 }
811 }
812 }
813
814private:
817};
818
819// 37200 - Muradin Bronzebeard
821{
823 {
825 }
826
827 void Reset() override
828 {
829 _events.Reset();
830 }
831
832 bool OnGossipSelect(Player* player, uint32 menuId, uint32 /*gossipListId*/) override
833 {
835 {
836 CloseGossipMenuFor(player);
838 }
839 return false;
840 }
841
842 void GuardBroadcast(std::function<void(Creature*)>&& action) const
843 {
844 std::vector<Creature*> guardList;
846 for (Creature* guard : guardList)
847 action(guard);
848 }
849
850 void DoAction(int32 action) override
851 {
852 switch (action)
853 {
855 {
856 // Prevent crashes
858 return;
859
861 std::list<Creature*> guardList;
863 guardList.sort(Trinity::ObjectDistanceOrderPred(me));
864 uint32 x = 1;
865 for (auto itr = guardList.begin(); itr != guardList.end(); ++x, ++itr)
866 (*itr)->AI()->SetData(0, x);
867
873 deathbringer->AI()->DoAction(PHASE_INTRO_A);
874 break;
875 }
877 {
880 me->SetDisableGravity(false);
882 GuardBroadcast([](Creature* guard)
883 {
884 guard->AI()->DoAction(ACTION_DESPAWN);
885 });
886
887 // temp until outro fully done - to put deathbringer on respawn timer (until next reset)
889 deathbringer->DespawnOrUnsummon(5s);
890 break;
891 }
893 _events.Reset();
894 GuardBroadcast([](Creature* guard)
895 {
896 guard->AI()->DoAction(ACTION_DESPAWN);
897 });
898 break;
899 }
900 }
901
902 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
903 {
904 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
905 {
906 me->SetDisableGravity(true);
908 }
909 }
910
911 void MovementInform(uint32 type, uint32 id) override
912 {
913 if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP)
914 {
915 me->SetWalk(false);
919 deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO);
920 }
921 else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT)
922 {
924 }
925 }
926
927 void UpdateAI(uint32 diff) override
928 {
929 _events.Update(diff);
930 while (uint32 eventId = _events.ExecuteEvent())
931 {
932 switch (eventId)
933 {
935 me->SetWalk(true);
937 break;
940 GuardBroadcast([](Creature* guard)
941 {
942 guard->AI()->DoAction(ACTION_CHARGE);
943 });
944 me->GetMotionMaster()->MoveCharge(chargePos[0].GetPositionX(), chargePos[0].GetPositionY(), chargePos[0].GetPositionZ(), 8.5f, POINT_CHARGE);
945 break;
946 }
947 }
948 }
949
950private:
953};
954
955// 37830 - Skybreaker Marine
956// 37920 - Kor'kron Reaver
958{
960 {
961 _index = 0;
962 }
963
964 void SetData(uint32 type, uint32 data) override
965 {
966 if (!(!type && data && data < 6))
967 return;
968 _index = data;
969 }
970
971 void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
972 {
973 if (spellInfo->Id == SPELL_GRIP_OF_AGONY)
974 {
975 me->SetDisableGravity(true);
977 }
978 }
979
980 void DoAction(int32 action) override
981 {
982 if (action == ACTION_CHARGE && _index)
983 me->GetMotionMaster()->MoveCharge(chargePos[_index].GetPositionX(), chargePos[_index].GetPositionY(), chargePos[_index].GetPositionZ(), 13.0f, POINT_CHARGE);
984 else if (action == ACTION_DESPAWN)
986 }
987
988private:
990};
991
992// 72202 - Blood Link
1015
1016// 72178 - Blood Link
1018{
1020
1021 bool Validate(SpellInfo const* /*spellInfo*/) override
1022 {
1024 }
1025
1026 void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
1027 {
1029 if (GetUnitOwner()->GetPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY))
1030 if (Creature* saurfang = GetUnitOwner()->ToCreature())
1031 saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION);
1032 }
1033
1038};
1039
1040// 72371 - Blood Power
1042{
1044
1046 {
1047 if (Aura* aura = GetHitAura())
1048 aura->RecalculateAmountOfEffects();
1049 }
1050
1055};
1056
1073
1074// 72409, 72447, 72448, 72449 - Rune of Blood
1076{
1078
1079 bool Validate(SpellInfo const* /*spellInfo*/) override
1080 {
1082 }
1083
1085 {
1086 PreventHitDefaultEffect(effIndex); // make this the default handler
1088 }
1089
1094};
1095
1096// 72176 - Blood Beast's Blood Link
1117
1118// 72380, 72438, 72439, 72440 - Blood Nova
1120{
1122
1123 bool Validate(SpellInfo const* /*spellInfo*/) override
1124 {
1126 }
1127
1129 {
1130 PreventHitDefaultEffect(effIndex); // make this the default handler
1132 }
1133
1138};
1139
1140// 72378, 73058 - Blood Nova
1142{
1144
1145public:
1147 {
1148 target = nullptr;
1149 }
1150
1151private:
1152 void FilterTargetsInitial(std::list<WorldObject*>& targets)
1153 {
1154 if (targets.empty())
1155 return;
1156
1157 // select one random target, preferring ranged targets
1158 uint32 targetsAtRange = 0;
1159 uint32 const minTargets = uint32(GetCaster()->GetMap()->Is25ManRaid() ? 10 : 4);
1160 targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
1161
1162 // get target count at range
1163 for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr, ++targetsAtRange)
1164 if ((*itr)->GetDistance(GetCaster()) < 12.0f)
1165 break;
1166
1167 // If not enough ranged targets are present just select anyone
1168 if (targetsAtRange < minTargets)
1169 targetsAtRange = uint32(targets.size());
1170
1171 std::list<WorldObject*>::const_iterator itr = targets.begin();
1172 std::advance(itr, urand(0, targetsAtRange - 1));
1173 target = *itr;
1174 targets.clear();
1175 targets.push_back(target);
1176 }
1177
1178 // use the same target for first and second effect
1179 void FilterTargetsSubsequent(std::list<WorldObject*>& unitList)
1180 {
1181 unitList.clear();
1182 if (!target)
1183 return;
1184
1185 unitList.push_back(target);
1186 }
1187
1192
1199
1201};
1202
1203// 72385, 72441, 72442, 72443 - Boiling Blood
1205{
1207
1208 bool Load() override
1209 {
1210 return GetCaster()->GetTypeId() == TYPEID_UNIT;
1211 }
1212
1213 void FilterTargets(std::list<WorldObject*>& targets)
1214 {
1215 targets.remove(GetCaster()->GetVictim());
1216 if (targets.empty())
1217 return;
1218
1220 targets.clear();
1221 targets.push_back(target);
1222 }
1223
1228};
1229
1231{
1232 public:
1233 achievement_ive_gone_and_made_a_mess() : AchievementCriteriaScript("achievement_ive_gone_and_made_a_mess") { }
1234
1235 bool OnCheck(Player* /*source*/, Unit* target) override
1236 {
1237 if (target)
1238 if (Creature* saurfang = target->ToCreature())
1239 if (saurfang->AI()->GetData(DATA_MADE_A_MESS))
1240 return true;
1241
1242 return false;
1243 }
1244};
1245
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define ASSERT
Definition Errors.h:68
@ IN_PROGRESS
@ FAIL
@ WAYPOINT_MOTION_TYPE
@ POINT_MOTION_TYPE
@ TYPEID_UNIT
Definition ObjectGuid.h:38
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ 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:1130
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
void GetCreatureListWithEntryInGrid(Container &container, WorldObject *source, uint32 entry, float maxSearchRange)
void CloseGossipMenuFor(Player *player)
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ SPELL_EFFECT_FORCE_CAST
@ TARGET_UNIT_SRC_AREA_ENEMY
@ EMOTE_STATE_DROWNED
@ 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
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
#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)
@ UNIT_FLAG2_PLAY_DEATH_ANIM
@ UNIT_NPC_FLAG_GOSSIP
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
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
@ SPAWN_GROUP_ENTRANCE_THE_DAMNED_EVENT
@ GOSSIP_MENU_HIGH_OVERLORD_SAURFANG
@ GOSSIP_MENU_MURADIN_BRONZEBEARD
Position const finalPos
void AddSC_boss_deathbringer_saurfang()
Position const chokePos[6]
@ ACTION_MARK_OF_THE_FALLEN_CHAMPION
Position const firstStepPos
@ SAY_MARK_OF_THE_FALLEN_CHAMPION
void PreventDefaultAction()
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
InstanceScript *const instance
void _JustReachedHome()
bool CanAIAttack(Unit const *target) const override
SummonList summons
EventMap events
@ EVADE_REASON_OTHER
Definition CreatureAI.h:98
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:293
void SetImmuneToPC(bool apply) override
Definition Creature.h:129
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
bool IsImmuneToPC() const
Definition Unit.h:1137
CreatureAI * AI() const
Definition Creature.h:154
void Update(uint32 time)
Definition EventMap.h:67
EventId ExecuteEvent()
Definition EventMap.cpp:73
bool IsInPhase(PhaseIndex phase) const
Definition EventMap.h:236
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:28
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
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:3458
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false)
void MoveFall(uint32 id=0)
static Creature * ToCreature(Object *o)
Definition Object.h:186
TypeID GetTypeId() const
Definition Object.h:93
static Player * ToPlayer(Object *o)
Definition Object.h:180
Unit * GetActionTarget() const
Definition Unit.h:509
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
HookList< HitHandler > AfterHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
int32 GetEffectValue() const
HookList< EffectHandler > OnEffectHitTarget
Aura * GetHitAura(bool dynObjAura=false) const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
bool empty() const
void Despawn(Creature const *summon)
void Summon(Creature const *summon)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:30
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4439
void SetFaction(uint32 faction) override
Definition Unit.h:974
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:1098
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13286
void SetFacingToObject(WorldObject const *object, bool force=true, uint32 movementId=EVENT_FACE)
Definition Unit.cpp:13259
uint32 GetMaxPower(Powers power) const
Definition Unit.h:936
uint32 GetHealth() const
Definition Unit.h:913
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool force=false)
Definition Unit.cpp:9421
bool SetWalk(bool enable)
Definition Unit.cpp:13268
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
uint32 GetPower(Powers power) const
Definition Unit.h:934
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:954
Vehicle * GetVehicleKit() const
Definition Unit.h:1735
void RemoveAurasOnEvade()
Definition Unit.cpp:4218
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
Map * GetMap() const
Definition Object.h:449
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
void setActive(bool isActiveObject)
Definition Object.cpp:991
Transport * GetTransport() const
Definition Object.h:564
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnCheck(Player *, Unit *target) override
PrepareSpellScript(spell_deathbringer_blood_nova_targeting)
void FilterTargetsSubsequent(std::list< WorldObject * > &unitList)
void FilterTargetsInitial(std::list< WorldObject * > &targets)
void HandleScript(SpellEffIndex effIndex)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_deathbringer_blood_nova)
void RecalculateHook(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
PrepareAuraScript(spell_deathbringer_blood_power_aura)
PrepareSpellScript(spell_deathbringer_blood_power)
PrepareSpellScript(spell_deathbringer_boiling_blood)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_deathbringer_rune_of_blood)
@ 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:108
CastSpellExtraArgs & AddSpellBP0(int32 val)
float GetPositionZ() const
Definition Position.h:81
float GetOrientation() const
Definition Position.h:82
float GetPositionX() const
Definition Position.h:79
float GetPositionY() const
Definition Position.h:80
bool IsHeroic() const
void AttackStart(Unit *) override
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 GuardBroadcast(std::function< void(Creature *)> &&action) const
void MovementInform(uint32 type, uint32 id) 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