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

Public Member Functions

 npc_ulduar_vx001AI (Creature *pCreature)
 
void Reset () override
 
void AttackStart (Unit *) override
 
void SetData (uint32 id, uint32 value) override
 
uint32 GetData (uint32) const override
 
void DoAction (int32 action) 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 PassengerBoarded (Unit *p, int8, bool apply) override
 == Fields ======================================= More...
 
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
 
bool bIsEvading
 
uint8 Phase
 
bool fighting
 
bool leftarm
 
uint32 spinningUpOrientation
 
uint16 spinningUpTimer
 
- 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_vx001AI()

npc_ulduar_vx001::npc_ulduar_vx001AI::npc_ulduar_vx001AI ( Creature pCreature)
inline
1260 : ScriptedAI(pCreature)
1261 {
1263 bIsEvading = false;
1264 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
InstanceScript * pInstance
Definition: boss_mimiron.cpp:1266
bool bIsEvading
Definition: boss_mimiron.cpp:1268

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

Member Function Documentation

◆ AttackStart()

void npc_ulduar_vx001::npc_ulduar_vx001AI::AttackStart ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1285{}

◆ DamageTaken()

void npc_ulduar_vx001::npc_ulduar_vx001AI::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.

1350 {
1351 if (damage >= me->GetHealth() || me->GetHealth() < 15000)
1352 {
1353 damage = 0;
1354 if (me->GetReactState() == REACT_PASSIVE)
1355 return;
1357 if (Phase == 2)
1358 {
1360 {
1362 SetData(1, 0);
1368 if (Creature* c = GetMimiron())
1369 c->AI()->SetData(0, 2);
1370 }
1371 }
1372 else if (Phase == 4)
1373 {
1375 {
1379 me->CastSpell(me, SPELL_SELF_REPAIR, false);
1380 if (Creature* c = GetMimiron())
1381 {
1382 if (c->AI()->GetData(1))
1384 if (c->AI()->GetData(2))
1385 me->CastSpell(me, SPELL_BERSERK, true);
1386 c->AI()->SetData(0, 5);
1387 }
1388 }
1389 }
1390 }
1391 }
#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
@ EMOTE_ONESHOT_CUSTOM_SPELL_06
Definition: SharedDefines.h:2002
@ SPELL_AURA_CONTROL_VEHICLE
Definition: SpellAuraDefines.h:299
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ 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
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
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:712
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 SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21316
void SendMeleeAttackStop(Unit *victim=nullptr)
Send to the client SMSG_ATTACKSTOP but doesn't clear UNIT_STATE_MELEE_ATTACKING on server side or int...
Definition: Unit.cpp:3077
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:2000
void SetData(uint32 id, uint32 value) override
Definition: boss_mimiron.cpp:1287

References Unit::CastSpell(), EMOTE_ONESHOT_CUSTOM_SPELL_06, Unit::GetHealth(), GetMimiron, Creature::GetReactState(), Unit::HandleEmoteCommand(), Unit::HasUnitFlag(), Unit::InterruptNonMeleeSpells(), ScriptedAI::me, REACT_PASSIVE, Unit::RemoveAllAurasExceptType(), Unit::SendMeleeAttackStop(), SetData(), Creature::SetReactState(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), SPELL_AURA_CONTROL_VEHICLE, SPELL_BERSERK, SPELL_EMERGENCY_MODE, SPELL_SELF_REPAIR, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, and UNIT_NPC_EMOTESTATE.

◆ DoAction()

void npc_ulduar_vx001::npc_ulduar_vx001AI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

1340 {
1341 if (action == 1337)
1342 if (Vehicle* vk = me->GetVehicleKit())
1343 for (uint8 i = 0; i < 2; ++i)
1344 if (Unit* r = vk->GetPassenger(5 + i))
1345 if (r->IsCreature())
1346 r->ToCreature()->DespawnOrUnsummon(1);
1347 }
std::uint8_t uint8
Definition: Define.h:109
Definition: Unit.h:630
Vehicle * GetVehicleKit() const
Definition: Unit.h:1785
Definition: Vehicle.h:28

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

◆ EnterEvadeMode()

void npc_ulduar_vx001::npc_ulduar_vx001AI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

1540 {
1541 if (bIsEvading)
1542 return;
1543 bIsEvading = true;
1544
1545 me->RemoveAllAuras();
1546 me->ExitVehicle();
1548 Reset();
1549 if (Creature* mimiron = GetMimiron())
1550 mimiron->AI()->EnterEvadeMode(why);
1551
1552 bIsEvading = false;
1553 }
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:1275

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

◆ GetData()

uint32 npc_ulduar_vx001::npc_ulduar_vx001AI::GetData ( uint32  ) const
inlineoverridevirtual

Reimplemented from UnitAI.

1335 {
1336 return spinningUpOrientation;
1337 }
uint32 spinningUpOrientation
Definition: boss_mimiron.cpp:1272

References spinningUpOrientation.

◆ KilledUnit()

void npc_ulduar_vx001::npc_ulduar_vx001AI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1524 {
1525 if (who->IsPlayer())
1526 if (Creature* c = GetMimiron())
1527 {
1528 if (Phase == 2)
1529 {
1530 c->AI()->Talk(SAY_VX001_SLAY);
1531 }
1532 else
1533 {
1534 c->AI()->Talk(SAY_V07TRON_SLAY);
1535 }
1536 }
1537 }
@ SAY_V07TRON_SLAY
Definition: boss_mimiron.cpp:245
@ SAY_VX001_SLAY
Definition: boss_mimiron.cpp:239
bool IsPlayer() const
Definition: Object.h:200

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

◆ MoveInLineOfSight()

void npc_ulduar_vx001::npc_ulduar_vx001AI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

1521{}

◆ PassengerBoarded()

void npc_ulduar_vx001::npc_ulduar_vx001AI::PassengerBoarded ( Unit ,
int8  ,
bool   
)
inlineoverridevirtual

== Fields =======================================

Reimplemented from CreatureAI.

1556 {
1557 if (p->GetEntry() == NPC_ROCKET_VISUAL && !apply)
1558 p->ToCreature()->DespawnOrUnsummon(8000);
1559 }
@ NPC_ROCKET_VISUAL
Definition: boss_mimiron.cpp:56

References Creature::DespawnOrUnsummon(), Object::GetEntry(), NPC_ROCKET_VISUAL, and Object::ToCreature().

◆ Reset()

void npc_ulduar_vx001::npc_ulduar_vx001AI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1276 {
1277 Phase = 0;
1278 fighting = false;
1279 leftarm = false;
1280 spinningUpTimer = 0;
1281 me->SetRegeneratingHealth(false);
1282 events.Reset();
1283 }
events
Definition: boss_sartura.cpp:43
void SetRegeneratingHealth(bool enable)
Definition: Creature.h:318
bool leftarm
Definition: boss_mimiron.cpp:1271
bool fighting
Definition: boss_mimiron.cpp:1270
uint16 spinningUpTimer
Definition: boss_mimiron.cpp:1273

References fighting, leftarm, ScriptedAI::me, Creature::SetRegeneratingHealth(), and spinningUpTimer.

Referenced by EnterEvadeMode().

◆ SetData()

void npc_ulduar_vx001::npc_ulduar_vx001AI::SetData ( uint32  id,
uint32  value 
)
inlineoverridevirtual

Reimplemented from UnitAI.

1288 {
1289 if (id == 1) // setting phase to start fighting
1290 {
1291 switch (value)
1292 {
1293 case 0:
1294 Phase = 0;
1295 fighting = false;
1297 events.Reset();
1298 break;
1299 case 2:
1300 Phase = 2;
1301 fighting = true;
1304 events.Reset();
1305 events.ScheduleEvent(EVENT_SPELL_HEAT_WAVE, 10s);
1306 events.ScheduleEvent(EVENT_SPELL_ROCKET_STRIKE, 16s);
1307 events.ScheduleEvent(EVENT_SPELL_RAPID_BURST, 0ms);
1308 events.ScheduleEvent(EVENT_SPELL_SPINNING_UP, 30s);
1309 events.ScheduleEvent(EVENT_REINSTALL_ROCKETS, 3s);
1310 if (Creature* c = GetMimiron())
1311 if (c->AI()->GetData(1))
1312 {
1313 events.ScheduleEvent(EVENT_FLAME_SUPPRESSION_10, 7s);
1314 events.ScheduleEvent(EVENT_FROST_BOMB, 1s);
1315 }
1316 break;
1317 case 4:
1318 Phase = 4;
1319 fighting = true;
1321 events.Reset();
1322 events.ScheduleEvent(EVENT_REINSTALL_ROCKETS, 3s);
1323 events.ScheduleEvent(EVENT_SPELL_ROCKET_STRIKE, 16s);
1324 events.ScheduleEvent(EVENT_HAND_PULSE, 1ms);
1325 events.ScheduleEvent(EVENT_SPELL_SPINNING_UP, 30s);
1326 if (Creature* c = GetMimiron())
1327 if (c->AI()->GetData(1))
1328 events.ScheduleEvent(EVENT_FROST_BOMB, 1s);
1329 break;
1330 }
1331 }
1332 }
@ EVENT_FROST_BOMB
Definition: boss_mimiron.cpp:216
@ EVENT_SPELL_SPINNING_UP
Definition: boss_mimiron.cpp:194
@ EVENT_FLAME_SUPPRESSION_10
Definition: boss_mimiron.cpp:215
@ EVENT_SPELL_HEAT_WAVE
Definition: boss_mimiron.cpp:189
@ EVENT_HAND_PULSE
Definition: boss_mimiron.cpp:195
@ EVENT_SPELL_RAPID_BURST
Definition: boss_mimiron.cpp:192
@ EVENT_SPELL_ROCKET_STRIKE
Definition: boss_mimiron.cpp:190
@ EVENT_REINSTALL_ROCKETS
Definition: boss_mimiron.cpp:191
@ EMOTE_ONESHOT_SPELL_CAST_OMNI
Definition: SharedDefines.h:2057
@ EMOTE_ONESHOT_NONE
Definition: SharedDefines.h:1894
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714

References EMOTE_ONESHOT_NONE, EMOTE_ONESHOT_SPELL_CAST_OMNI, EVENT_FLAME_SUPPRESSION_10, EVENT_FROST_BOMB, EVENT_HAND_PULSE, EVENT_REINSTALL_ROCKETS, EVENT_SPELL_HEAT_WAVE, EVENT_SPELL_RAPID_BURST, EVENT_SPELL_ROCKET_STRIKE, EVENT_SPELL_SPINNING_UP, fighting, GetMimiron, ScriptedAI::me, Unit::RemoveUnitFlag(), Unit::SetUInt32Value(), UNIT_FLAG_NOT_SELECTABLE, and UNIT_NPC_EMOTESTATE.

Referenced by DamageTaken().

◆ SpellHit()

void npc_ulduar_vx001::npc_ulduar_vx001AI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

1562 {
1563 if (spell->Id == SPELL_SELF_REPAIR)
1564 {
1567 }
1568 }
@ REACT_AGGRESSIVE
Definition: Unit.h:550

References SpellInfo::Id, ScriptedAI::me, REACT_AGGRESSIVE, Unit::RemoveUnitFlag(), Creature::SetReactState(), SPELL_SELF_REPAIR, and UNIT_FLAG_NON_ATTACKABLE.

◆ UpdateAI()

void npc_ulduar_vx001::npc_ulduar_vx001AI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

1394 {
1395 if (!fighting)
1396 return;
1397
1398 events.Update(diff);
1399
1400 if (spinningUpTimer) // executed about a second after starting casting to ensure players can see the correct direction
1401 {
1402 if (spinningUpTimer <= diff)
1403 {
1404 float angle = (spinningUpOrientation * 2 * M_PI) / 100.0f;
1405 me->SetFacingTo(angle);
1406
1407 spinningUpTimer = 0;
1408 }
1409 else
1410 spinningUpTimer -= diff;
1411 }
1412
1414 return;
1415
1416 switch (events.ExecuteEvent())
1417 {
1418 case 0:
1419 break;
1421 me->CastSpell(me, SPELL_HEAT_WAVE, true);
1422 events.Repeat(10s);
1423 break;
1425 if (Vehicle* vk = me->GetVehicleKit())
1426 {
1427 for( int i = 0; i < (Phase / 2); ++i )
1428 {
1429 uint8 index = (Phase == 2 ? rand() % 2 : i);
1430 if (Unit* r = vk->GetPassenger(5 + index))
1431 if (Player* temp = SelectTargetFromPlayerList(100.0f))
1432 {
1433 if (Creature* trigger = me->SummonCreature(NPC_ROCKET_STRIKE_N, temp->GetPositionX(), temp->GetPositionY(), temp->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 6000))
1434 trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true);
1435 Position exitPos = r->GetPosition();
1436 exitPos.m_positionX += cos(me->GetOrientation()) * 2.35f;
1437 exitPos.m_positionY += std::sin(me->GetOrientation()) * 2.35f;
1438 exitPos.m_positionZ += 2.0f * Phase;
1439 r->_ExitVehicle(&exitPos);
1441 if (r->IsCreature())
1442 r->ToCreature()->AI()->SetData(0, 0);
1443 }
1444 }
1445 events.Repeat(20s);
1446 events.ScheduleEvent(EVENT_REINSTALL_ROCKETS, 10s);
1447 }
1448 break;
1450 if (Vehicle* vk = me->GetVehicleKit())
1451 {
1452 for (uint8 i = 5; i <= 6; ++i)
1453 if (!vk->GetPassenger(i))
1455 if (!me->HandleSpellClick(accessory, i))
1456 accessory->UnSummon();
1457 }
1458 break;
1460 if (Player* p = SelectTargetFromPlayerList(80.0f))
1461 {
1462 me->CastSpell(p, SPELL_RAPID_BURST, true);
1464 }
1465 events.Repeat(3200ms);
1466 break;
1467 case EVENT_HAND_PULSE:
1468 if (Player* p = SelectTargetFromPlayerList(80.0f))
1469 {
1471 if (Unit* vb = me->GetVehicleBase())
1472 {
1473 vb->SendMeleeAttackStop();
1474 vb->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
1475
1476 if (!leftarm)
1477 {
1478 vb->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_03);
1479 me->CastSpell(p, SPELL_HAND_PULSE_R, false);
1480 }
1481 else
1482 {
1483 vb->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_04);
1484 me->CastSpell(p, SPELL_HAND_PULSE_L, false);
1485 }
1486 }
1487
1488 leftarm = !leftarm;
1489 }
1490 events.Repeat(1750ms);
1491 break;
1493 events.Repeat(45s);
1494 if (Player* p = SelectTargetFromPlayerList(80.0f))
1495 {
1496 float angle = me->GetAngle(p);
1497
1498 spinningUpOrientation = (uint32)((angle * 100.0f) / (2 * M_PI));
1499 spinningUpTimer = 1500;
1500 me->SetFacingTo(angle);
1501 me->CastSpell(p, SPELL_SPINNING_UP, true);
1502 if (Unit* vehicle = me->GetVehicleBase())
1503 {
1504 vehicle->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_CUSTOM_SPELL_01);
1505 vehicle->HandleEmoteCommand(EMOTE_STATE_CUSTOM_SPELL_01);
1506 }
1507 events.RescheduleEvent((Phase == 2 ? EVENT_SPELL_RAPID_BURST : EVENT_HAND_PULSE), 14s + 500ms);
1508 }
1509 break;
1512 events.Repeat(10s);
1513 break;
1514 case EVENT_FROST_BOMB:
1516 events.Repeat(45s);
1517 break;
1518 }
1519 }
std::uint32_t uint32
Definition: Define.h:107
@ SPELL_FLAME_SUPPRESSANT_10yd
Definition: boss_mimiron.cpp:136
@ SPELL_VX001_FROST_BOMB
Definition: boss_mimiron.cpp:129
#define SPELL_HAND_PULSE_L
Definition: boss_mimiron.cpp:227
@ SPELL_RAPID_BURST
Definition: boss_mimiron.cpp:59
@ NPC_ROCKET_STRIKE_N
Definition: boss_mimiron.cpp:57
@ SPELL_ROCKET_STRIKE_AURA
Definition: boss_mimiron.cpp:55
@ SPELL_HEAT_WAVE
Definition: boss_mimiron.cpp:53
@ SPELL_SPINNING_UP
Definition: boss_mimiron.cpp:66
#define SPELL_HAND_PULSE_R
Definition: boss_mimiron.cpp:226
@ EMOTE_ONESHOT_CUSTOM_SPELL_03
Definition: SharedDefines.h:1999
@ EMOTE_ONESHOT_CUSTOM_SPELL_04
Definition: SharedDefines.h:2000
@ EMOTE_STATE_CUSTOM_SPELL_01
Definition: SharedDefines.h:2010
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:117
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:53
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:571
Definition: TemporarySummon.h:40
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
Definition: Position.h:27
float m_positionZ
Definition: Position.h:57
float m_positionX
Definition: Position.h:55
float GetPositionZ() const
Definition: Position.h:118
float m_positionY
Definition: Position.h:56
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
void GetPosition(float &x, float &y) const
Definition: Position.h:121
float GetPositionY() const
Definition: Position.h:117
float GetAngle(const Position *pos) const
Definition: Position.cpp:78
Definition: Player.h:1081
void SetFacingTo(float ori)
Definition: Unit.cpp:20527
Unit * GetVehicleBase() const
Definition: Unit.cpp:18742
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1224
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20537
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
bool HandleSpellClick(Unit *clicker, int8 seatId=-1)
Definition: Unit.cpp:19554
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
Definition: Unit.cpp:5110
uint8 Phase
Definition: boss_mimiron.cpp:1269

