AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_hadronox Struct Reference
Inheritance diagram for boss_hadronox:
BossAI ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_hadronox (Creature *creature)
 
void Reset () override
 
void SummonedCreatureEvade (Creature *summon) override
 
void DoAction (int32 param) override
 
void SummonCrusherPack (const SummonGroups group)
 
void JustSummoned (Creature *summon) override
 
void KilledUnit (Unit *victim) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
bool IsInCombatWithPlayer () const
 
void DamageTaken (Unit *who, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void MovementInform (uint32 movementType, uint32 pointId) override
 
uint32 GetData (uint32 data) const override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCastFinished (SpellInfo const *spell, SpellFinishReason reason) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Attributes

uint8 _crushersLeft
 
bool _doorsWebbed
 
bool _lastPlayerCombatState
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_hadronox()

boss_hadronox::boss_hadronox ( Creature creature)
inlineexplicit
135: BossAI(creature, DATA_HADRONOX), _crushersLeft(0), _doorsWebbed(false), _lastPlayerCombatState(false) { }
@ DATA_HADRONOX
Definition azjol_nerub.h:30
Definition ScriptedCreature.h:482
bool _lastPlayerCombatState
Definition boss_hadronox.cpp:344
bool _doorsWebbed
Definition boss_hadronox.cpp:343
uint8 _crushersLeft
Definition boss_hadronox.cpp:342

Member Function Documentation

◆ DamageTaken()

void boss_hadronox::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

244 {
245 if ((!who || !who->IsControlledByPlayer()) && me->HealthBelowPct(70))
246 {
247 if (me->HealthBelowPctDamaged(5, damage))
248 damage = 0;
249 else
250 damage *= (me->GetHealthPct() - 5.0f) / 65.0f;
251 }
252 }
float GetHealthPct() const
Definition Unit.h:1095
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1101
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1102
Creature * me
Definition ScriptedCreature.h:281

References Unit::GetHealthPct(), Unit::HealthBelowPct(), Unit::HealthBelowPctDamaged(), Unit::IsControlledByPlayer(), and ScriptedAI::me.

◆ DoAction()

void boss_hadronox::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

162 {
163 if (param == ACTION_CRUSHER_DIED)
165 else if (param == ACTION_CRUSHER_ENGAGED)
166 {
168 return;
170 events.ScheduleEvent(EVENT_CHECK_EVADE, 5s);
173 events.ScheduleEvent(EVENT_HADRONOX_MOVE1, 0s);
174 events.ScheduleEvent(EVENT_HADRONOX_MOVE2, 45s);
175 events.ScheduleEvent(EVENT_HADRONOX_MOVE3, 70s);
176 }
177 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ ACTION_CRUSHER_DIED
Definition boss_hadronox.cpp:122
@ ACTION_CRUSHER_ENGAGED
Definition boss_hadronox.cpp:121
@ SUMMON_GROUP_CRUSHER_3
Definition boss_hadronox.cpp:106
@ SUMMON_GROUP_CRUSHER_2
Definition boss_hadronox.cpp:105
@ EVENT_HADRONOX_MOVE3
Definition boss_hadronox.cpp:68
@ EVENT_CHECK_EVADE
Definition boss_hadronox.cpp:78
@ EVENT_HADRONOX_MOVE1
Definition boss_hadronox.cpp:66
@ EVENT_HADRONOX_MOVE2
Definition boss_hadronox.cpp:67
events
Definition boss_sartura.cpp:43
InstanceScript *const instance
Definition ScriptedCreature.h:489
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:385
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:242
void SummonCrusherPack(const SummonGroups group)
Definition boss_hadronox.cpp:179

References _crushersLeft, ACTION_CRUSHER_DIED, ACTION_CRUSHER_ENGAGED, DATA_HADRONOX, EVENT_CHECK_EVADE, EVENT_HADRONOX_MOVE1, EVENT_HADRONOX_MOVE2, EVENT_HADRONOX_MOVE3, InstanceScript::GetBossState(), IN_PROGRESS, BossAI::instance, InstanceScript::SetBossState(), SUMMON_GROUP_CRUSHER_2, SUMMON_GROUP_CRUSHER_3, and SummonCrusherPack().

◆ GetData()

uint32 boss_hadronox::GetData ( uint32  data) const
inlineoverridevirtual

Reimplemented from UnitAI.

335 {
336 if (data == me->GetEntry()) // 'Hadronox Denied' achievement
337 return _doorsWebbed ? 0 : 1;
338 return 0;
339 }
uint32 GetEntry() const
Definition Object.h:116

References _doorsWebbed, Object::GetEntry(), and ScriptedAI::me.

◆ IsInCombatWithPlayer()

bool boss_hadronox::IsInCombatWithPlayer ( ) const
inline
237 {
238 return std::ranges::any_of(me->GetThreatMgr().GetThreatList(), [](auto const& ref) {
239 return ref->getTarget()->IsControlledByPlayer();
240 });
241 }
ThreatContainer::StorageType const & GetThreatList() const
Definition ThreatMgr.h:277
ThreatMgr & GetThreatMgr()
Definition Unit.h:943

References ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ JustEngagedWith()

void boss_hadronox::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

227 {
228 me->setActive(true);
229 events.RescheduleEvent(EVENT_HADRONOX_ACID, 10s);
230 events.RescheduleEvent(EVENT_HADRONOX_LEECH, 4s);
231 events.RescheduleEvent(EVENT_HADRONOX_PIERCE, 1s);
232 events.RescheduleEvent(EVENT_HADRONOX_GRAB, 15s);
233 events.RescheduleEvent(EVENT_CHECK_EVADE, 1s);
234 }
@ EVENT_HADRONOX_PIERCE
Definition boss_hadronox.cpp:72
@ EVENT_HADRONOX_LEECH
Definition boss_hadronox.cpp:71
@ EVENT_HADRONOX_ACID
Definition boss_hadronox.cpp:70
@ EVENT_HADRONOX_GRAB
Definition boss_hadronox.cpp:73
void setActive(bool isActiveObject)
Definition Object.cpp:1058

References EVENT_CHECK_EVADE, EVENT_HADRONOX_ACID, EVENT_HADRONOX_GRAB, EVENT_HADRONOX_LEECH, EVENT_HADRONOX_PIERCE, ScriptedAI::me, and WorldObject::setActive().

◆ JustSummoned()

void boss_hadronox::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

192 {
193 summons.Summon(summon);
194
195 switch (summon->GetEntry())
196 {
201 break;
205 // Xinef: cannot use pathfinding...
206 if (summon->GetDistance(477.0f, 618.0f, 771.0f) < 5.0f)
207 summon->GetMotionMaster()->MoveWaypoint(3000012, false);
208 else if (summon->GetDistance(583.0f, 617.0f, 771.0f) < 5.0f)
209 summon->GetMotionMaster()->MoveWaypoint(3000013, false);
210 else if (summon->GetDistance(581.0f, 608.5f, 739.0f) < 5.0f)
211 summon->GetMotionMaster()->MoveWaypoint(3000014, false);
212 break;
213 default:
214 break;
215 }
216 }
@ NPC_ANUB_AR_CRYPTFIEND
Definition azjol_nerub.h:56
@ NPC_ANUB_AR_CHAMPION
Definition azjol_nerub.h:54
@ NPC_ANUB_AR_NECROMANCER
Definition azjol_nerub.h:55
@ NPC_WORLD_TRIGGER_LAOI
Definition azjol_nerub.h:53
@ SPELL_SUMMON_ANUBAR_NECROMANCER_PERIODIC
Definition boss_hadronox.cpp:34
@ SPELL_SUMMON_ANUBAR_CHAMPION_PERIODIC
Definition boss_hadronox.cpp:33
@ SPELL_SUMMON_ANUBAR_CRYPT_FIEND_PERIODIC
Definition boss_hadronox.cpp:35
SummonList summons
Definition ScriptedCreature.h:534
void MoveWaypoint(uint32 path_id, bool repeatable, PathSource pathSource=PathSource::WAYPOINT_MGR)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:901
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
MotionMaster * GetMotionMaster()
Definition Unit.h:1738
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:19125
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1271

References Unit::AddAura(), WorldObject::GetDistance(), Object::GetEntry(), Unit::GetMotionMaster(), MotionMaster::MoveWaypoint(), NPC_ANUB_AR_CHAMPION, NPC_ANUB_AR_CRYPTFIEND, NPC_ANUB_AR_NECROMANCER, NPC_WORLD_TRIGGER_LAOI, SPELL_SUMMON_ANUBAR_CHAMPION_PERIODIC, SPELL_SUMMON_ANUBAR_CRYPT_FIEND_PERIODIC, SPELL_SUMMON_ANUBAR_NECROMANCER_PERIODIC, SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_hadronox::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

219 {
220 if (!me->IsAlive() || !victim->HasAura(SPELL_LEECH_POISON))
221 return;
222
223 me->ModifyHealth(static_cast<int32>(me->CountPctFromMaxHealth(10)));
224 }
std::int32_t int32
Definition Define.h:103
@ SPELL_LEECH_POISON
Definition boss_hadronox.cpp:41
int32 ModifyHealth(int32 val)
Definition Unit.cpp:14277
bool IsAlive() const
Definition Unit.h:1773
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5851
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1106

References Unit::CountPctFromMaxHealth(), Unit::HasAura(), Unit::IsAlive(), ScriptedAI::me, Unit::ModifyHealth(), and SPELL_LEECH_POISON.

◆ MovementInform()

void boss_hadronox::MovementInform ( uint32  movementType,
uint32  pointId 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

321 {
322 if (movementType != POINT_MOTION_TYPE)
323 return;
324
326
327 if (pointId == EVENT_HADRONOX_MOVE3)
328 {
330 _doorsWebbed = true;
331 }
332 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ REACT_AGGRESSIVE
Definition Unit.h:557
@ SPELL_WEB_FRONT_DOORS
Definition boss_hadronox.cpp:38
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:391

References _doorsWebbed, UnitAI::DoCastSelf(), EVENT_HADRONOX_MOVE3, ScriptedAI::me, POINT_MOTION_TYPE, REACT_AGGRESSIVE, Creature::SetReactState(), and SPELL_WEB_FRONT_DOORS.

◆ Reset()

void boss_hadronox::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

138 {
142 _doorsWebbed = false;
144 }
@ SUMMON_GROUP_CRUSHER_1
Definition boss_hadronox.cpp:104
@ SUMMON_GROUP_WORLD_TRIGGERS
Definition boss_hadronox.cpp:107
void Reset() override
Definition ScriptedCreature.h:519
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2429

References _doorsWebbed, _lastPlayerCombatState, ScriptedAI::me, BossAI::Reset(), SUMMON_GROUP_CRUSHER_1, SUMMON_GROUP_WORLD_TRIGGERS, WorldObject::SummonCreatureGroup(), and SummonCrusherPack().

◆ SummonCrusherPack()

void boss_hadronox::SummonCrusherPack ( const SummonGroups  group)
inline
180 {
181 std::list<TempSummon*> summoned;
182 me->SummonCreatureGroup(group, &summoned);
183 _crushersLeft = summoned.size();
184 for (TempSummon* summon : summoned)
185 {
186 summon->AI()->SetData(DATA_CRUSHER_PACK_ID, group);
187 summon->AI()->DoAction(ACTION_PACK_WALK);
188 }
189 }
@ ACTION_PACK_WALK
Definition boss_hadronox.cpp:123
@ DATA_CRUSHER_PACK_ID
Definition boss_hadronox.cpp:112
Definition TemporarySummon.h:40

References _crushersLeft, ACTION_PACK_WALK, DATA_CRUSHER_PACK_ID, ScriptedAI::me, and WorldObject::SummonCreatureGroup().

Referenced by DoAction(), and Reset().

◆ SummonedCreatureEvade()

void boss_hadronox::SummonedCreatureEvade ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

147 {
148 switch (summon->GetEntry())
149 {
155 break;
156 default:
157 break;
158 }
159 }
@ NPC_ANUB_AR_CRUSHER
Definition boss_hadronox.cpp:95
@ NPC_ANUB_AR_NECROMANCER_PACK
Definition boss_hadronox.cpp:98
@ NPC_ANUB_AR_CRYPT_FIEND_PACK
Definition boss_hadronox.cpp:97
@ NPC_ANUB_AR_CHAMPION_PACK
Definition boss_hadronox.cpp:96
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:521
@ EVADE_REASON_OTHER
Definition CreatureAI.h:94

References BossAI::EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, Object::GetEntry(), NPC_ANUB_AR_CHAMPION_PACK, NPC_ANUB_AR_CRUSHER, NPC_ANUB_AR_CRYPT_FIEND_PACK, and NPC_ANUB_AR_NECROMANCER_PACK.

◆ UpdateAI()

void boss_hadronox::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

255 {
256 events.Update(diff);
257
258 if (!UpdateVictim())
259 return;
260
262 return;
263
264 switch (uint32 eventId = events.ExecuteEvent())
265 {
268 events.Repeat(8s);
269 break;
271 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, false))
272 DoCast(target, SPELL_ACID_CLOUD);
273 events.Repeat(25s);
274 break;
277 events.Repeat(12s);
278 break;
281 events.Repeat(25s);
282 break;
284 if (_crushersLeft > 0)
285 {
286 events.Repeat(2s);
287 break;
288 }
289 [[fallthrough]];
295 me->AttackStop();
296 me->GetMotionMaster()->MovePoint(eventId, hadronoxSteps[eventId - 1]);
297 break;
300 {
303 {
307 }
308 else
310 }
311 events.Repeat(1s);
312 break;
313 default:
314 break;
315 }
316
318 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ REACT_PASSIVE
Definition Unit.h:555
@ SAY_HADRONOX_EMOTE
Definition boss_hadronox.cpp:119
@ SPELL_ACID_CLOUD
Definition boss_hadronox.cpp:40
@ SPELL_WEB_GRAB
Definition boss_hadronox.cpp:43
@ SPELL_PIERCE_ARMOR
Definition boss_hadronox.cpp:44
static const std::array< Position, 3 > hadronoxSteps
Definition boss_hadronox.cpp:126
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:90
bool UpdateVictim()
Definition CreatureAI.cpp:277
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition MotionMaster.cpp:949
void Clear(bool reset=true)
Definition MotionMaster.h:192
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:238
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:276
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:110
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:177
Definition Unit.h:655
bool HasUnitState(const uint32 f) const
Definition Unit.h:726
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:10618
Talk
Definition hyjal.cpp:82
bool IsInCombatWithPlayer() const
Definition boss_hadronox.cpp:236

References _crushersLeft, _lastPlayerCombatState, Unit::AttackStop(), MotionMaster::Clear(), UnitAI::DoCast(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), BossAI::EnterEvadeMode(), CreatureAI::EVADE_REASON_NO_HOSTILES, EVENT_CHECK_EVADE, EVENT_HADRONOX_ACID, EVENT_HADRONOX_GRAB, EVENT_HADRONOX_LEECH, EVENT_HADRONOX_MOVE1, EVENT_HADRONOX_MOVE2, EVENT_HADRONOX_MOVE3, EVENT_HADRONOX_PIERCE, MotionMaster::GetCurrentMovementGeneratorType(), Unit::GetMotionMaster(), hadronoxSteps, Unit::HasUnitState(), IsInCombatWithPlayer(), ScriptedAI::me, MotionMaster::MovePoint(), POINT_MOTION_TYPE, Random, REACT_AGGRESSIVE, REACT_PASSIVE, SAY_HADRONOX_EMOTE, UnitAI::SelectTarget(), Creature::SetReactState(), SPELL_ACID_CLOUD, SPELL_LEECH_POISON, SPELL_PIERCE_ARMOR, SPELL_WEB_GRAB, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _crushersLeft

uint8 boss_hadronox::_crushersLeft
private

◆ _doorsWebbed

bool boss_hadronox::_doorsWebbed
private

Referenced by GetData(), MovementInform(), and Reset().

◆ _lastPlayerCombatState

bool boss_hadronox::_lastPlayerCombatState
private

Referenced by Reset(), and UpdateAI().


The documentation for this struct was generated from the following file: