TrinityCore
Loading...
Searching...
No Matches
boss_garothi_worldbreaker.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 "AreaTriggerAI.h"
19#include "Containers.h"
20#include "CreatureAI.h"
21#include "CreatureAIImpl.h"
22#include "GridNotifiers.h"
23#include "InstanceScript.h"
24#include "Map.h"
25#include "ObjectAccessor.h"
26#include "ScriptMgr.h"
27#include "ScriptedCreature.h"
28#include "SpellAuras.h"
29#include "SpellScript.h"
30#include "SpellAuraEffects.h"
32
51
53{
54 // Garothi Worldbreaker
55 SPELL_MELEE = 248229,
76 SPELL_CARNAGE = 244106,
77
78 // Decimator
83
84 // Annihilator
89
90 // Annihilation
93
94 // Garothi Worldbreaker (Surging Fel)
97
98};
99
109
114
119
122
127
133
135{
137 {
138 public:
139 VictimCheck(Unit* caster, bool keepTank) : _caster(caster), _keepTank(keepTank) { }
140
142 {
143 Unit* unit = object->ToUnit();
144 if (!unit)
145 return true;
146
147 if (_caster->GetVictim() && _caster->GetVictim() != unit)
148 return _keepTank;
149
150 return false;
151 }
152 private:
154 bool _keepTank; // true = remove all nontank targets | false = remove current tank
155 };
156
157 void PreferNonTankTargetsAndResizeTargets(std::list<WorldObject*>& targets, Unit* caster)
158 {
159 if (targets.empty())
160 return;
161
162 std::list<WorldObject*> targetsCopy = targets;
163 uint8 size = targetsCopy.size();
164 // Selecting our prefered target size based on total targets (min 10 player: 2, max 30 player: 6)
165 uint8 preferedSize = std::min<uint8>(std::max<uint8>(std::ceil(size / 5), MIN_TARGETS_SIZE), MAX_TARGETS_SIZE);
166
167 // Now we get rid of the tank as these abilities prefer non-tanks above tanks as long as there are alternatives
168 targetsCopy.remove_if(TargetHandler::VictimCheck(caster, false));
169
170 // We have less available nontank targets than we want, include tanks
171 if (targetsCopy.size() < preferedSize)
172 Trinity::Containers::RandomResize(targets, preferedSize);
173 else
174 {
175 // Our target list has enough alternative targets, resize
176 Trinity::Containers::RandomResize(targetsCopy, preferedSize);
177 targets = targetsCopy;
178 }
179 }
180}
181
182static constexpr uint32 const MaxApocalypseDriveCount = 2;
183Position const AnnihilationCenterReferencePos = { -3296.72f, 9767.78f, -60.0f };
184
186{
194
195 void InitializeAI() override
196 {
197 switch (GetDifficulty())
198 {
203 break;
208 break;
209 default:
210 break;
211 }
212 }
213
218
229
239
240 void KilledUnit(Unit* victim) override
241 {
242 if (victim->IsPlayer())
243 Talk(SAY_SLAY, victim);
244 }
245
246 void JustDied(Unit* /*killer*/) override
247 {
248 _JustDied();
252 }
253
254 void OnSpellCast(SpellInfo const* spell) override
255 {
256 switch (spell->Id)
257 {
260 events.Reset();
262 HideCannons();
263 me->SetUninteractible(false);
264 break;
265 default:
266 break;
267 }
268 }
269
270 void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
271 {
272 if (damage >= me->GetHealth())
273 return;
274
276 {
277 me->AttackStop();
280 me->SetFacingTo(me->GetHomePosition().GetOrientation());
281 events.Reset();
282
283 if (IsHeroic() || IsMythic())
285
290 me->SetUninteractible(true);
291
292 if (Creature* decimator = instance->GetCreature(DATA_DECIMATOR))
293 {
295 decimator->SetUnitFlag(UNIT_FLAG_IN_COMBAT);
296 decimator->SetUninteractible(false);
297 }
298
299 if (Creature* annihilator = instance->GetCreature(DATA_ANNIHILATOR))
300 {
302 annihilator->SetUnitFlag(UNIT_FLAG_IN_COMBAT);
303 annihilator->SetUninteractible(false);
304 }
306 }
307 }
308
309 void JustSummoned(Creature* summon) override
310 {
311 summons.Summon(summon);
312 switch (summon->GetEntry())
313 {
314 case NPC_ANNIHILATION:
315 summon->CastSpell(summon, SPELL_ANNIHILATION_WARNING);
317 break;
318 case NPC_ANNIHILATOR:
319 case NPC_DECIMATOR:
321 break;
323 _surgingFelDummyGuids.insert(summon->GetGUID());
324 break;
325 default:
326 break;
327 }
328 }
329
364
365 uint32 GetData(uint32 type) const override
366 {
367 if (type == DATA_LAST_FIRED_CANNON)
368 return _lastCanonEntry;
369
370 return 0;
371 }
372
373 void SetData(uint32 type, uint32 value) override
374 {
375 if (type == DATA_LAST_FIRED_CANNON)
376 _lastCanonEntry = value;
377 }
378
379 void UpdateAI(uint32 diff) override
380 {
381 if (!UpdateVictim())
382 return;
383
384 events.Update(diff);
385
387 return;
388
389 while (uint32 eventId = events.ExecuteEvent())
390 {
391 switch (eventId)
392 {
397 {
401 _castEradication = false;
402 }
406 break;
409 events.Repeat(20s);
410 break;
413 break;
416 events.Repeat(16s);
417 break;
419 {
421 guids.erase(_lastSurgingFelDummyGuid);
424 dummy->CastSpell(dummy, SPELL_SURGING_FEL_AREA_TRIGGER);
425
426 events.Repeat(8s);
427 break;
428 }
429 default:
430 break;
431 }
432
434 return;
435 }
436
437 if (!me->GetVictim() || !me->GetVictim()->IsWithinMeleeRange(me))
439 }
440 private:
441 std::array<uint8, MaxApocalypseDriveCount> _apocalypseDriveHealthLimit;
448
462
464 {
465 if (Creature* decimator = instance->GetCreature(DATA_DECIMATOR))
466 {
468 decimator->SetUninteractible(true);
469 decimator->SetUnitFlag(UNIT_FLAG_IMMUNE);
470 }
471
472 if (Creature* annihilator = instance->GetCreature(DATA_ANNIHILATOR))
473 {
475 annihilator->SetUninteractible(true);
476 annihilator->SetUnitFlag(UNIT_FLAG_IMMUNE);
477 }
478 }
479};
480
482{
484 {
485 Initialize();
486 }
487
489 {
490 _playerCount = 0;
491 }
492
493 void OnUnitEnter(Unit* unit) override
494 {
495 if (!unit->IsPlayer())
496 return;
497
498 _playerCount++;
499
500 if (Unit* annihilation = at->GetCaster())
501 annihilation->RemoveAurasDueToSpell(SPELL_ANNIHILATION_WARNING);
502 }
503
504 void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override
505 {
506 if (!unit->IsPlayer())
507 return;
508
509 _playerCount--;
510
511 if (!_playerCount && !at->IsRemoved())
512 if (Unit* annihilation = at->GetCaster())
513 annihilation->CastSpell(annihilation, SPELL_ANNIHILATION_WARNING);
514 }
515
516private:
518};
519
537
539{
540 bool Validate(SpellInfo const* /*spellInfo*/) override
541 {
542 return ValidateSpellInfo(
543 {
546 });
547 }
548
549 void FilterTargets(std::list<WorldObject*>& targets)
550 {
551 if (targets.empty())
552 return;
553
554 if (Unit* caster = GetCaster())
555 targets.remove_if(TargetHandler::VictimCheck(caster, true));
556 }
557
559 {
560 Creature* caster = GetCaster() ? GetCaster()->ToCreature() : nullptr;
561 if (!caster || !caster->IsAIEnabled())
562 return;
563
564 Unit* target = GetHitUnit();
565 caster->AI()->Talk(SAY_ANNOUNCE_FEL_BOMBARDMENT, target);
566 caster->CastSpell(target, SPELL_FEL_BOMBARDMENT_WARNING, true);
567 caster->CastSpell(target, SPELL_FEL_BOMBARDMENT_DUMMY, true);
568 }
569
575};
576
578{
579 bool Validate(SpellInfo const* /*spellInfo*/) override
580 {
582 }
583
584 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
585 {
586 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
587 if (Unit* caster = GetCaster())
588 caster->CastSpell(GetTarget(), SPELL_FEL_BOMBARDMENT_PERIODIC, true);
589 }
590
595};
596
598{
599 bool Validate(SpellInfo const* spellInfo) override
600 {
601 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
602 }
603
604 void HandlePeriodic(AuraEffect const* aurEff)
605 {
606 if (Unit* caster = GetCaster())
607 caster->CastSpell(GetTarget(), uint32(aurEff->GetSpellEffectInfo().CalcValueAsInt(caster)), true);
608 }
609
614};
615
633
665
667{
668 bool Validate(SpellInfo const* /*spellInfo*/) override
669 {
671 }
672
673 void FilterTargets(std::list<WorldObject*>& targets)
674 {
676 }
677
678 void HandleHit(SpellEffIndex /*effIndex*/)
679 {
680 if (Unit* caster = GetCaster())
681 {
682 caster->CastSpell(GetHitUnit(), SPELL_DECIMATION_WARNING, true);
683 if (Creature* decimator = caster->ToCreature())
684 if (decimator->IsAIEnabled())
685 decimator->AI()->Talk(SAY_ANNOUNCE_DECIMATION, GetHitUnit());
686 }
687 }
688
694};
695
697{
698 bool Validate(SpellInfo const* /*spellInfo*/) override
699 {
701 }
702
703 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
704 {
705 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
706 {
707 if (Unit* caster = GetCaster())
708 {
709 caster->CastSpell(GetTarget(), SPELL_DECIMATION_MISSILE, true);
710 if (!caster->HasUnitState(UNIT_STATE_CASTING))
711 caster->CastSpell(caster, SPELL_DECIMATION_CAST_VISUAL);
712 }
713 }
714 }
715
720};
721
723{
724 void HandleProc(AuraEffect* /*aurEff*/, ProcEventInfo& /*eventInfo`*/)
725 {
726 // Usually we could just handle this via spell_proc but since we want
727 // to silence the console message because it's not a spell trigger proc, we need a script here.
729 Remove();
730 }
731
736};
737
739{
740 bool Validate(SpellInfo const* spellInfo) override
741 {
742 return ValidateSpellEffect({ { spellInfo->Id, EFFECT_0 } }) && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValueAsInt()) });
743 }
744
745 void HandleHit(SpellEffIndex /*effIndex*/)
746 {
747 if (Unit* caster = GetCaster())
748 caster->CastSpell(GetHitUnit(), uint32(GetEffectInfo().CalcValueAsInt(caster)), true);
749 }
750
755};
756
758{
759 bool Validate(SpellInfo const* /*spellInfo*/) override
760 {
762 }
763
764 void HandleHit(SpellEffIndex /*effIndex*/)
765 {
766 Unit* target = GetHitUnit();
768 target->CastSpell(target, SPELL_ANNIHILATION_DAMAGE_UNSPLITTED, true);
769
770 target->RemoveAllAuras();
771 }
772
777};
778
780{
782 {
783 if (Unit* caster = GetCaster())
784 {
785 uint32 damageReduction = CalculatePct(GetHitDamage(), GetHitUnit()->GetDistance(caster));
786 SetHitDamage(GetHitDamage() - damageReduction);
787 }
788 }
789
794};
795
797{
798 bool Validate(SpellInfo const* /*spellInfo*/) override
799 {
801 }
802
803 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
804 {
805 if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
807 }
808
813};
814
816{
818 {
819 Creature* caster = GetHitCreature();
820 if (!caster || !caster->IsAIEnabled())
821 return;
822
823 InstanceScript* instance = caster->GetInstanceScript();
824 if (!instance)
825 return;
826
827 Creature* decimator = instance->GetCreature(DATA_DECIMATOR);
828 Creature* annihilator = instance->GetCreature(DATA_ANNIHILATOR);
829 uint32 lastCannonEntry = caster->AI()->GetData(DATA_LAST_FIRED_CANNON);
830
831 if ((lastCannonEntry == NPC_ANNIHILATOR && decimator) || (decimator && !annihilator))
832 {
833 decimator->CastSpell(decimator, SPELL_DECIMATION_SELECTOR, true);
834 caster->AI()->Talk(SAY_DECIMATION, decimator);
835 lastCannonEntry = NPC_DECIMATOR;
836 }
837 else if ((lastCannonEntry == NPC_DECIMATOR && annihilator) || (annihilator && !decimator))
838 {
839 uint8 count = caster->GetMap()->IsMythic() ? MAX_TARGETS_SIZE :
840 std::max<uint8>(MIN_TARGETS_SIZE, std::ceil(float(caster->GetMap()->GetPlayersCountExceptGMs()) / 5));
841
842 for (uint8 i = 0; i < count; i++)
843 {
844 float x = AnnihilationCenterReferencePos.GetPositionX() + cos(frand(0.0f, float(M_PI * 2))) * frand(15.0f, 30.0f);
845 float y = AnnihilationCenterReferencePos.GetPositionY() + sin(frand(0.0f, float(M_PI * 2))) * frand(15.0f, 30.0f);
846 float z = caster->GetMap()->GetHeight(caster->GetPhaseShift(), x, y, AnnihilationCenterReferencePos.GetPositionZ());
847 annihilator->CastSpell(Position{ x, y, z }, SPELL_ANNIHILATION_SUMMON, true);
848 }
849
850 annihilator->CastSpell(annihilator, SPELL_ANNIHILATION_DUMMY);
851 annihilator->CastSpell(annihilator, SPELL_ANNIHILATION_SELECTOR);
852 caster->AI()->Talk(SAY_ANNIHILATION);
853 lastCannonEntry = NPC_ANNIHILATOR;
854 }
855
856 caster->AI()->SetData(DATA_LAST_FIRED_CANNON, lastCannonEntry);
857 }
858
863};
864
AreaTriggerExitReason
Definition AreaTrigger.h:69
#define M_PI
Definition Common.h:118
@ DIFFICULTY_MYTHIC_RAID
Definition DBCEnums.h:947
@ DIFFICULTY_NORMAL_RAID
Definition DBCEnums.h:945
@ DIFFICULTY_HEROIC_RAID
Definition DBCEnums.h:946
@ DIFFICULTY_LFR_NEW
Definition DBCEnums.h:948
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
std::set< ObjectGuid > GuidSet
Definition ObjectGuid.h:432
Spells
Definition PlayerAI.cpp:32
float frand(float min, float max)
Definition Random.cpp:55
#define RegisterAreaTriggerAI(ai_name)
Definition ScriptMgr.h:1428
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_EFFECT_DUMMY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_DUMMY
@ SPELL_AURA_AREA_TRIGGER
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
@ SPELLVALUE_BASE_POINT0
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
EvadeReason
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
DamageEffectType
@ UNIT_FLAG_IN_COMBAT
@ UNIT_FLAG_IMMUNE
@ UNIT_STATE_CASTING
Definition Unit.h:276
T CalculatePct(T base, U pct)
Definition Util.h:72
@ NPC_GAROTHI_WORLDBREAKER
@ DATA_GAROTHI_WORLDBREAKER
#define RegisterAntorusTheBurningThroneCreatureAI(ai_name)
constexpr uint8 MAX_TARGETS_SIZE
@ SUMMON_GROUP_ID_SURGING_FEL
Position const AnnihilationCenterReferencePos
void AddSC_boss_garothi_worldbreaker()
@ SPELL_DECIMATION_CAST_VISUAL
@ SPELL_APOCALYPSE_DRIVE_FINAL_DAMAGE
@ SPELL_FEL_BOMBARDMENT_SELECTOR
@ SPELL_FEL_BOMBARDMENT_DUMMY
@ SPELL_ANNIHILATION_SUMMON
@ SPELL_ANNIHILATION_AREA_TRIGGER
@ SPELL_SEARING_BARRAGE_DUMMY_ANNIHILATOR
@ SPELL_SURGING_FEL_AREA_TRIGGER
@ SPELL_SEARING_BARRAGE_DUMMY_DECIMATOR
@ SPELL_FEL_BOMBARDMENT_PERIODIC
@ SPELL_ANNIHILATION_SELECTOR
@ SPELL_ANNIHILATOR_CANNON_EJECT
@ SPELL_DECIMATOR_CANNON_EJECT
@ SPELL_SEARING_BARRAGE_SELECTOR
@ SPELL_SEARING_BARRAGE_DECIMATOR
@ SPELL_ANNIHILATION_DAMAGE_UNSPLITTED
@ SPELL_DECIMATION_SELECTOR
@ SPELL_APOCALYPSE_DRIVE_PERIODIC_DAMAGE
@ SPELL_SEARING_BARRAGE_ANNIHILATOR
@ SPELL_FEL_BOMBARDMENT_WARNING
@ SPELL_SEARING_BARRAGE_DAMAGE_DECIMATOR
@ SPELL_SEARING_BARRAGE_DAMAGE_ANNIHILATOR
@ SPELL_ANNIHILATION_WARNING
static constexpr uint32 const MaxApocalypseDriveCount
@ ENCOUNTER_FRAME_INDEX_CANNONS
constexpr uint8 MIN_TARGETS_SIZE
@ ANIM_KIT_ID_CANNON_DESTROYED
@ SAY_ANNOUNCE_APOCALYPSE_DRIVE
@ SAY_ANNOUNCE_FEL_BOMBARDMENT
@ SAY_FINISH_APOCALYPSE_DRIVE
AreaTrigger *const at
bool IsRemoved() const
Unit * GetCaster() const
SpellEffectInfo const & GetSpellEffectInfo() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetCaster() const
Unit * GetTarget() const
HookList< EffectProcHandler > OnEffectProc
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
bool IsPlayer() const
Definition BaseEntity.h:173
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:388
void SetReactState(ReactStates st)
Definition Creature.h:174
CreatureAI * AI() const
Definition Creature.h:228
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
Creature * GetCreature(uint32 type)
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
uint32 GetPlayersCountExceptGMs() const
Definition Map.cpp:2679
float GetHeight(PhaseShift const &phaseShift, float x, float y, float z, bool vmap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH)
Definition Map.h:326
bool IsMythic() const
Definition Map.cpp:3332
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
Unit * ToUnit()
Definition Object.h:116
int32 CalcValueAsInt(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
uint32 const Id
Definition SpellInfo.h:328
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:588
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
static bool ValidateSpellEffect(std::initializer_list< std::pair< uint32, SpellEffIndex > > effects)
Creature * GetHitCreature() const
int32 GetHitDamage() const
Unit * GetCaster() const
int32 GetEffectValueAsInt() const
HookList< HitHandler > OnHit
Unit * GetHitUnit() const
SpellEffectInfo const & GetEffectInfo() const
HookList< EffectHandler > OnEffectHitTarget
void SetHitDamage(int32 damage)
SpellInfo const * GetSpellInfo() const
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
void Summon(Creature const *summon)
VictimCheck(Unit *caster, bool keepTank)
virtual void SetData(uint32 id, uint32 value)
Definition UnitAI.h:75
bool DoSpellAttackIfReady(uint32 spellId)
Definition UnitAI.cpp:61
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
virtual uint32 GetData(uint32 id) const
Definition UnitAI.h:74
Definition Unit.h:635
bool IsWithinMeleeRange(Unit const *obj) const
Definition Unit.h:710
void PlayOneShotAnimKitId(uint16 animKitId)
Definition Unit.cpp:11160
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3231
void SetUninteractible(bool apply)
Definition Unit.cpp:8564
bool IsAIEnabled() const
Definition Unit.h:666
uint64 GetHealth() const
Definition Unit.h:788
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
Unit * GetVictim() const
Definition Unit.h:726
void SetFacingTo(float const ori, bool force=true)
Definition Unit.cpp:13289
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
void RemoveAllAuras()
Definition Unit.cpp:4382
bool AttackStop()
Definition Unit.cpp:5965
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
PhaseShift & GetPhaseShift()
Definition Object.h:310
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:1507
bool Validate(SpellInfo const *spellInfo) override
void HandlePeriodic(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect *, ProcEventInfo &)
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *spellInfo) override
void FilterTargets(std::list< WorldObject * > &targets)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
bool Validate(SpellInfo const *) override
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
void PreferNonTankTargetsAndResizeTargets(std::list< WorldObject * > &targets, Unit *caster)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:67
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
constexpr float GetPositionZ() const
Definition Position.h:89
bool IsHeroic() const
bool IsMythic() const
void SetCombatMovement(bool allowMovement)
Difficulty GetDifficulty() const
void OnUnitEnter(Unit *unit) override
at_garothi_annihilation(AreaTrigger *areatrigger)
void OnUnitExit(Unit *unit, AreaTriggerExitReason) override
void JustEngagedWith(Unit *who) override
uint32 GetData(uint32 type) const override
void OnSpellCast(SpellInfo const *spell) override
void UpdateAI(uint32 diff) override
void SummonedCreatureDies(Creature *summon, Unit *) override
void KilledUnit(Unit *victim) override
std::array< uint8, MaxApocalypseDriveCount > _apocalypseDriveHealthLimit
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void SetData(uint32 type, uint32 value) override
void JustSummoned(Creature *summon) override
void EnterEvadeMode(EvadeReason) override