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

Public Member Functions

 npc_ulduar_aerial_command_unitAI (Creature *pCreature)
 
void Reset () override
 
void AttackStart (Unit *who) override
 
void SetData (uint32 id, uint32 value) override
 
void DoAction (int32 param) override
 
void DamageTaken (Unit *, 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...
 
void MoveInLineOfSight (Unit *) override
 
void KilledUnit (Unit *who) override
 
void EnterEvadeMode (EvadeReason why) override
 
void JustSummoned (Creature *s) override
 
void SummonedCreatureDespawn (Creature *s) override
 
void SpellHit (Unit *, SpellInfo const *spell) 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
 

Public Attributes

InstanceScriptpInstance
 
EventMap events
 
SummonList summons
 
bool bIsEvading
 
uint8 Phase
 
bool immobilized
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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 ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- 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 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

◆ npc_ulduar_aerial_command_unitAI()

npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::npc_ulduar_aerial_command_unitAI ( Creature pCreature)
inline
1584 : ScriptedAI(pCreature), summons(me)
1585 {
1587 bIsEvading = false;
1588 immobilized = false;
1589 me->SetDisableGravity(true);
1590 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3205
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
SummonList summons
Definition: boss_mimiron.cpp:1594
InstanceScript * pInstance
Definition: boss_mimiron.cpp:1592

References bIsEvading, WorldObject::GetInstanceScript(), immobilized, ScriptedAI::me, pInstance, and Creature::SetDisableGravity().

Member Function Documentation

◆ AttackStart()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1607 {
1608 if (who)
1609 me->Attack(who, true); // skip following
1610 }
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10272

References Unit::Attack(), and ScriptedAI::me.

Referenced by SetData().

◆ DamageTaken()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::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 ScriptedAI.

1664 {
1665 if (damage >= me->GetHealth() || me->GetHealth() < 15000)
1666 {
1667 damage = 0;
1668 if (me->GetReactState() == REACT_PASSIVE)
1669 return;
1671 if (Phase == 3)
1672 {
1674 {
1676 me->GetMotionMaster()->Clear();
1677 me->StopMoving();
1678 me->AttackStop();
1680 SetData(1, 0);
1683
1684 me->MonsterMoveWithSpeed(2744.65f, 2569.46f, 381.34f, me->GetDistance(2744.65f, 2569.46f, 381.34f));
1685 me->UpdatePosition(2744.65f, 2569.46f, 381.34f, M_PI, false);
1686
1687 if (Creature* c = GetMimiron())
1688 c->AI()->SetData(0, 3);
1689 }
1690 }
1691 else if (Phase == 4)
1692 {
1694 {
1698 me->CastSpell(me, SPELL_SELF_REPAIR, false);
1699 if (Creature* c = GetMimiron())
1700 {
1701 if (c->AI()->GetData(1))
1703 if (c->AI()->GetData(2))
1704 me->CastSpell(me, SPELL_BERSERK, true);
1705 c->AI()->SetData(0, 6);
1706 }
1707 }
1708 }
1709 }
1710 }
#define GetMimiron()
Definition: boss_mimiron.cpp:268
@ SPELL_EMERGENCY_MODE
Definition: boss_mimiron.cpp:120
@ SPELL_SELF_REPAIR
Definition: boss_mimiron.cpp:88
@ SPELL_BERSERK
Definition: boss_mimiron.cpp:35
Phase
Definition: boss_zuljin.cpp:82
@ SPELL_AURA_CONTROL_VEHICLE
Definition: SpellAuraDefines.h:299
@ REACT_PASSIVE
Definition: Unit.h:548
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
Definition: Creature.h:43
ReactStates GetReactState() const
Definition: Creature.h:95
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1256
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4129
void RemoveAllAurasExceptType(AuraType type)
Definition: Unit.cpp:5393
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:712
void StopMoving()
Definition: Unit.cpp:16650
void MonsterMoveWithSpeed(float x, float y, float z, float speed)
Definition: Unit.cpp:529
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:20025
uint32 GetHealth() const
Definition: Unit.h:1029
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
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition: Unit.cpp:10403
void Clear(bool reset=true)
Definition: MotionMaster.h:167
void SetData(uint32 id, uint32 value) override
Definition: boss_mimiron.cpp:1612

References Unit::AttackStop(), Unit::CastSpell(), MotionMaster::Clear(), WorldObject::GetDistance(), Unit::GetHealth(), GetMimiron, Unit::GetMotionMaster(), Creature::GetReactState(), Unit::HasUnitFlag(), Unit::InterruptNonMeleeSpells(), ScriptedAI::me, Unit::MonsterMoveWithSpeed(), REACT_PASSIVE, Unit::RemoveAllAurasExceptType(), SetData(), Creature::SetReactState(), Unit::SetUnitFlag(), SPELL_AURA_CONTROL_VEHICLE, SPELL_BERSERK, SPELL_EMERGENCY_MODE, SPELL_SELF_REPAIR, Unit::StopMoving(), UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, and Unit::UpdatePosition().

◆ DoAction()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

1658 {
1659 if (param == 1337)
1661 }
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71

References SummonList::DespawnAll(), and summons.

◆ EnterEvadeMode()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

1845 {
1846 if (bIsEvading)
1847 return;
1848 bIsEvading = true;
1849
1850 me->RemoveAllAuras();
1851 me->ExitVehicle();
1853 Reset();
1854 if (Creature* mimiron = GetMimiron())
1855 mimiron->AI()->EnterEvadeMode(why);
1856
1857 bIsEvading = false;
1858 }
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:303
void RemoveAllAuras()
Definition: Unit.cpp:5319
void ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:19735
void Reset() override
Definition: boss_mimiron.cpp:1599

References CreatureAI::_EnterEvadeMode(), bIsEvading, Unit::ExitVehicle(), GetMimiron, ScriptedAI::me, Unit::RemoveAllAuras(), and Reset().

◆ JustSummoned()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::JustSummoned ( Creature s)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1861 {
1862 summons.Summon(s);
1863 if (s->GetEntry() == NPC_BOMB_BOT)
1864 s->m_positionZ = 364.34f;
1865 }
@ NPC_BOMB_BOT
Definition: boss_mimiron.cpp:101
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
uint32 GetEntry() const
Definition: Object.h:115
float m_positionZ
Definition: Position.h:57

References Object::GetEntry(), Position::m_positionZ, NPC_BOMB_BOT, SummonList::Summon(), and summons.

◆ KilledUnit()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1829 {
1830 if (who->IsPlayer())
1831 if (Creature* c = GetMimiron())
1832 {
1833 if (Phase == 3)
1834 {
1835 c->AI()->Talk(SAY_AERIAL_SLAY);
1836 }
1837 else
1838 {
1839 c->AI()->Talk(SAY_V07TRON_SLAY);
1840 }
1841 }
1842 }
@ SAY_AERIAL_SLAY
Definition: boss_mimiron.cpp:242
@ SAY_V07TRON_SLAY
Definition: boss_mimiron.cpp:245
bool IsPlayer() const
Definition: Object.h:200

References GetMimiron, Object::IsPlayer(), SAY_AERIAL_SLAY, and SAY_V07TRON_SLAY.

◆ MoveInLineOfSight()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

1826{}

◆ Reset()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1600 {
1601 Phase = 0;
1602 events.Reset();
1604 }
events
Definition: boss_sartura.cpp:43

References SummonList::DespawnAll(), and summons.

Referenced by EnterEvadeMode().

◆ SetData()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::SetData ( uint32  id,
uint32  value 
)
inlineoverridevirtual

Reimplemented from UnitAI.

1613 {
1614 if (id == 1) // setting phase to start fighting
1615 {
1616 switch (value)
1617 {
1618 case 0:
1619 Phase = 0;
1620 events.Reset();
1621 immobilized = false;
1622 break;
1623 case 3:
1624 Phase = 3;
1626 if (Unit* target = SelectTargetFromPlayerList(75.0f))
1627 AttackStart(target);
1629 events.Reset();
1630 events.ScheduleEvent(EVENT_SPELL_PLASMA_BALL, 0ms);
1631 events.ScheduleEvent(EVENT_SUMMON_BOMB_BOT, 15s);
1632 events.ScheduleEvent(EVENT_SUMMON_ASSAULT_BOT, 1s);
1633 events.ScheduleEvent(EVENT_SUMMON_JUNK_BOT, 10s);
1634 if (Creature* c = GetMimiron())
1635 if (c->AI()->GetData(1))
1636 events.ScheduleEvent(EVENT_SUMMON_EMERGENCY_FIRE_BOTS, 0ms);
1637 break;
1638 case 4:
1641 Phase = 4;
1643 if (Unit* target = SelectTargetFromPlayerList(75.0f))
1644 AttackStart(target);
1646 events.Reset();
1647 events.ScheduleEvent(EVENT_SPELL_PLASMA_BALL, 0ms);
1648 }
1649 }
1650 else if (id == 2 && !immobilized && Phase == 3) // magnetic core
1651 {
1652 immobilized = true;
1653 events.ScheduleEvent(EVENT_MAGNETIC_CORE_PULL_DOWN, 2s);
1654 }
1655 }
@ EVENT_SUMMON_JUNK_BOT
Definition: boss_mimiron.cpp:203
@ EVENT_MAGNETIC_CORE_PULL_DOWN
Definition: boss_mimiron.cpp:204
@ EVENT_SUMMON_ASSAULT_BOT
Definition: boss_mimiron.cpp:202
@ EVENT_SUMMON_BOMB_BOT
Definition: boss_mimiron.cpp:199
@ EVENT_SUMMON_EMERGENCY_FIRE_BOTS
Definition: boss_mimiron.cpp:217
@ EVENT_SPELL_PLASMA_BALL
Definition: boss_mimiron.cpp:198
@ REACT_AGGRESSIVE
Definition: Unit.h:550
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:106
void DoResetThreatList()
Definition: ScriptedCreature.cpp:445
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:571
Definition: Unit.h:630
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
void AttackStart(Unit *who) override
Definition: boss_mimiron.cpp:1606

References AttackStart(), ScriptedAI::DoResetThreatList(), CreatureAI::DoZoneInCombat(), EVENT_MAGNETIC_CORE_PULL_DOWN, EVENT_SPELL_PLASMA_BALL, EVENT_SUMMON_ASSAULT_BOT, EVENT_SUMMON_BOMB_BOT, EVENT_SUMMON_EMERGENCY_FIRE_BOTS, EVENT_SUMMON_JUNK_BOT, GetMimiron, immobilized, ScriptedAI::me, REACT_AGGRESSIVE, Unit::RemoveUnitFlag(), ScriptedAI::SelectTargetFromPlayerList(), Creature::SetReactState(), and UNIT_FLAG_NOT_SELECTABLE.

Referenced by DamageTaken(), and UpdateAI().

◆ SpellHit()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

◆ SummonedCreatureDespawn()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::SummonedCreatureDespawn ( Creature s)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1868 {
1869 summons.Despawn(s);
1870 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:89

References SummonList::Despawn(), and summons.

◆ UpdateAI()

void npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

1713 {
1714 if (!UpdateVictim())
1715 return;
1716
1717 // following :D
1718 if (Phase == 3 && !immobilized)
1719 if (Unit* victim = me->GetVictim())
1720 if (me->GetExactDist2d(victim) > 25.0f )
1721 {
1722 float angle = victim->GetAngle(me->GetPositionX(), me->GetPositionY());
1723 me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()));
1724 float x = victim->GetPositionX() + 15.0f * cos(angle);
1725 float y = victim->GetPositionY() + 15.0f * std::sin(angle);
1726
1727 // check if there's magnetic core in line of movement
1728 Creature* mc = nullptr;
1729 std::list<Creature*> cl;
1731 for( std::list<Creature*>::iterator itr = cl.begin(); itr != cl.end(); ++itr )
1732 {
1733 if ((*itr)->IsInBetween(me, victim, 4.0f) && (*itr)->GetExactDist2d(victim) >= 10.0f) // don't come very close just because there's a magnetic core
1734 {
1735 x = (*itr)->GetPositionX();
1736 y = (*itr)->GetPositionY();
1737 mc = (*itr);
1738 break;
1739 }
1740 }
1741
1742 float speed = me->GetExactDist(x, y, 381.34f);
1743 me->MonsterMoveWithSpeed(x, y, 381.34f, speed);
1744 me->UpdatePosition(x, y, 381.34f, me->GetAngle(victim), false);
1745 if (mc)
1746 {
1747 mc->AI()->SetData(0, 0);
1748 SetData(2, 1);
1749 }
1750 }
1751
1752 events.Update(diff);
1753
1755 return;
1756
1757 switch (events.ExecuteEvent())
1758 {
1759 case 0:
1760 break;
1762 if (!immobilized)
1763 {
1764 if (Phase == 3)
1765 {
1766 if (Unit* victim = me->GetVictim())
1767 me->CastSpell(victim, SPELL_PLASMA_BALL, false);
1768 }
1769 else
1770 {
1771 if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 27.5f, true))
1772 {
1773 me->SetFacingToObject(victim);
1774 me->CastSpell(victim, SPELL_PLASMA_BALL, false);
1775 }
1776 }
1777 }
1778 events.Repeat(3s);
1779 break;
1781 if (!immobilized)
1783 events.Repeat(15s);
1784 break;
1786 if (GameObject* pad = me->FindNearestGameObject(RAND(194742, 194746, 194745), 200.0f))
1788 trigger->AI()->DoAction(2);
1789 events.Repeat(30s);
1790 break;
1792 if (GameObject* pad = me->FindNearestGameObject(RAND(194741, 194744, 194747), 200.0f))
1794 trigger->AI()->DoAction(1);
1795 events.Repeat(10s);
1796 break;
1798 {
1799 uint32 ids[3] = {194740, 194743, 194748};
1800 for( uint8 i = 0; i < 3; ++i )
1801 if (GameObject* pad = me->FindNearestGameObject(ids[i], 200.0f))
1803 trigger->AI()->DoAction(3);
1804 events.Repeat(45s);
1805 }
1806 break;
1809 me->CastSpell(me, SPELL_SPINNING, true);
1811 me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 365.34f, me->GetOrientation(), false);
1812 events.ScheduleEvent(EVENT_MAGNETIC_CORE_FREE, 20s);
1813 break;
1817 me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), 381.34f, me->GetOrientation(), false);
1819 break;
1821 immobilized = false;
1822 break;
1823 }
1824 }
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
@ EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE
Definition: boss_mimiron.cpp:206
@ EVENT_MAGNETIC_CORE_FREE
Definition: boss_mimiron.cpp:205
@ NPC_MAGNETIC_CORE
Definition: boss_mimiron.cpp:105
@ NPC_BOT_SUMMON_TRIGGER
Definition: boss_mimiron.cpp:102
@ SPELL_SUMMON_BOMB_BOT
Definition: boss_mimiron.cpp:75
@ SPELL_MAGNETIC_CORE
Definition: boss_mimiron.cpp:72
@ SPELL_SPINNING
Definition: boss_mimiron.cpp:73
#define SPELL_PLASMA_BALL
Definition: boss_mimiron.cpp:225
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition: CreatureAIImpl.h:25
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:53
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
virtual void SetData(uint32, uint32)
Definition: UnitAI.h:214
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
CreatureAI * AI() const
Definition: Creature.h:140
Definition: GameObject.h:120
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
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2466
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3097
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:165
float GetExactDist(float x, float y, float z) const
Definition: Position.h:177
float GetOrientation() const
Definition: Position.h:119
void SetOrientation(float orientation)
Definition: Position.h:111
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
float GetAngle(const Position *pos) const
Definition: Position.cpp:78
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20537
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701

References Creature::AI(), Unit::CastSpell(), EVENT_MAGNETIC_CORE_FREE, EVENT_MAGNETIC_CORE_PULL_DOWN, EVENT_MAGNETIC_CORE_REMOVE_IMMOBILIZE, EVENT_SPELL_PLASMA_BALL, EVENT_SUMMON_ASSAULT_BOT, EVENT_SUMMON_BOMB_BOT, EVENT_SUMMON_EMERGENCY_FIRE_BOTS, EVENT_SUMMON_JUNK_BOT, WorldObject::FindNearestGameObject(), Position::GetAngle(), WorldObject::GetCreaturesWithEntryInRange(), WorldObject::GetDistance(), Position::GetExactDist(), Position::GetExactDist2d(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Unit::GetVictim(), Unit::HasUnitState(), immobilized, ScriptedAI::me, Unit::MonsterMoveWithSpeed(), NPC_BOT_SUMMON_TRIGGER, NPC_MAGNETIC_CORE, RAND(), Unit::RemoveAura(), UnitAI::SelectTarget(), SetData(), UnitAI::SetData(), Unit::SetFacingToObject(), Position::SetOrientation(), SPELL_MAGNETIC_CORE, SPELL_PLASMA_BALL, SPELL_SPINNING, SPELL_SUMMON_BOMB_BOT, WorldObject::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_STATE_CASTING, Unit::UpdatePosition(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ bIsEvading

bool npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::bIsEvading

◆ events

EventMap npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::events

◆ immobilized

bool npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::immobilized

◆ Phase

uint8 npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::Phase

◆ pInstance

InstanceScript* npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::pInstance

◆ summons

SummonList npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::summons