TrinityCore
Loading...
Searching...
No Matches
boss_hadronox.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 "azjol_nerub.h"
20#include "InstanceScript.h"
21#include "Map.h"
22#include "MotionMaster.h"
23#include "ObjectAccessor.h"
24#include "ScriptedCreature.h"
25#include "SpellAuraEffects.h"
26#include "SpellAuras.h"
27#include "SpellScript.h"
28#include "TemporarySummon.h"
29
31{
32 // Hadronox
38
39 // Anub'ar Crusher
41
42 // Anub'ar foes - Shared
44
45 // Anub'ar Champion
48
49 // Anub'ar Crypt Guard
52
53 // Anub'ar Necromancer
56};
57
59{
60 // Hadronox
68
69 // Anub'ar opponent summoning spells
79
80 // Anub'ar Crusher
81 SPELL_SMASH = 53318,
82 SPELL_FRENZY = 53801,
83
84 // Anub'ar foes - Shared
85 SPELL_TAUNT = 53798,
86
87 // Anub'ar Champion
88 SPELL_REND = 59343,
89 SPELL_PUMMEL = 59344,
90
91 // Anub'ar Crypt Guard
94
95 // Anub'ar Necromancer
99};
100
107
114
121
123{
124 NPC_CRUSHER = 28922,
127
134
135// Movement IDs used by the permanently spawning Anub'ar opponents - they are done in sequence, as one finishes, the next one starts
137{
142 MOVE_HADRONOX, // this one might have us take a detour to avoid pathfinding "through" the floor...
143 MOVE_HADRONOX_REAL // while this one will always make us movechase
145
146static const uint8 NUM_STEPS = 4;
148{
149 { 515.5848f, 544.2007f, 673.6272f },
150 { 562.191f , 514.068f , 696.4448f },
151 { 610.3828f, 518.6407f, 695.9385f },
152 { 530.42f , 560.003f, 733.0308f }
153};
154
155struct boss_hadronox : public BossAI
156{
158
160 {
161 for (auto const& pair : me->GetCombatManager().GetPvECombatRefs())
162 if (pair.second->GetOther(me)->IsControlledByPlayer())
163 return true;
164 return false;
165 }
166
167 void SetStep(uint8 step)
168 {
170 return;
171
172 _step = step;
176 me->AttackStop();
178 }
179
181 {
182 std::list<TempSummon*> summoned;
183 me->SummonCreatureGroup(group, &summoned);
184 for (TempSummon* summon : summoned)
185 {
186 summon->AI()->SetData(DATA_CRUSHER_PACK_ID, group);
187 summon->AI()->DoAction(ACTION_PACK_WALK);
188 }
189 }
190
191 void MovementInform(uint32 type, uint32 /*id*/) override
192 {
193 if (type != POINT_MOTION_TYPE)
194 return;
196 if (_step < NUM_STEPS-1)
197 return;
200 _doorsWebbed = true;
202 }
203
204 uint32 GetData(uint32 data) const override
205 {
207 return _enteredCombat ? 1 : 0;
208 if (data == DATA_HADRONOX_WEBBED_DOORS)
209 return _doorsWebbed ? 1 : 0;
210 return 0;
211 }
212
213 bool CanAIAttack(Unit const* target) const override
214 {
215 // Prevent Hadronox from going too far from her current home position
216 if (!target->IsControlledByPlayer() && target->GetDistance(me->GetHomePosition()) > 70.0f)
217 return false;
218 return BossAI::CanAIAttack(target);
219 }
220
230
231 void DoAction(int32 action) override
232 {
233 switch (action)
234 {
236 if (_enteredCombat)
237 break;
239 _enteredCombat = true;
242 break;
244 if (_step < NUM_STEPS-1)
245 {
246 SetStep(_step + 1);
248 }
249 break;
250 }
251 }
252
253 void EnterEvadeMode(EvadeReason /*why*/) override
254 {
255 std::list<Creature*> triggers;
257 for (Creature* trigger : triggers)
258 if (trigger->HasAura(SPELL_SUMMON_CHAMPION_PERIODIC) || trigger->HasAura(SPELL_WEB_FRONT_DOORS) || trigger->HasAura(SPELL_WEB_SIDE_DOORS))
259 _DespawnAtEvade(25s, trigger);
260 _DespawnAtEvade(25s);
262 for (ObjectGuid gNerubian : _anubar)
263 if (Creature* nerubian = ObjectAccessor::GetCreature(*me, gNerubian))
264 nerubian->DespawnOrUnsummon();
265 }
266
267 void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
268 {
269 _anubar.push_back(guid);
270 }
271
272 void InitializeAI() override
273 {
276 me->SetBoundingRadius(9.0f);
277 me->SetCombatReach(9.0f);
278 _enteredCombat = false;
279 _doorsWebbed = false;
281 SetStep(0);
282 }
283
290
291 void UpdateAI(uint32 diff) override
292 {
293 if (!UpdateVictim())
294 return;
295
296 events.Update(diff);
297
299 return;
300
301 while (uint32 eventId = events.ExecuteEvent())
302 {
303 switch (eventId)
304 {
308 break;
309 case EVENT_ACID_CLOUD:
310 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
311 DoCast(target, SPELL_ACID_CLOUD);
313 break;
314 case EVENT_WEB_GRAB:
317 break;
321 break;
324 {
326 if (_lastPlayerCombatState) // we are now in combat with players
327 {
329 {
331 return;
332 }
333 // cancel current point movement if engaged by players
335 {
337 SetCombatMovement(true);
339 }
340 }
341 else // we are no longer in combat with players - reset the encounter
343 }
345 break;
346 }
347
349 return;
350 }
351
353 }
354
355 // Safeguard to prevent Hadronox dying to NPCs
356 void DamageTaken(Unit* who, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
357 {
358 if ((!who || !who->IsControlledByPlayer()) && me->HealthBelowPct(70))
359 {
360 if (me->HealthBelowPctDamaged(5, damage))
361 damage = 0;
362 else
363 damage *= (me->GetHealthPct()-5.0f)/ 65.0f;
364 }
365 }
366
367 void JustSummoned(Creature* summon) override
368 {
369 summons.Summon(summon);
370 // Do not enter combat with zone
371 }
372
373 private:
374 bool _enteredCombat; // has a player entered combat with the first crusher pack? (talk and spawn two more packs)
375 bool _doorsWebbed; // obvious - have we reached the top and webbed the doors shut? (trigger for hadronox denied achievement)
376 bool _lastPlayerCombatState; // was there a player in our threat list the last time we checked (we check every second)
378 std::list<ObjectGuid> _anubar;
379};
380
382{
383 npc_hadronox_crusherPackAI(Creature* creature, Position const* positions) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _positions(positions), _myPack(SummonGroups(0)), _doFacing(false) { }
384
385 void DoAction(int32 action) override
386 {
387 if (action == ACTION_PACK_WALK)
388 {
389 switch (_myPack)
390 {
395 break;
396 default:
397 break;
398 }
399 }
400 }
401
402 void MovementInform(uint32 type, uint32 id) override
403 {
404 if (type == POINT_MOTION_TYPE && id == ACTION_PACK_WALK)
405 _doFacing = true;
406 }
407
408 void EnterEvadeMode(EvadeReason /*why*/) override
409 {
411 hadronox->AI()->EnterEvadeMode(EVADE_REASON_OTHER);
412 }
413
414 uint32 GetData(uint32 data) const override
415 {
416 if (data == DATA_CRUSHER_PACK_ID)
417 return _myPack;
418 return 0;
419 }
420
421 void SetData(uint32 data, uint32 value) override
422 {
423 if (data == DATA_CRUSHER_PACK_ID)
424 {
425 _myPack = SummonGroups(value);
427 }
428 }
429
430 void JustEngagedWith(Unit* who) override
431 {
433 {
434 std::list<Creature*> others;
435 me->GetCreatureListWithEntryInGrid(others, 0, 40.0f);
436 for (Creature* other : others)
437 if (other->AI()->GetData(DATA_CRUSHER_PACK_ID) == _myPack)
438 {
439 other->SetReactState(REACT_AGGRESSIVE);
440 other->AI()->AttackStart(who);
441 }
442 }
445 }
446
447 virtual void _JustEngagedWith() = 0;
448 virtual void DoEvent(uint32 /*eventId*/) = 0;
449
450 void MoveInLineOfSight(Unit* who) override
451 {
453 {
455 return;
456 }
457
458 if (me->CanStartAttack(who, false) && me->IsWithinDistInMap(who, me->GetAttackDistance(who) + me->m_CombatDistance))
459 JustEngagedWith(who);
460 }
461
462 void UpdateAI(uint32 diff) override
463 {
464 if (_doFacing)
465 {
466 _doFacing = false;
468 }
469
470 if (!UpdateVictim())
471 return;
472
473 _events.Update(diff);
474
475 while (uint32 eventId = _events.ExecuteEvent())
476 DoEvent(eventId);
477
479 }
480
481 protected:
484 Position const* const _positions;
487
488};
489
491{
492 { 529.6913f, 547.1257f, 731.9155f, 4.799650f },
493 { 517.51f , 561.439f , 734.0306f, 4.520403f },
494 { 543.414f , 551.728f , 732.0522f, 3.996804f }
495};
497{
499
500 void _JustEngagedWith() override
501 {
503
505 return;
506
508 {
509 if (hadronox->AI()->GetData(DATA_HADRONOX_ENTERED_COMBAT))
510 return;
511 hadronox->AI()->DoAction(ACTION_CRUSHER_ENGAGED);
512 }
513
515 }
516
517 void DamageTaken(Unit* /*source*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
518 {
519 if (_hadFrenzy || !me->HealthBelowPctDamaged(25, damage))
520 return;
521 _hadFrenzy = true;
524 }
525
526 void DoEvent(uint32 eventId) override
527 {
528 switch (eventId)
529 {
530 case EVENT_SMASH:
533 break;
534 }
535 }
536
537 void JustDied(Unit* killer) override
538 {
540 hadronox->AI()->DoAction(ACTION_HADRONOX_MOVE);
541 ScriptedAI::JustDied(killer);
542 }
543
544 private:
546};
547
549{
550 { 539.2076f, 549.7539f, 732.8668f, 4.55531f },
551 { 527.3098f, 559.5197f, 732.9407f, 4.742493f },
552 { }
553};
555{
557
558 void DoEvent(uint32 eventId) override
559 {
560 switch (eventId)
561 {
562 case EVENT_REND:
565 break;
566 case EVENT_PUMMEL:
569 break;
570 }
571 }
572
578};
579
581{
582 { 520.3911f, 548.7895f, 732.0118f, 5.0091f },
583 { },
584 { 550.9611f, 545.1674f, 731.9031f, 3.996804f }
585};
611
613{
614 { },
615 { 507.6937f, 563.3471f, 734.8986f, 4.520403f },
616 { 535.1049f, 552.8961f, 732.8441f, 3.996804f },
617};
643
644static const uint8 NUM_SPAWNS = 3;
646{
647 { 485.314606f, 611.418640f, 771.428406f },
648 { 575.760437f, 611.516418f, 771.427368f },
649 { 588.930725f, 598.233276f, 739.142151f }
650};
652{
653 { 513.574341f, 587.022156f, 736.229065f },
654 { 537.920410f, 580.436157f, 732.796692f },
655 { 601.289246f, 583.259644f, 725.443054f },
656};
658{
659 { 571.498718f, 576.978333f, 727.582947f },
660 { 571.498718f, 576.978333f, 727.582947f },
661 { }
662};
664{
665 npc_hadronox_foeAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _nextMovement(MOVE_OUTSIDE), _mySpawn(0) { }
666
667 void InitializeAI() override
668 {
671 hadronox->AI()->SetGUID(me->GetGUID());
672 }
673
674 void MovementInform(uint32 type, uint32 id) override
675 {
676 if (type == POINT_MOTION_TYPE)
677 _nextMovement = Movements(id+1);
678 }
679
680 void EnterEvadeMode(EvadeReason /*why*/) override
681 {
683 }
684
685 virtual void DoEvent(uint32 /*eventId*/) = 0;
686
687 void UpdateAI(uint32 diff) override
688 {
689 if (_nextMovement)
690 {
691 switch (_nextMovement)
692 {
693 case MOVE_OUTSIDE:
694 {
695 float dist = HUGE_VALF;
696 for (uint8 spawn = 0; spawn < NUM_SPAWNS; ++spawn)
697 {
698 float thisDist = initialMoves[spawn].GetExactDistSq(me);
699 if (thisDist < dist)
700 {
701 _mySpawn = spawn;
702 dist = thisDist;
703 }
704 }
705 me->GetMotionMaster()->MovePoint(MOVE_OUTSIDE, initialMoves[_mySpawn], false); // do not pathfind here, we have to pass through a "wall" of webbing
706 break;
707 }
708 case MOVE_DOWNSTAIRS:
710 break;
712 if (downstairsMoves2[_mySpawn].GetPositionX() > 0.0f) // might be unset for this spawn - if yes, skip
713 {
715 break;
716 }
717 [[fallthrough]];
718 case MOVE_HADRONOX:
720 {
721 static const float zCutoff = 702.0f;
723 if (hadronox && hadronox->IsAlive())
724 {
726 if (hadronox->GetPositionZ() < zCutoff)
727 {
729 break;
730 }
731 AttackStart(hadronox);
732 }
733 break;
734 }
735 default:
736 break;
737 }
739 }
740
741 if (!UpdateVictim())
742 return;
743
744 _events.Update(diff);
745
746 while (uint32 eventId = _events.ExecuteEvent())
747 DoEvent(eventId);
748
750 }
751
752 protected:
755
756 private:
759};
760
762{
764
765 void DoEvent(uint32 eventId) override
766 {
767 switch (eventId)
768 {
769 case EVENT_REND:
772 break;
773 case EVENT_PUMMEL:
776 break;
777 case EVENT_TAUNT:
780 break;
781 }
782 }
783
790};
791
793{
795
796 void DoEvent(uint32 eventId) override
797 {
798 switch (eventId)
799 {
803 break;
807 break;
808 case EVENT_TAUNT:
811 break;
812 }
813 }
814
821};
822
824{
826
827 void DoEvent(uint32 eventId) override
828 {
829 switch (eventId)
830 {
834 break;
838 break;
839 case EVENT_TAUNT:
842 break;
843 }
844 }
845
852};
853
855{
856 public:
857 spell_hadronox_periodic_summon_template_AuraScript(uint32 topSpellId, uint32 bottomSpellId) : AuraScript(), _topSpellId(topSpellId), _bottomSpellId(bottomSpellId) { }
859
860 private:
861 bool Validate(SpellInfo const* /*spell*/) override
862 {
864 }
865
866 void HandleApply(AuraEffect const* /*eff*/, AuraEffectHandleModes /*mode*/)
867 {
868 if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
869 effect->SetPeriodicTimer(urandms(2, 17));
870 }
871
872 void HandlePeriodic(AuraEffect const* /*eff*/)
873 {
874 Unit* caster = GetCaster();
875 if (!caster)
876 return;
877 InstanceScript* instance = caster->GetInstanceScript();
878 if (!instance)
879 return;
880 if (!instance->instance->HavePlayers())
881 return;
882 if (instance->GetBossState(DATA_HADRONOX) == DONE)
883 GetAura()->Remove();
884 else
885 {
886 if (caster->GetPositionZ() >= 750.0f)
887 caster->CastSpell(caster, _topSpellId, true);
888 else
889 caster->CastSpell(caster, _bottomSpellId, true);
890 }
891 }
892
898
901};
902
903// 53035 - Summon Anub'ar Champion Periodic
920
921// 53037 - Summon Anub'ar Crypt Fiend Periodic
938
939// 53036 - Summon Anub'ar Necromancer Periodic
956
957// 53030, 59417 - Leech Poison
959{
961
962 bool Validate(SpellInfo const* /*spell*/) override
963 {
965 }
966
967 void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
968 {
969 if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
970 return;
971
972 if (GetTarget()->IsGuardian())
973 return;
974
975 if (Unit* caster = GetCaster())
976 caster->CastSpell(caster, SPELL_LEECH_POISON_HEAL, true);
977 }
978
983};
984
985// 53177 - Web Front Doors
986// 53185 - Web Side Door
988{
990
995
996 void HandleDummy(SpellEffIndex /*effIndex*/)
997 {
998 if (Unit* target = GetHitUnit())
999 {
1000 target->RemoveAurasDueToSpell(SPELL_SUMMON_CHAMPION_PERIODIC);
1001 target->RemoveAurasDueToSpell(SPELL_SUMMON_CRYPT_FIEND_PERIODIC);
1002 target->RemoveAurasDueToSpell(SPELL_SUMMON_NECROMANCER_PERIODIC);
1003 }
1004 }
1005
1010};
1011
1013{
1014 public:
1015 achievement_hadronox_denied() : AchievementCriteriaScript("achievement_hadronox_denied") { }
1016
1017 bool OnCheck(Player* /*player*/, Unit* target) override
1018 {
1019 if (!target)
1020 return false;
1021
1022 if (Creature* cTarget = target->ToCreature())
1023 if (!cTarget->AI()->GetData(DATA_HADRONOX_WEBBED_DOORS))
1024 return true;
1025
1026 return false;
1027 }
1028};
1029
Actions
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:27
@ IN_PROGRESS
@ DONE
@ POINT_MOTION_TYPE
Spells
Definition PlayerAI.cpp:32
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:62
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:42
uint32 urandms(uint32 min, uint32 max)
Definition Random.cpp:49
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
SpellEffIndex
@ EFFECT_0
@ SPELL_EFFECT_APPLY_AURA
@ AURA_REMOVE_BY_DEATH
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_PERIODIC_DUMMY
#define SpellEffectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraEffectRemoveFn(F, I, N, M)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
Creatures
@ DATA_HADRONOX
Definition azjol_nerub.h:32
#define RegisterAzjolNerubCreatureAI(ai_name)
Definition azjol_nerub.h:75
static const Position initialMoves[NUM_SPAWNS]
@ ACTION_CRUSHER_ENGAGED
@ ACTION_PACK_WALK
@ ACTION_HADRONOX_MOVE
@ NPC_WORLDTRIGGER_LARGE
@ NPC_CRUSHER
static const uint8 NUM_SPAWNS
static const Position necromancerWaypoints[]
@ SPELL_SUMMON_CRYPT_FIEND_BOTTOM
@ SPELL_SUMMON_NECROMANCER_BOTTOM
@ SPELL_CRUSHING_WEBS
@ SPELL_LEECH_POISON
@ SPELL_ACID_CLOUD
@ SPELL_SUMMON_CRYPT_FIEND_PERIODIC
@ SPELL_ANIMATE_BONES_1
@ SPELL_WEB_FRONT_DOORS
@ SPELL_SUMMON_NECROMANCER_TOP
@ SPELL_SUMMON_CHAMPION_TOP
@ SPELL_PUMMEL
@ SPELL_LEECH_POISON_HEAL
@ SPELL_TAUNT
@ SPELL_SUMMON_CRYPT_FIEND_TOP
@ SPELL_SHADOW_BOLT
@ SPELL_SMASH
@ SPELL_FRENZY
@ SPELL_WEB_GRAB
@ SPELL_SUMMON_NECROMANCER_PERIODIC
@ SPELL_REND
@ SPELL_SUMMON_CHAMPION_PERIODIC
@ SPELL_WEB_SIDE_DOORS
@ SPELL_ANIMATE_BONES_2
@ SPELL_PIERCE_ARMOR
@ SPELL_SUMMON_CHAMPION_BOTTOM
@ SPELL_INFECTED_WOUND
static const Position hadronoxStep[NUM_STEPS]
@ HADRONOX_EMOTE_MOVE
@ CRUSHER_EMOTE_FRENZY
@ CRUSHER_SAY_AGGRO
SummonGroups
@ SUMMON_GROUP_CRUSHER_3
@ SUMMON_GROUP_CRUSHER_2
@ SUMMON_GROUP_CRUSHER_1
static const uint8 NUM_STEPS
static const Position downstairsMoves[NUM_SPAWNS]
static const Position cryptFiendWaypoints[]
void AddSC_boss_hadronox()
static const Position crusherWaypoints[]
static const Position championWaypoints[]
Movements
@ MOVE_OUTSIDE
@ MOVE_HADRONOX
@ MOVE_DOWNSTAIRS_2
@ MOVE_DOWNSTAIRS
@ MOVE_NONE
@ MOVE_HADRONOX_REAL
@ DATA_HADRONOX_WEBBED_DOORS
@ DATA_CRUSHER_PACK_ID
@ DATA_HADRONOX_ENTERED_COMBAT
@ EVENT_INFECTED_WOUND
@ EVENT_LEECH_POISON
@ EVENT_ACID_CLOUD
@ EVENT_REND
@ EVENT_TAUNT
@ EVENT_SMASH
@ EVENT_PLAYER_CHECK
@ EVENT_PUMMEL
@ EVENT_PIERCE_ARMOR
@ EVENT_ANIMATE_BONES
@ EVENT_WEB_GRAB
@ EVENT_SHADOW_BOLT
@ EVENT_CRUSHING_WEBS
static const Position downstairsMoves2[NUM_SPAWNS]
Data
AuraApplication const * GetTargetApplication() const
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetCaster() const
AuraEffect * GetEffect(uint8 effIndex) const
Aura * GetAura() const
Unit * GetTarget() const
HookList< EffectApplyHandler > OnEffectRemove
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
InstanceScript *const instance
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
bool CanAIAttack(Unit const *target) const override
SummonList summons
EventMap events
std::unordered_map< ObjectGuid, CombatReference * > const & GetPvECombatRefs() const
virtual void MoveInLineOfSight(Unit *)
virtual void JustEngagedWith(Unit *)
Definition CreatureAI.h:127
@ EVADE_REASON_OTHER
Definition CreatureAI.h:98
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:94
@ EVADE_REASON_SEQUENCE_BREAK
Definition CreatureAI.h:97
virtual void JustDied(Unit *)
Definition CreatureAI.h:130
void DoZoneInCombat(Creature *creature=nullptr)
virtual void JustAppeared()
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:293
float GetAttackDistance(Unit const *player) const
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:295
bool HasReactState(ReactStates state) const
Definition Creature.h:121
void SetReactState(ReactStates st)
Definition Creature.h:119
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
float m_CombatDistance
Definition Creature.h:335
bool CanStartAttack(Unit const *u, bool force) const
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
InstanceMap * instance
EncounterState GetBossState(uint32 id) const
virtual bool CheckRequiredBosses(uint32, Player const *=nullptr) const
bool HavePlayers() const
Definition Map.h:437
MovementGeneratorType GetCurrentMovementGeneratorType() const
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
static Creature * ToCreature(Object *o)
Definition Object.h:186
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
void Summon(Creature const *summon)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
virtual void InitializeAI()
Definition UnitAI.cpp:36
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
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
float GetHealthPct() const
Definition Unit.h:921
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
bool IsAlive() const
Definition Unit.h:1234
void SetBoundingRadius(float boundingRadius)
Definition Unit.h:842
void SetCombatReach(float combatReach)
Definition Unit.h:840
bool HealthBelowPct(int32 pct) const
Definition Unit.h:917
Unit * GetVictim() const
Definition Unit.h:859
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void SetFacingTo(float ori, bool force=true, uint32 movementId=EVENT_FACE)
Definition Unit.cpp:13250
bool IsControlledByPlayer() const
Definition Unit.h:1258
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:918
CombatManager & GetCombatManager()
Definition Unit.h:1130
bool AttackStop()
Definition Unit.cpp:5645
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1087
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
Definition Object.cpp:3153
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
void setActive(bool isActiveObject)
Definition Object.cpp:991
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1192
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1123
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2082
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool OnCheck(Player *, Unit *target) override
bool Validate(SpellInfo const *) override
void HandleEffectRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_hadronox_leeching_poison)
AuraScript * GetAuraScript() const override
AuraScript * GetAuraScript() const override
AuraScript * GetAuraScript() const override
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
spell_hadronox_periodic_summon_template_AuraScript(uint32 topSpellId, uint32 bottomSpellId)
PrepareAuraScript(spell_hadronox_periodic_summon_template_AuraScript)
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_hadronox_web_doors)
void HandleDummy(SpellEffIndex)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
float GetPositionZ() const
Definition Position.h:81
float GetExactDistSq(float x, float y, float z) const
Definition Position.h:113
void AttackStart(Unit *) override
void SetCombatMovement(bool allowMovement)
bool IsInCombatWithPlayer() const
void DamageTaken(Unit *who, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustEngagedWith(Unit *) override
void DoAction(int32 action) override
void InitializeAI() override
void JustSummoned(Creature *summon) override
void MovementInform(uint32 type, uint32) override
void SetStep(uint8 step)
void SetGUID(ObjectGuid const &guid, int32) override
boss_hadronox(Creature *creature)
bool CanAIAttack(Unit const *target) const override
void JustAppeared() override
void EnterEvadeMode(EvadeReason) override
std::list< ObjectGuid > _anubar
uint32 GetData(uint32 data) const override
void SummonCrusherPack(SummonGroups group)
void UpdateAI(uint32 diff) override
void DoEvent(uint32 eventId) override
npc_anub_ar_champion(Creature *creature)
void JustEngagedWith(Unit *) override
void DoEvent(uint32 eventId) override
npc_anub_ar_crusher_champion(Creature *creature)
void DoEvent(uint32 eventId) override
npc_anub_ar_crusher_crypt_fiend(Creature *creature)
npc_anub_ar_crusher_necromancer(Creature *creature)
void DoEvent(uint32 eventId) override
npc_anub_ar_crusher(Creature *creature)
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void JustDied(Unit *killer) override
void _JustEngagedWith() override
void DoEvent(uint32 eventId) override
void DoEvent(uint32 eventId) override
void JustEngagedWith(Unit *) override
npc_anub_ar_crypt_fiend(Creature *creature)
void DoEvent(uint32 eventId) override
npc_anub_ar_necromancer(Creature *creature)
void JustEngagedWith(Unit *) override
InstanceScript *const _instance
void UpdateAI(uint32 diff) override
void MoveInLineOfSight(Unit *who) override
void DoAction(int32 action) override
virtual void _JustEngagedWith()=0
virtual void DoEvent(uint32)=0
void MovementInform(uint32 type, uint32 id) override
Position const *const _positions
npc_hadronox_crusherPackAI(Creature *creature, Position const *positions)
void SetData(uint32 data, uint32 value) override
void JustEngagedWith(Unit *who) override
void EnterEvadeMode(EvadeReason) override
uint32 GetData(uint32 data) const override
void MovementInform(uint32 type, uint32 id) override
virtual void DoEvent(uint32)=0
void EnterEvadeMode(EvadeReason) override
void InitializeAI() override
void UpdateAI(uint32 diff) override
InstanceScript *const _instance
npc_hadronox_foeAI(Creature *creature)