TrinityCore
Loading...
Searching...
No Matches
boss_xt002.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 "Containers.h"
20#include "InstanceScript.h"
21#include "Map.h"
22#include "MotionMaster.h"
23#include "PassiveAI.h"
24#include "ScriptedCreature.h"
25#include "SpellAuraEffects.h"
26#include "SpellMgr.h"
27#include "SpellScript.h"
28#include "ulduar.h"
29#include "Vehicle.h"
30
32{
39 SPELL_STAND = 37752,
41 SPELL_ENRAGE = 26662,
44
45 // XT-Toy Pile
49
50 // Heart of the Deconstructor
59
60 // Void Zone
62
63 // Life Spark
66 SPELL_SHOCK = 64230,
67
68 // XM-024 Pummeller
72
73 //Boombot
75 SPELL_BOOM = 62834,
76
77 // Achievement-related spells
79};
80
93
99
106
114
130
137
139{
140 PATH_XT002_IDLE = 10884320
142
143struct boss_xt002 : public BossAI
144{
145 boss_xt002(Creature* creature) : BossAI(creature, DATA_XT002)
146 {
147 Initialize();
148 }
149
151 {
152 _healthRecovered = false;
153 _gravityBombCasualty = false;
154 _hardMode = false;
156 }
157
159 {
160 switch (_exposeHeartPercent)
161 {
162 case 75:
164 break;
165 case 50:
167 break;
168 default:
170 break;
171 }
172 }
173
174 void Reset() override
175 {
176 _Reset();
179 Initialize();
180 }
181
182 void EnterEvadeMode(EvadeReason /*why*/) override
183 {
186 }
187
201
202 void DoAction(int32 action) override
203 {
204 if (action == ACTION_ENTER_HARD_MODE)
206 }
207
208 void KilledUnit(Unit* who) override
209 {
210 if (who->GetTypeId() == TYPEID_PLAYER)
211 Talk(SAY_SLAY);
212 }
213
214 void JustDied(Unit* /*killer*/) override
215 {
217 _JustDied();
218 me->SetUninteractible(false);
219 }
220
231
232 void DisposeHeart(bool isHardMode = false)
233 {
235
236 if (isHardMode)
237 {
240 }
241 else
242 {
245 }
246
249 me->SetUninteractible(false);
251 {
252 if (heart->IsAlive())
253 heart->AI()->DoAction(ACTION_DISPOSE_HEART);
254 else
255 heart->DespawnOrUnsummon();
256 }
257 }
258
268
269 void PassengerBoarded(Unit* who, int8 seatId, bool apply) override
270 {
271 if (!apply)
272 return;
273
274 if (who->GetEntry() == NPC_XS013_SCRAPBOT)
275 {
277 _healthRecovered = true;
278 }
279 else if (seatId == HEART_VEHICLE_SEAT_EXPOSED)
280 who->CastSpell(who, SPELL_EXPOSED_HEART); // Channeled
281 }
282
283 uint32 GetData(uint32 type) const override
284 {
285 switch (type)
286 {
287 case DATA_HARD_MODE:
288 return _hardMode ? 1 : 0;
290 return _healthRecovered ? 1 : 0;
292 return _gravityBombCasualty ? 1 : 0;
293 default:
294 return 0;
295 }
296 }
297
298 void SetData(uint32 type, uint32 data) override
299 {
300 switch (type)
301 {
303 if (!_hardMode)
304 {
305 uint32 transferHealth = data;
306 if (transferHealth >= me->GetHealth())
307 transferHealth = me->GetHealth() - 1;
308
309 me->ModifyHealth(-static_cast<int32>(transferHealth));
310 me->LowerPlayerDamageReq(transferHealth);
311 }
312 break;
314 _gravityBombCasualty = (data > 0) ? true : false;
315 break;
316 default:
317 break;
318 }
319 }
320
321 void UpdateAI(uint32 diff) override
322 {
323 if (!UpdateVictim())
324 return;
325
326 events.Update(diff);
327
329 return;
330
331 while (uint32 eventId = events.ExecuteEvent())
332 {
333 switch (eventId)
334 {
337 events.Repeat(Is25ManRaid() ? 16s : 20s);
338 break;
341 events.Repeat(Is25ManRaid() ? 16s : 20s);
342 break;
348 events.Repeat(1min);
349 break;
352 ExposeHeart();
353 events.Repeat(1s);
354 break;
355 case EVENT_SUBMERGE:
357 me->SetUninteractible(true);
360 heart->AI()->DoAction(ACTION_START_PHASE_HEART);
362 break;
364 DisposeHeart();
365 break;
366 case EVENT_ENRAGE:
369 break;
371 me->SetFullHealth();
374 _hardMode = true;
376 break;
380 break;
381 default:
382 break;
383 }
384
386 return;
387 }
388 }
389
390 void WaypointReached(uint32 waypointId, uint32 pathId) override
391 {
392 if (pathId != PATH_XT002_IDLE)
393 return;
394
395 if (waypointId == 3 || waypointId == 9)
396 {
398
399 scheduler.Schedule(11s, [this](TaskContext const& /*task*/)
400 {
402 });
403 }
404 else if (waypointId == 13)
405 {
407
408 scheduler.Schedule(30s, [this](TaskContext const& /*task*/)
409 {
411 });
412 }
413 }
414
415private:
416 bool _healthRecovered; // Did a scrapbot recover XT-002's health during the encounter?
417 bool _hardMode; // Are we in hard mode? Or: was the heart killed during phase 2?
418 bool _gravityBombCasualty; // Did someone die because of Gravity Bomb damage?
420};
421
423{
424 npc_xt002_heart(Creature* creature) : NullCreatureAI(creature), _instance(creature->GetInstanceScript()) { }
425
426 void Reset() override
427 {
428 me->SetRegenerateHealth(false);
429 }
430
431 void DoAction(int32 action) override
432 {
434 if (!xt002)
435 return;
436
437 if (action == ACTION_START_PHASE_HEART)
438 {
442 me->SetUninteractible(false);
444 }
445 else if (action == ACTION_DISPOSE_HEART)
446 {
447 DoCast(xt002, SPELL_HEART_RIDE_VEHICLE, true);
448 me->SetUninteractible(true);
450 }
451 }
452
453 void JustDied(Unit* /*killer*/) override
454 {
456 xt002->AI()->DoAction(ACTION_ENTER_HARD_MODE);
457 }
458
459private:
461};
462
464{
465 npc_scrapbot(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
466
467 void Reset() override
468 {
471
473 {
475 return;
476 }
477
479 xt002->AI()->JustSummoned(me);
480
482 Schedule(2s, [this](TaskContext const& /*StartMove*/)
483 {
485 me->GetMotionMaster()->MoveFollow(xt002, 0.0f, 0.0f);
486 })
487 .Schedule(1s, [this](TaskContext& checkXt002)
488 {
490 {
491 if (me->IsWithinMeleeRange(xt002))
492 {
494 _scheduler.Schedule(1s, [this](TaskContext const& /*ScrapRepair*/)
495 {
497 xt002->CastSpell(me, SPELL_SCRAP_REPAIR, true);
499 });
500 }
501 else
502 checkXt002.Repeat();
503 }
504 else
506 });
507 }
508
509 void UpdateAI(uint32 diff) override
510 {
511 _scheduler.Update(diff);
512 }
513
514private:
517
518};
519
521{
522 npc_pummeller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
523
524 void Reset() override
525 {
528
530 {
532 return;
533 }
534
536 xt002->AI()->JustSummoned(me);
537
539 Schedule(1s, [this](TaskContext const& /*StartMove*/)
540 {
543 })
544 .Schedule(17s, [this](TaskContext& trample)
545 {
547 trample.Repeat(11s);
548 })
549 .Schedule(19s, [this](TaskContext& arcingSmash)
550 {
552 arcingSmash.Repeat(8s);
553 })
554 .Schedule(19s, [this](TaskContext& upperCut)
555 {
557 upperCut.Repeat(14s);
558 });
559
560 }
561
562 void UpdateAI(uint32 diff) override
563 {
564 if (!UpdateVictim())
565 return;
566
567 _scheduler.Update(diff);
568 }
569
570private:
573};
574
575struct npc_boombot : public ScriptedAI
576{
577 npc_boombot(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _boomed(false) { }
578
579 void Reset() override
580 {
584
586 {
588 return;
589 }
590
592 xt002->AI()->JustSummoned(me);
593
595 Schedule(4s, [this](TaskContext const& /*StartMove*/)
596 {
598 me->GetMotionMaster()->MoveFollow(xt002, 0.0f, 0.0f);
599
600 })
601 .Schedule(1s, [this](TaskContext& checkXt002)
602 {
604 {
605 if (me->IsWithinMeleeRange(xt002))
607 else
608 checkXt002.Repeat();
609 }
610 else
612 });
613 }
614
615 void DamageTaken(Unit* /*who*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
616 {
617 if (damage >= (me->GetHealth() - me->GetMaxHealth() * 0.5f) && !_boomed)
618 {
619 _boomed = true; // Prevent recursive call
620 damage = 0;
622 }
623 }
624
625 void UpdateAI(uint32 diff) override
626 {
627 _scheduler.Update(diff);
628 }
629
630private:
634};
635
637{
638 npc_life_spark(Creature* creature) : ScriptedAI(creature) { }
639
640 void Reset() override
641 {
644 }
645
646 void JustEngagedWith(Unit* /*who*/) override
647 {
649 _scheduler.Schedule(12s, [this](TaskContext& spellShock)
650 {
652 spellShock.Repeat();
653 });
654 }
655
656 void UpdateAI(uint32 diff) override
657 {
658 if (!UpdateVictim())
659 return;
660
662 return;
663
664 _scheduler.Update(diff);
665 }
666
667private:
669};
670
672{
673 npc_xt_void_zone(Creature* creature) : PassiveAI(creature) { }
674
675 void JustAppeared() override
676 {
677 _scheduler.Schedule(2500ms, [this](TaskContext const& /*task*/)
678 {
680 });
681 }
682
683 void UpdateAI(uint32 diff) override
684 {
685 _scheduler.Update(diff);
686 }
687
688private:
690};
691
692// 63018, 65121 - Searing Light
694{
695 bool Validate(SpellInfo const* /*spell*/) override
696 {
698 }
699
700 void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
701 {
702 if (Unit* xt002 = GetCaster())
703 if (xt002->HasAura(aurEff->GetAmountAsInt())) // Heartbreak aura indicating hard mode
704 xt002->CastSpell(GetOwner(), SPELL_SUMMON_LIFE_SPARK, true);
705 }
706
711};
712
713// 63024, 64234 - Gravity Bomb
715{
716 bool Validate(SpellInfo const* /*spell*/) override
717 {
719 }
720
721 void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
722 {
723 if (Unit* xt002 = GetCaster())
724 if (xt002->HasAura(aurEff->GetAmountAsInt())) // Heartbreak aura indicating hard mode
725 xt002->CastSpell(GetOwner(), SPELL_SUMMON_VOID_ZONE, true);
726 }
727
728 void OnPeriodic(AuraEffect const* aurEff)
729 {
730 Unit* xt002 = GetCaster();
731 Unit* owner = GetTarget();
732 if (!xt002)
733 return;
734
735 if (aurEff->GetAmount() >= static_cast<SpellEffectValue>(owner->GetHealth()))
737 }
738
744};
745
746// 63025, 64233 - Gravity Bomb (Damage)
748{
749 void HandleScript(SpellEffIndex /*effIndex*/)
750 {
751 if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
752 if (InstanceScript* instance = GetCaster()->GetInstanceScript())
753 if (Creature* xt002 = instance->GetCreature(DATA_XT002))
754 xt002->AI()->SetData(DATA_GRAVITY_BOMB_CASUALTY, 1);
755 }
756
761};
762
763// 62791 - XT-002 Heart Overload Trigger Spell (SERVERSIDE)
765{
766 bool Validate(SpellInfo const* /*spell*/) override
767 {
768 return ValidateSpellInfo
769 ({
772 });
773 }
774
776 {
777 std::list<Creature*> possibleCreatures;
778 Unit* caster = GetCaster();
779 caster->GetCreatureListWithEntryInGrid(possibleCreatures, NPC_XT_TOY_PILE);
780 possibleCreatures.remove_if([caster](Creature* creature)
781 {
782 return caster->GetDistance2d(creature) < 60.0f;
783 });
784
785 if (possibleCreatures.empty())
786 return nullptr;
787
789 }
790
791 void HandleScript(SpellEffIndex /*effIndex*/)
792 {
793 Unit* caster = GetCaster();
794 if (Creature* toyPile = GetRandomToyPile())
795 {
796 caster->CastSpell(toyPile, SPELL_ENERGY_ORB, true);
797 caster->CastSpell(nullptr, SPELL_HEART_LIGHTNING_TETHER, true);
798 }
799 }
800
805};
806
807// 62826 - Energy Orb
809{
810 bool Validate(SpellInfo const* /*spell*/) override
811 {
812 return ValidateSpellInfo
813 ({
817 });
818 }
819
820 void HandleSummons(SpellEffIndex /*effIndex*/)
821 {
822 Unit* target = GetHitUnit();
823 if (target->GetEntry() != NPC_XT_TOY_PILE)
824 return;
825
826 target->CastSpell(target, SPELL_RECHARGE_BOOMBOT, true);
827
828 if (roll_chance(30))
829 target->CastSpell(target, SPELL_RECHARGE_PUMMELER, true);
830
831 for (uint8 i = 0; i < urand(5, 7); ++i)
832 target->CastSpell(target, SPELL_RECHARGE_SCRAPBOT, true);
833
835 base->AI()->Talk(SAY_SUMMON);
836 }
837
842};
843
844// 62775 - Tympanic Tantrum
846{
847 void FilterTargets(std::list<WorldObject*>& targets)
848 {
849 targets.remove_if([](WorldObject* object) -> bool
850 {
851 if (object->GetTypeId() == TYPEID_PLAYER)
852 return false;
853
854 if (Creature* creature = object->ToCreature())
855 return !creature->IsPet();
856
857 return true;
858 });
859 }
860
862 {
863 SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage()));
864 }
865
872};
873
874// 65032 - 321-Boombot Aura
876{
877 bool Validate(SpellInfo const* /*spellInfo*/) override
878 {
880 }
881
882 bool CheckProc(ProcEventInfo& eventInfo)
883 {
884 if (eventInfo.GetActionTarget()->GetEntry() != NPC_XS013_SCRAPBOT)
885 return false;
886 return true;
887 }
888
889 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
890 {
891 if (InstanceScript* instance = eventInfo.GetActor()->GetInstanceScript())
892 instance->DoCastSpellOnPlayers(SPELL_ACHIEVEMENT_CREDIT_NERF_SCRAPBOTS);
893 }
894
900};
901
902// 63849 - Exposed Heart
904{
905 bool Load() override
906 {
907 _damageAmount = 0;
908 return true;
909 }
910
911 void OnProc(AuraEffect* /*aurEff*/, ProcEventInfo& eventInfo)
912 {
914 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
915 if (!damageInfo || !damageInfo->GetDamage())
916 return;
917
918 _damageAmount += damageInfo->GetDamage();
919 }
920
921 void HandleLifeTransfer(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
922 {
923 if (InstanceScript* instance = GetTarget()->GetInstanceScript())
924 if (Creature* xt002 = instance->GetCreature(DATA_XT002))
925 xt002->AI()->SetData(DATA_TRANSFERED_HEALTH, _damageAmount);
926 }
927
933
934private:
936};
937
939{
940 public:
941 achievement_nerf_engineering() : AchievementCriteriaScript("achievement_nerf_engineering") { }
942
943 bool OnCheck(Player* /*source*/, Unit* target) override
944 {
945 if (!target || !target->GetAI())
946 return false;
947
948 return !(target->GetAI()->GetData(DATA_HEALTH_RECOVERED));
949 }
950};
951
953{
954 public:
955 achievement_heartbreaker() : AchievementCriteriaScript("achievement_heartbreaker") { }
956
957 bool OnCheck(Player* /*source*/, Unit* target) override
958 {
959 if (!target || !target->GetAI())
960 return false;
961
962 return target->GetAI()->GetData(DATA_HARD_MODE) != 0;
963 }
964};
965
967{
968 public:
969 achievement_nerf_gravity_bombs() : AchievementCriteriaScript("achievement_nerf_gravity_bombs") { }
970
971 bool OnCheck(Player* /*source*/, Unit* target) override
972 {
973 if (!target || !target->GetAI())
974 return false;
975
976 return !(target->GetAI()->GetData(DATA_GRAVITY_BOMB_CASUALTY));
977 }
978};
979
uint8_t uint8
Definition Define.h:156
int8_t int8
Definition Define.h:152
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
@ IN_PROGRESS
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
bool roll_chance(T chance)
Definition Random.h:55
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ EFFECT_2
@ TARGET_UNIT_SRC_AREA_ENEMY
@ EMOTE_STATE_SPELL_CHANNEL_OMNI
@ EMOTE_STATE_DANCE
@ EMOTE_ONESHOT_NONE
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ LOOT_MODE_HARD_MODE_1
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
EvadeReason
@ REACT_DEFENSIVE
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
@ UNIT_STATE_CASTING
Definition Unit.h:276
Yells
@ ACTION_ENTER_HARD_MODE
@ ACTION_START_PHASE_HEART
@ ACTION_DISPOSE_HEART
@ GROUP_SEARING_GRAVITY
@ HEART_VEHICLE_SEAT_EXPOSED
@ ACHIEV_MUST_DECONSTRUCT_FASTER
XT002Data
@ DATA_GRAVITY_BOMB_CASUALTY
@ DATA_TRANSFERED_HEALTH
@ DATA_HEALTH_RECOVERED
@ DATA_HARD_MODE
@ SAY_DEATH
@ SAY_HEART_OPENED
@ EMOTE_HEART_CLOSED
@ SAY_AGGRO
@ SAY_TYMPANIC_TANTRUM
@ EMOTE_SCRAPBOT
@ EMOTE_TYMPANIC_TANTRUM
@ SAY_SLAY
@ EMOTE_HEART_OPENED
@ SAY_HEART_CLOSED
@ SAY_SUMMON
@ SAY_BERSERK
@ SPELL_EXPOSED_HEART
@ SPELL_TRAMPLE
@ SPELL_SUMMON_LIFE_SPARK
@ SPELL_ACHIEVEMENT_CREDIT_NERF_SCRAPBOTS
@ SPELL_STATIC_CHARGED
@ SPELL_RECHARGE_SCRAPBOT
@ SPELL_HEART_OVERLOAD
@ SPELL_SEARING_LIGHT
@ SPELL_COOLDOWN_CREATURE_SPECIAL_2
@ SPELL_321_BOOMBOT_AURA
@ SPELL_ENRAGE
@ SPELL_HEARTBREAK
@ SPELL_SHOCK
@ SPELL_GRAVITY_BOMB
@ SPELL_ENERGY_ORB
@ SPELL_RECHARGE_PUMMELER
@ SPELL_BOOM
@ SPELL_STAND
@ SPELL_HEART_RIDE_VEHICLE
@ SPELL_TYMPANIC_TANTRUM
@ SPELL_RECHARGE_BOOMBOT
@ SPELL_SCRAPBOT_RIDE_VEHICLE
@ SPELL_SUMMON_VOID_ZONE
@ SPELL_CONSUMPTION
@ SPELL_HEART_LIGHTNING_TETHER
@ SPELL_ARCANE_POWER_STATE
@ SPELL_ARCING_SMASH
@ SPELL_SCRAP_REPAIR
@ SPELL_FULL_HEAL
@ SPELL_SUBMERGE
@ SPELL_UPPERCUT
@ SPELL_RIDE_VEHICLE_EXPOSED
XT002Phases
@ PHASE_HEART
@ PHASE_1
XT002Paths
@ PATH_XT002_IDLE
void AddSC_boss_xt002()
@ EVENT_PHASE_CHECK
@ EVENT_SEARING_LIGHT
@ EVENT_ENTER_HARD_MODE
@ EVENT_DISPOSE_HEART
@ EVENT_ENRAGE
@ EVENT_GRAVITY_BOMB
@ EVENT_RESUME_ATTACK
@ EVENT_TYMPANIC_TANTRUM
@ EVENT_SUBMERGE
int32 GetAmountAsInt() const
SpellEffectValue GetAmount() const
void PreventDefaultAction()
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
WorldObject * GetOwner() const
Unit * GetCaster() const
Unit * GetTarget() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectProcHandler > OnEffectProc
HookList< AuraProcHandler > OnProc
TypeID GetTypeId() const
Definition BaseEntity.h:166
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
TaskScheduler scheduler
SummonList summons
EventMap events
void DoZoneInCombat()
Definition CreatureAI.h:169
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetReactState(ReactStates st)
Definition Creature.h:174
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetRegenerateHealth(bool value)
Definition Creature.h:373
void AddLootMode(uint16 lootMode)
Definition Creature.h:320
void LowerPlayerDamageReq(uint64 unDamage)
uint32 GetDamage() const
Definition Unit.h:452
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void DelayEvents(Milliseconds delay)
Definition EventMap.cpp:100
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void CancelEvent(uint32 eventId)
Definition EventMap.cpp:135
void SetPhase(uint8 phase)
Definition EventMap.cpp:32
Creature * GetCreature(uint32 type)
EncounterState GetBossState(uint32 id) const
void TriggerGameEvent(uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr) override
void MoveFollow(Unit *target, float dist, Optional< ChaseAngle > angle={}, Optional< Milliseconds > duration={}, bool ignoreTargetWalk=false, MovementSlot slot=MOTION_SLOT_ACTIVE, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
Unit * GetActionTarget() const
Definition Unit.h:500
DamageInfo * GetDamageInfo() const
Definition Unit.h:511
Unit * GetActor() const
Definition Unit.h:499
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
int32 GetHitDamage() const
Unit * GetCaster() const
HookList< HitHandler > OnHit
HookList< EffectHandler > OnEffectHit
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
void SetHitDamage(int32 damage)
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
virtual void SetData(uint32 id, uint32 value)
Definition UnitAI.h:75
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
virtual uint32 GetData(uint32 id) const
Definition UnitAI.h:74
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:89
Definition Unit.h:635
bool IsWithinMeleeRange(Unit const *obj) const
Definition Unit.h:710
int64 ModifyHealth(int64 val)
Definition Unit.cpp:8599
void SetFullHealth()
Definition Unit.h:802
Creature * GetVehicleCreatureBase() const
Definition Unit.cpp:12132
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
UnitAI * GetAI() const
Definition Unit.h:668
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
void SetEmoteState(Emote emote)
Definition Unit.h:865
uint64 GetMaxHealth() const
Definition Unit.h:789
uint64 GetHealth() const
Definition Unit.h:788
bool HealthBelowPct(float pct) const
Definition Unit.h:792
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:846
bool AttackStop()
Definition Unit.cpp:5965
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:847
InstanceScript * GetInstanceScript() const
Definition Object.cpp:396
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
Definition Object.cpp:2658
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
float GetDistance2d(WorldObject const *obj) const
Definition Object.cpp:450
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
bool OnCheck(Player *, Unit *target) override
void HandleProc(AuraEffect *, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleSummons(SpellEffIndex)
void Register() override
bool Validate(SpellInfo const *) override
void OnProc(AuraEffect *, ProcEventInfo &eventInfo)
void HandleLifeTransfer(AuraEffect const *, AuraEffectHandleModes)
void OnPeriodic(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
void HandleScript(SpellEffIndex)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void OnRemove(AuraEffect const *aurEff, AuraEffectHandleModes)
void FilterTargets(std::list< WorldObject * > &targets)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
bool Is25ManRaid() const
void ChangeNextExpose()
void Reset() override
bool _gravityBombCasualty
uint8 _exposeHeartPercent
void UpdateAI(uint32 diff) override
void RescheduleEvents()
void WaypointReached(uint32 waypointId, uint32 pathId) override
void DisposeHeart(bool isHardMode=false)
void JustDied(Unit *) override
void DoAction(int32 action) override
void ExposeHeart()
bool _healthRecovered
uint32 GetData(uint32 type) const override
void PassengerBoarded(Unit *who, int8 seatId, bool apply) override
== Fields =======================================
void JustEngagedWith(Unit *who) override
void Initialize()
void EnterEvadeMode(EvadeReason) override
void SetData(uint32 type, uint32 data) override
void KilledUnit(Unit *who) override
boss_xt002(Creature *creature)
void UpdateAI(uint32 diff) override
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
npc_boombot(Creature *creature)
InstanceScript * _instance
TaskScheduler _scheduler
void Reset() override
void Reset() override
void UpdateAI(uint32 diff) override
npc_life_spark(Creature *creature)
TaskScheduler _scheduler
void JustEngagedWith(Unit *) override
npc_pummeller(Creature *creature)
InstanceScript * _instance
void UpdateAI(uint32 diff) override
TaskScheduler _scheduler
void Reset() override
npc_scrapbot(Creature *creature)
void Reset() override
TaskScheduler _scheduler
void UpdateAI(uint32 diff) override
InstanceScript * _instance
void Reset() override
void DoAction(int32 action) override
void JustDied(Unit *) override
InstanceScript * _instance
npc_xt002_heart(Creature *creature)
void UpdateAI(uint32 diff) override
npc_xt_void_zone(Creature *creature)
void JustAppeared() override
TaskScheduler _scheduler
@ DATA_XT002
Definition ulduar.h:40
@ DATA_XT002_HEART
Definition ulduar.h:406
#define RegisterUlduarCreatureAI(ai_name)
Definition ulduar.h:524
@ NPC_XT_TOY_PILE
Definition ulduar.h:67
@ NPC_XS013_SCRAPBOT
Definition ulduar.h:99