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 MoveDownRamp (Creature *summon)
 
void KilledUnit (Unit *victim) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
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 OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) 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 - this happens after JustEnteredCombat.
 
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 (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (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)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, 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 *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
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, int32 aura=0)
 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
Creature * me
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- 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)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_hadronox()

boss_hadronox::boss_hadronox ( Creature *  creature)
inlineexplicit
155: BossAI(creature, DATA_HADRONOX), _crushersLeft(0), _doorsWebbed(false), _lastPlayerCombatState(false) { }
@ DATA_HADRONOX
Definition azjol_nerub.h:30
Definition ScriptedCreature.h:496
bool _lastPlayerCombatState
Definition boss_hadronox.cpp:391
bool _doorsWebbed
Definition boss_hadronox.cpp:390
uint8 _crushersLeft
Definition boss_hadronox.cpp:389

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.

291 {
292 if ((!who || !who->IsControlledByPlayer()) && me->HealthBelowPct(70))
293 {
294 if (me->HealthBelowPctDamaged(5, damage))
295 damage = 0;
296 else
297 damage *= (me->GetHealthPct() - 5.0f) / 65.0f;
298 }
299 }
float GetHealthPct() const
Definition Unit.h:1124
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1130
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1131
Creature * me
Definition ScriptedCreature.h:292

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

◆ DoAction()

void boss_hadronox::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

