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

Public Member Functions

 boss_hadronoxAI (Creature *creature)
 
void Reset () override
 
void DoAction (int32 param) override
 
uint32 GetData (uint32 data) const override
 
void JustSummoned (Creature *summon) override
 
void KilledUnit (Unit *victim) override
 
void JustDied (Unit *killer) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
bool AnyPlayerValid () const
 
void DamageTaken (Unit *who, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
bool CheckEvadeIfOutOfCombatArea () const override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
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() More...
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent. More...
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, 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=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 ()
 
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)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, 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: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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
 

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_hadronoxAI()

boss_hadronox::boss_hadronoxAI::boss_hadronoxAI ( Creature creature)
inline
87 : BossAI(creature, DATA_HADRONOX_EVENT)
88 {
89 }
@ DATA_HADRONOX_EVENT
Definition: azjol_nerub.h:30
Definition: ScriptedCreature.h:467

Member Function Documentation

◆ AnyPlayerValid()

bool boss_hadronox::boss_hadronoxAI::AnyPlayerValid ( ) const
inline
153 {
154 Map::PlayerList const& playerList = me->GetMap()->GetPlayers();
155 for(Map::PlayerList::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
156 if (me->GetDistance(itr->GetSource()) < 130.0f && itr->GetSource()->IsAlive() && !itr->GetSource()->IsGameMaster() && me->CanCreatureAttack(itr->GetSource()))
157 return true;
158
159 return false;
160 }
Definition: LinkedList.h:139
Creature * me
Definition: ScriptedCreature.h:280
bool CanCreatureAttack(Unit const *victim, bool skipDistCheck=false) const
Definition: Creature.cpp:2625
Map * GetMap() const
Definition: Object.h:536
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1256
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References MapRefMgr::begin(), Creature::CanCreatureAttack(), MapRefMgr::end(), WorldObject::GetDistance(), WorldObject::GetMap(), Map::GetPlayers(), and ScriptedAI::me.

Referenced by CheckEvadeIfOutOfCombatArea().

◆ CheckEvadeIfOutOfCombatArea()

bool boss_hadronox::boss_hadronoxAI::CheckEvadeIfOutOfCombatArea ( ) const
inlineoverridevirtual

Reimplemented from ScriptedAI.

220 {
221 return me->isActiveObject() && !AnyPlayerValid();
222 }
bool isActiveObject() const
Definition: Object.h:579
bool AnyPlayerValid() const
Definition: boss_hadronox.cpp:152

References AnyPlayerValid(), WorldObject::isActiveObject(), and ScriptedAI::me.

◆ DamageTaken()

void boss_hadronox::boss_hadronoxAI::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 BossAI.

163 {
164 if ((!who || !who->IsControlledByPlayer()) && me->HealthBelowPct(70))
165 {
166 if (me->HealthBelowPctDamaged(5, damage))
167 {
168 damage = 0;
169 }
170 else
171 {
172 damage *= (me->GetHealthPct() - 5.0f) / 65.0f;
173 }
174 }
175 }
float GetHealthPct() const
Definition: Unit.h:1031
bool HealthBelowPct(int32 pct) const
Definition: Unit.h:1037
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1038

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

◆ DoAction()

void boss_hadronox::boss_hadronoxAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

99 {
100 if (param == ACTION_START_EVENT)
101 {
103 me->setActive(true);
104 events.ScheduleEvent(EVENT_HADRONOX_MOVE1, 20s);
105 events.ScheduleEvent(EVENT_HADRONOX_MOVE2, 40s);
106 events.ScheduleEvent(EVENT_HADRONOX_MOVE3, 60s);
107 events.ScheduleEvent(EVENT_HADRONOX_MOVE4, 80s);
108 }
109 }
events
Definition: boss_sartura.cpp:43
@ ACTION_START_EVENT
Definition: boss_hadronox.cpp:69
@ EVENT_HADRONOX_MOVE4
Definition: boss_hadronox.cpp:49
@ EVENT_HADRONOX_MOVE3
Definition: boss_hadronox.cpp:48
@ EVENT_HADRONOX_MOVE1
Definition: boss_hadronox.cpp:46
@ EVENT_HADRONOX_MOVE2
Definition: boss_hadronox.cpp:47
@ IN_PROGRESS
Definition: InstanceScript.h:58
InstanceScript *const instance
Definition: ScriptedCreature.h:474
void setActive(bool isActiveObject)
Definition: Object.cpp:1094
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:373

References ACTION_START_EVENT, DATA_HADRONOX_EVENT, EVENT_HADRONOX_MOVE1, EVENT_HADRONOX_MOVE2, EVENT_HADRONOX_MOVE3, EVENT_HADRONOX_MOVE4, IN_PROGRESS, BossAI::instance, ScriptedAI::me, WorldObject::setActive(), and InstanceScript::SetBossState().

◆ GetData()

uint32 boss_hadronox::boss_hadronoxAI::GetData ( uint32  data) const
inlineoverridevirtual

Reimplemented from UnitAI.

112 {
113 if (data == me->GetEntry())
114 return !me->isActiveObject() || events.GetNextEventTime(EVENT_HADRONOX_MOVE4) != 0;
115 return 0;
116 }
uint32 GetEntry() const
Definition: Object.h:115

References EVENT_HADRONOX_MOVE4, Object::GetEntry(), WorldObject::isActiveObject(), and ScriptedAI::me.

◆ JustDied()

void boss_hadronox::boss_hadronoxAI::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from BossAI.

140 {
141 BossAI::JustDied(killer);
142 }
void JustDied(Unit *) override
Definition: ScriptedCreature.h:499

References BossAI::JustDied().

◆ JustEngagedWith()

void boss_hadronox::boss_hadronoxAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

145 {
146 events.RescheduleEvent(EVENT_HADRONOX_ACID, 10s);
147 events.RescheduleEvent(EVENT_HADRONOX_LEECH, 4s);
148 events.RescheduleEvent(EVENT_HADRONOX_PIERCE, 1s);
149 events.RescheduleEvent(EVENT_HADRONOX_GRAB, 15s);
150 }
@ EVENT_HADRONOX_PIERCE
Definition: boss_hadronox.cpp:52
@ EVENT_HADRONOX_LEECH
Definition: boss_hadronox.cpp:51
@ EVENT_HADRONOX_ACID
Definition: boss_hadronox.cpp:50
@ EVENT_HADRONOX_GRAB
Definition: boss_hadronox.cpp:53

References EVENT_HADRONOX_ACID, EVENT_HADRONOX_GRAB, EVENT_HADRONOX_LEECH, and EVENT_HADRONOX_PIERCE.

◆ JustSummoned()

void boss_hadronox::boss_hadronoxAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

119 {
120 summons.Summon(summon);
121
122 // Xinef: cannot use pathfinding...
123 if (summon->GetDistance(477.0f, 618.0f, 771.0f) < 5.0f)
124 summon->GetMotionMaster()->MovePath(3000012, false);
125 else if (summon->GetDistance(583.0f, 617.0f, 771.0f) < 5.0f)
126 summon->GetMotionMaster()->MovePath(3000013, false);
127 else if (summon->GetDistance(581.0f, 608.5f, 739.0f) < 5.0f)
128 summon->GetMotionMaster()->MovePath(3000014, false);
129 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
SummonList summons
Definition: ScriptedCreature.h:511
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void MovePath(uint32 path_id, bool repeatable)
Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:852

References WorldObject::GetDistance(), Unit::GetMotionMaster(), MotionMaster::MovePath(), SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_hadronox::boss_hadronoxAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

132 {
133 if (!me->IsAlive() || !victim->HasAura(SPELL_LEECH_POISON))
134 return;
135
137 }
std::int32_t int32
Definition: Define.h:103
@ SPELL_LEECH_POISON
Definition: boss_hadronox.cpp:35
int32 ModifyHealth(int32 val)
Definition: Unit.cpp:14091
bool IsAlive() const
Definition: Unit.h:1654
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698
uint32 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:1042

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

◆ Reset()

void boss_hadronox::boss_hadronoxAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

92 {
95 me->SummonCreature(NPC_ANUB_AR_CRUSHER, 542.9f, 519.5f, 741.24f, 2.14f);
96 }
@ NPC_ANUB_AR_CRUSHER
Definition: boss_hadronox.cpp:62
@ ACTION_DESPAWN_ADDS
Definition: boss_hadronox.cpp:68
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:102
void Reset() override
Definition: ScriptedCreature.h:496
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366

References ACTION_DESPAWN_ADDS, SummonList::DoAction(), ScriptedAI::me, NPC_ANUB_AR_CRUSHER, BossAI::Reset(), WorldObject::SummonCreature(), and BossAI::summons.

◆ UpdateAI()

void boss_hadronox::boss_hadronoxAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Todo:
: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.

Reimplemented from BossAI.

178 {
179 if (!UpdateVictim())
180 return;
181
182 events.Update(diff);
184 return;
185
186 switch (uint32 eventId = events.ExecuteEvent())
187 {
190 events.ScheduleEvent(EVENT_HADRONOX_PIERCE, 8s);
191 break;
193 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, false))
194 me->CastSpell(target, SPELL_ACID_CLOUD, false);
195 events.ScheduleEvent(EVENT_HADRONOX_ACID, 25s);
196 break;
199 events.ScheduleEvent(EVENT_HADRONOX_LEECH, 12s);
200 break;
202 me->CastSpell(me, SPELL_WEB_GRAB, false);
203 events.ScheduleEvent(EVENT_HADRONOX_GRAB, 25s);
204 break;
207 [[fallthrough]];
212 me->GetMotionMaster()->MoveCharge(hadronoxSteps[eventId - 1].GetPositionX(), hadronoxSteps[eventId - 1].GetPositionY(), hadronoxSteps[eventId - 1].GetPositionZ(), 10.0f, 0, nullptr, true);
213 break;
214 }
215
217 }
std::uint32_t uint32
Definition: Define.h:107
Talk
Definition: hyjal.cpp:82
const Position hadronoxSteps[4]
Definition: boss_hadronox.cpp:72
@ SAY_HADRONOX_EMOTE
Definition: boss_hadronox.cpp:66
@ SPELL_ACID_CLOUD
Definition: boss_hadronox.cpp:34
@ SPELL_WEB_FRONT_DOORS
Definition: boss_hadronox.cpp:32
@ SPELL_WEB_GRAB
Definition: boss_hadronox.cpp:37
@ SPELL_PIERCE_ARMOR
Definition: boss_hadronox.cpp:38
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
bool UpdateVictim()
Definition: CreatureAI.cpp:280
Definition: Unit.h:630
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1167
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void MoveCharge(float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, const Movement::PointsArray *path=nullptr, bool generatePath=false, float orientation=0.0f, ObjectGuid targetGUID=ObjectGuid::Empty)
The unit will charge the target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition: MotionMaster.cpp:670

References Unit::CastSpell(), UnitAI::DoMeleeAttackIfReady(), EVENT_HADRONOX_ACID, EVENT_HADRONOX_GRAB, EVENT_HADRONOX_LEECH, EVENT_HADRONOX_MOVE1, EVENT_HADRONOX_MOVE2, EVENT_HADRONOX_MOVE3, EVENT_HADRONOX_MOVE4, EVENT_HADRONOX_PIERCE, Unit::GetMotionMaster(), Unit::GetVictim(), hadronoxSteps, Unit::HasUnitState(), ScriptedAI::me, MotionMaster::MoveCharge(), SAY_HADRONOX_EMOTE, UnitAI::SelectTarget(), SPELL_ACID_CLOUD, SPELL_LEECH_POISON, SPELL_PIERCE_ARMOR, SPELL_WEB_FRONT_DOORS, SPELL_WEB_GRAB, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().