References Unit::CastCustomSpell(), Unit::CastSpell(), EMOTE_ONESHOT_CUSTOM_SPELL_03, EMOTE_ONESHOT_CUSTOM_SPELL_04, EMOTE_ONESHOT_NONE, EMOTE_STATE_CUSTOM_SPELL_01, EVENT_FLAME_SUPPRESSION_10, EVENT_FROST_BOMB, EVENT_HAND_PULSE, EVENT_REINSTALL_ROCKETS, EVENT_SPELL_HEAT_WAVE, EVENT_SPELL_RAPID_BURST, EVENT_SPELL_ROCKET_STRIKE, EVENT_SPELL_SPINNING_UP, fighting, Position::GetAngle(), Position::GetOrientation(), Position::GetPosition(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetVehicleBase(), Unit::GetVehicleKit(), Unit::HandleSpellClick(), Unit::HasUnitState(), leftarm, Position::m_positionX, Position::m_positionY, Position::m_positionZ, ScriptedAI::me, NPC_ROCKET_STRIKE_N, NPC_ROCKET_VISUAL, Phase, Unit::RemoveAurasByType(), ScriptedAI::SelectTargetFromPlayerList(), Unit::SetFacingTo(), Unit::SetFacingToObject(), SPELL_AURA_CONTROL_VEHICLE, SPELL_FLAME_SUPPRESSANT_10yd, SPELL_HAND_PULSE_L, SPELL_HAND_PULSE_R, SPELL_HEAT_WAVE, SPELL_RAPID_BURST, SPELL_ROCKET_STRIKE_AURA, SPELL_SPINNING_UP, SPELL_VX001_FROST_BOMB, SPELLVALUE_MAX_TARGETS, spinningUpOrientation, spinningUpTimer, WorldObject::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_NPC_EMOTESTATE, and UNIT_STATE_CASTING.

Member Data Documentation

◆ bIsEvading

bool npc_ulduar_vx001::npc_ulduar_vx001AI::bIsEvading

◆ events

EventMap npc_ulduar_vx001::npc_ulduar_vx001AI::events

◆ fighting

bool npc_ulduar_vx001::npc_ulduar_vx001AI::fighting

Referenced by Reset(), SetData(), and UpdateAI().

◆ leftarm

bool npc_ulduar_vx001::npc_ulduar_vx001AI::leftarm

Referenced by Reset(), and UpdateAI().

◆ Phase

uint8 npc_ulduar_vx001::npc_ulduar_vx001AI::Phase

Referenced by UpdateAI().

◆ pInstance

InstanceScript* npc_ulduar_vx001::npc_ulduar_vx001AI::pInstance

Referenced by npc_ulduar_vx001AI().

◆ spinningUpOrientation

uint32 npc_ulduar_vx001::npc_ulduar_vx001AI::spinningUpOrientation

Referenced by GetData(), and UpdateAI().

◆ spinningUpTimer

uint16 npc_ulduar_vx001::npc_ulduar_vx001AI::spinningUpTimer

Referenced by Reset(), and UpdateAI().