182 {
183 if (param == ACTION_CRUSHER_DIED)
185 else if (param == ACTION_CRUSHER_ENGAGED)
186 {
188 return;
190 events.ScheduleEvent(EVENT_CHECK_EVADE, 5s);
193 events.ScheduleEvent(EVENT_HADRONOX_MOVE1, 0s);
194 events.ScheduleEvent(EVENT_HADRONOX_MOVE2, 45s);
195 events.ScheduleEvent(EVENT_HADRONOX_MOVE3, 70s);
196 }
197 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ ACTION_CRUSHER_DIED
Definition boss_hadronox.cpp:126
@ ACTION_CRUSHER_ENGAGED
Definition boss_hadronox.cpp:125
@ SUMMON_GROUP_CRUSHER_3
Definition boss_hadronox.cpp:110
@ SUMMON_GROUP_CRUSHER_2
Definition boss_hadronox.cpp:109
@ EVENT_HADRONOX_MOVE3
Definition boss_hadronox.cpp:72
@ EVENT_CHECK_EVADE
Definition boss_hadronox.cpp:82
@ EVENT_HADRONOX_MOVE1
Definition boss_hadronox.cpp:70
@ EVENT_HADRONOX_MOVE2
Definition boss_hadronox.cpp:71
events
Definition boss_sartura.cpp:43
InstanceScript *const instance
Definition ScriptedCreature.h:503
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:406
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
void SummonCrusherPack(const SummonGroups group)
Definition boss_hadronox.cpp:199

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.

382 {
383 if (data == me->GetEntry()) // 'Hadronox Denied' achievement
384 return _doorsWebbed ? 0 : 1;
385 return 0;
386 }
uint32 GetEntry() const
Definition Object.h:123

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

◆ IsInCombatWithPlayer()

bool boss_hadronox::IsInCombatWithPlayer ( ) const
inline
283 {
284 for (ThreatReference const* ref : me->GetThreatMgr().GetUnsortedThreatList())
285 if (ref->GetVictim()->IsControlledByPlayer())
286 return true;
287 return false;
288 }
Definition ThreatManager.h:267
ThreatManager & GetThreatMgr()
Definition UnitAI.cpp:381

References Unit::GetThreatMgr(), ThreatManager::GetUnsortedThreatList(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ JustEngagedWith()

void boss_hadronox::JustEngagedWith ( Unit *  )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

273 {
274 me->setActive(true);
275 events.RescheduleEvent(EVENT_HADRONOX_ACID, 10s);
276 events.RescheduleEvent(EVENT_HADRONOX_LEECH, 4s);
277 events.RescheduleEvent(EVENT_HADRONOX_PIERCE, 1s);
278 events.RescheduleEvent(EVENT_HADRONOX_GRAB, 15s);
279 events.RescheduleEvent(EVENT_CHECK_EVADE, 1s);
280 }
@ EVENT_HADRONOX_PIERCE
Definition boss_hadronox.cpp:76
@ EVENT_HADRONOX_LEECH
Definition boss_hadronox.cpp:75
@ EVENT_HADRONOX_ACID
Definition boss_hadronox.cpp:74
@ EVENT_HADRONOX_GRAB
Definition boss_hadronox.cpp:77
void setActive(bool isActiveObject)
Definition Object.cpp:1091

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.

212 {
213 summons.Summon(summon);
214
215 switch (summon->GetEntry())
216 {
221 break;
228 MoveDownRamp(summon);
229 break;
230 default:
231 break;
232 }
233 }
@ NPC_ANUB_AR_CRYPTFIEND
Definition azjol_nerub.h:56
@ NPC_ANUB_AR_NECROMANCER_LOWER
Definition azjol_nerub.h:60
@ NPC_ANUB_AR_CHAMPION_LOWER
Definition azjol_nerub.h:58
@ NPC_ANUB_AR_CHAMPION
Definition azjol_nerub.h:54
@ NPC_ANUB_AR_NECROMANCER
Definition azjol_nerub.h:55
@ NPC_ANUB_AR_CRYPT_FIEND_LOWER
Definition azjol_nerub.h:59
@ NPC_WORLD_TRIGGER_LAOI
Definition azjol_nerub.h:53
@ SPELL_SUMMON_ANUBAR_NECROMANCER_PERIODIC
Definition boss_hadronox.cpp:38
@ SPELL_SUMMON_ANUBAR_CHAMPION_PERIODIC
Definition boss_hadronox.cpp:37
@ SPELL_SUMMON_ANUBAR_CRYPT_FIEND_PERIODIC
Definition boss_hadronox.cpp:39
SummonList summons
Definition ScriptedCreature.h:550
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:14825
void MoveDownRamp(Creature *summon)
Definition boss_hadronox.cpp:235

References Unit::AddAura(), Object::GetEntry(), MoveDownRamp(), NPC_ANUB_AR_CHAMPION, NPC_ANUB_AR_CHAMPION_LOWER, NPC_ANUB_AR_CRYPT_FIEND_LOWER, NPC_ANUB_AR_CRYPTFIEND, NPC_ANUB_AR_NECROMANCER, NPC_ANUB_AR_NECROMANCER_LOWER, 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.

265 {
266 if (!me->IsAlive() || !victim->HasAura(SPELL_LEECH_POISON))
267 return;
268
269 me->ModifyHealth(static_cast<int32>(me->CountPctFromMaxHealth(10)));
270 }
std::int32_t int32
Definition Define.h:103
@ SPELL_LEECH_POISON
Definition boss_hadronox.cpp:45
int32 ModifyHealth(int32 val)
Definition Unit.cpp:10784
bool IsAlive() const
Definition Unit.h:1812
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5798
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1135

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

◆ MoveDownRamp()

void boss_hadronox::MoveDownRamp ( Creature *  summon)
inline
236 {
237 auto const& doorPath = *std::min_element(doorPaths.begin(), doorPaths.end(),
238 [summon](std::vector<Position> const& a, std::vector<Position> const& b)
239 {
240 return summon->GetExactDistSq(a.front()) < summon->GetExactDistSq(b.front());
241 });
242
244 path.emplace_back(summon->GetPositionX(), summon->GetPositionY(), summon->GetPositionZ());
245 path.emplace_back(doorPath.front().GetPositionX(), doorPath.front().GetPositionY(),
246 doorPath.front().GetPositionZ());
247
248 PathGenerator pathGenerator(summon);
249 for (std::size_t i = 1; i < doorPath.size(); ++i)
250 {
251 Position const& from = doorPath[i - 1];
252 Position const& to = doorPath[i];
253 bool const found = pathGenerator.CalculatePath(from.GetPositionX(), from.GetPositionY(),
254 from.GetPositionZ(), to.GetPositionX(), to.GetPositionY(), to.GetPositionZ(), false);
255 if (found && (pathGenerator.GetPathType() & PATHFIND_NORMAL))
256 path.insert(path.end(), std::next(pathGenerator.GetPath().begin()), pathGenerator.GetPath().end());
257 else
258 path.emplace_back(to.GetPositionX(), to.GetPositionY(), to.GetPositionZ());
259 }
260
262 }
@ FORCED_MOVEMENT_RUN
Definition MotionMaster.h:88
@ PATHFIND_NORMAL
Definition PathGenerator.h:47
static std::array< std::vector< Position >, 3 > const doorPaths
Definition boss_hadronox.cpp:137
void MoveSplinePath(Movement::PointsArray *path, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE)
Definition MotionMaster.cpp:504
Definition PathGenerator.h:59
MotionMaster * GetMotionMaster()
Definition Unit.h:1774
std::vector< Vector3 > PointsArray
Definition MoveSplineInitArgs.h:28
Definition Position.h:27
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References PathGenerator::CalculatePath(), doorPaths, FORCED_MOVEMENT_RUN, Unit::GetMotionMaster(), PathGenerator::GetPath(), PathGenerator::GetPathType(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), MotionMaster::MoveSplinePath(), and PATHFIND_NORMAL.

Referenced by JustSummoned().

◆ MovementInform()

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

Reimplemented from CreatureAI.

368 {
369 if (movementType != POINT_MOTION_TYPE)
370 return;
371
373
374 if (pointId == EVENT_HADRONOX_MOVE3)
375 {
377 _doorsWebbed = true;
378 }
379 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ REACT_AGGRESSIVE
Definition Unit.h:576
@ SPELL_WEB_FRONT_DOORS
Definition boss_hadronox.cpp:42
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:399

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.

158 {
162 _doorsWebbed = false;
164 }
@ SUMMON_GROUP_CRUSHER_1
Definition boss_hadronox.cpp:108
@ SUMMON_GROUP_WORLD_TRIGGERS
Definition boss_hadronox.cpp:111
void Reset() override
Definition ScriptedCreature.h:535
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2537

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
200 {
201 std::list<TempSummon*> summoned;
202 me->SummonCreatureGroup(group, &summoned);
203 _crushersLeft = summoned.size();
204 for (TempSummon* summon : summoned)
205 {
206 summon->AI()->SetData(DATA_CRUSHER_PACK_ID, group);
207 summon->AI()->DoAction(ACTION_PACK_WALK);
208 }
209 }
@ ACTION_PACK_WALK
Definition boss_hadronox.cpp:127
@ DATA_CRUSHER_PACK_ID
Definition boss_hadronox.cpp:116
Definition TemporarySummon.h:50

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.

167 {
168 switch (summon->GetEntry())
169 {
175 break;
176 default:
177 break;
178 }
179 }
@ NPC_ANUB_AR_CRUSHER
Definition boss_hadronox.cpp:99
@ NPC_ANUB_AR_NECROMANCER_PACK
Definition boss_hadronox.cpp:102
@ NPC_ANUB_AR_CRYPT_FIEND_PACK
Definition boss_hadronox.cpp:101
@ NPC_ANUB_AR_CHAMPION_PACK
Definition boss_hadronox.cpp:100
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:537
@ EVADE_REASON_OTHER
Definition CreatureAI.h:92

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.

302 {
303 events.Update(diff);
304
305 if (!UpdateVictim())
306 return;
307
309 return;
310
311 switch (uint32 eventId = events.ExecuteEvent())
312 {
315 events.Repeat(8s);
316 break;
318 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, false))
319 DoCast(target, SPELL_ACID_CLOUD);
320 events.Repeat(25s);
321 break;
324 events.Repeat(12s);
325 break;
328 events.Repeat(25s);
329 break;
331 if (_crushersLeft > 0)
332 {
333 events.Repeat(2s);
334 break;
335 }
336 [[fallthrough]];
342 me->AttackStop();
343 me->GetMotionMaster()->MovePoint(eventId, hadronoxSteps[eventId - 1]);
344 break;
347 {
350 {
354 }
355 else
357 }
358 events.Repeat(1s);
359 break;
360 default:
361 break;
362 }
363
365 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ REACT_PASSIVE
Definition Unit.h:574
@ SAY_HADRONOX_EMOTE
Definition boss_hadronox.cpp:123
@ SPELL_ACID_CLOUD
Definition boss_hadronox.cpp:44
@ SPELL_WEB_GRAB
Definition boss_hadronox.cpp:47
@ SPELL_PIERCE_ARMOR
Definition boss_hadronox.cpp:48
static const std::array< Position, 3 > hadronoxSteps
Definition boss_hadronox.cpp:146
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:88
bool UpdateVictim()
Definition CreatureAI.cpp:350
void MovePoint(uint32 id, Position const &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:241
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition MotionMaster.cpp:1088
void Clear(bool reset=true)
Definition MotionMaster.h:194
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:274
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:108
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:175
Definition Unit.h:670
bool HasUnitState(const uint32 f) const
Definition Unit.h:742
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7270
Talk
Definition hyjal.cpp:82
bool IsInCombatWithPlayer() const
Definition boss_hadronox.cpp:282

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: