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

Public Member Functions

 boss_xt002AI (Creature *pCreature)
 
void RescheduleEvents ()
 
void Reset () override
 
void JustSummoned (Creature *cr) override
 
void SummonedCreatureDespawn (Creature *cr) override
 
void AttachHeart ()
 
void JustReachedHome () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void KilledUnit (Unit *victim) override
 
void JustDied (Unit *) override
 
void DoAction (int32 param) override
 
uint32 GetData (uint32 param) const override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=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.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
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 InitializeAI ()
 
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:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

InstanceScriptm_pInstance
 
uint8 _healthCheck
 
bool _hardMode
 
bool _nerfAchievement
 
bool _gravityAchievement
 
EventMap events
 
SummonList summons
 
- 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

◆ boss_xt002AI()

boss_xt002::boss_xt002AI::boss_xt002AI ( Creature pCreature)
inline
138 : ScriptedAI(pCreature), summons(me)
139 {
140 m_pInstance = pCreature->GetInstanceScript();
141 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
Definition ScriptedCreature.h:190
Creature * me
Definition ScriptedCreature.h:280
InstanceScript * m_pInstance
Definition boss_xt002.cpp:143
SummonList summons
Definition boss_xt002.cpp:149

References WorldObject::GetInstanceScript(), and m_pInstance.

Member Function Documentation

◆ AttachHeart()

void boss_xt002::boss_xt002AI::AttachHeart ( )
inline
190 {
191 if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
192 heart->SetHealth(heart->GetMaxHealth());
194 {
195 accessory->AddUnitTypeMask(UNIT_MASK_ACCESSORY);
196 if (!me->HandleSpellClick(accessory, 0))
197 accessory->DespawnOrUnsummon();
198 }
199 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:53
@ UNIT_MASK_ACCESSORY
Definition UnitDefines.h:165
@ HEART_VEHICLE_SEAT
Definition boss_xt002.cpp:114
@ NPC_XT002_HEART
Definition boss_xt002.cpp:89
Definition Creature.h:43
Definition Unit.h:636
bool HandleSpellClick(Unit *clicker, int8 seatId=-1)
Definition Unit.cpp:19606
Vehicle * GetVehicleKit() const
Definition Unit.h:1838
Unit * GetPassenger(int8 seatId) const
Definition Vehicle.cpp:227
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:2368

References Vehicle::GetPassenger(), Unit::GetVehicleKit(), Unit::HandleSpellClick(), HEART_VEHICLE_SEAT, ScriptedAI::me, NPC_XT002_HEART, WorldObject::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, and UNIT_MASK_ACCESSORY.

Referenced by JustEngagedWith().

◆ DoAction()

void boss_xt002::boss_xt002AI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

250 {
251 if (param == DATA_XT002_NERF_ENGINEERING)
252 {
253 _nerfAchievement = false;
254 return;
255 }
256 if (param == DATA_XT002_GRAVITY_ACHIEV)
257 {
258 _gravityAchievement = false;
259 return;
260 }
261
262 if (!me->IsAlive() || _hardMode)
263 return;
264
265 // heart destory
266 if (param == ACTION_HEART_BROKEN)
267 {
268 _hardMode = true;
269 me->SetLootMode(3); // hard mode + normal loot
273
275
277 events.ScheduleEvent(EVENT_REMOVE_EMOTE, 4s);
278 return;
279 }
280
281 // damage from heart
282 if (param > 0)
283 {
284 // avoid reducing health under 1
285 int32 _final = std::min(param, int32(me->GetHealth() - 1));
286
287 me->ModifyHealth(-_final);
288 me->LowerPlayerDamageReq(_final);
289 }
290 }
std::int32_t int32
Definition Define.h:103
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:32
@ UNIT_BYTES_1_OFFSET_STAND_STATE
Definition UnitDefines.h:23
@ UNIT_FIELD_BYTES_1
Definition UpdateFields.h:131
events
Definition boss_sartura.cpp:43
@ ACTION_HEART_BROKEN
Definition boss_xt002.cpp:118
@ DATA_XT002_GRAVITY_ACHIEV
Definition boss_xt002.cpp:123
@ DATA_XT002_NERF_ENGINEERING
Definition boss_xt002.cpp:122
@ EMOTE_HEART_CLOSED
Definition boss_xt002.cpp:107
#define SPELL_HEARTBREAK
Definition boss_xt002.cpp:69
@ EVENT_REMOVE_EMOTE
Definition boss_xt002.cpp:81
void LowerPlayerDamageReq(uint32 unDamage, bool damagedByPlayer=true)
Definition Creature.cpp:3823
void SetLootMode(uint16 lootMode)
Definition Creature.h:246
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition Object.cpp:750
int32 ModifyHealth(int32 val)
Definition Unit.cpp:14143
uint32 GetMaxHealth() const
Definition Unit.h:1039
bool IsAlive() const
Definition Unit.h:1707
void SetHealth(uint32 val)
Definition Unit.cpp:15530
uint32 GetHealth() const
Definition Unit.h:1038
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:1178
void SetMaxHealth(uint32 val)
Definition Unit.cpp:15580
Talk
Definition hyjal.cpp:82
bool _hardMode
Definition boss_xt002.cpp:145
bool _gravityAchievement
Definition boss_xt002.cpp:147
bool _nerfAchievement
Definition boss_xt002.cpp:146

References _gravityAchievement, _hardMode, _nerfAchievement, ACTION_HEART_BROKEN, Unit::CastSpell(), DATA_XT002_GRAVITY_ACHIEV, DATA_XT002_NERF_ENGINEERING, EMOTE_HEART_CLOSED, EVENT_REMOVE_EMOTE, Unit::GetHealth(), Unit::GetMaxHealth(), Unit::IsAlive(), Creature::LowerPlayerDamageReq(), ScriptedAI::me, Unit::ModifyHealth(), Object::SetByteValue(), Unit::SetHealth(), Creature::SetLootMode(), Unit::SetMaxHealth(), SPELL_HEARTBREAK, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_FIELD_BYTES_1, and UNIT_STAND_STATE_STAND.

◆ GetData()

uint32 boss_xt002::boss_xt002AI::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

293 {
294 if (param == DATA_XT002_NERF_ENGINEERING)
295 return _nerfAchievement;
296 else if (param == DATA_XT002_GRAVITY_ACHIEV)
297 return _gravityAchievement;
298
299 return 0;
300 }

References _gravityAchievement, _nerfAchievement, DATA_XT002_GRAVITY_ACHIEV, and DATA_XT002_NERF_ENGINEERING.

◆ JustDied()

void boss_xt002::boss_xt002AI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

235 {
237
238 if (m_pInstance)
239 {
242 pGo->SetGoState(GO_STATE_ACTIVE);
243 }
244
245 // Despawn summons
247 }
@ GO_STATE_ACTIVE
Definition GameObjectData.h:689
@ DONE
Definition InstanceScript.h:61
@ SAY_DEATH
Definition boss_xt002.cpp:104
Definition GameObject.h:120
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
void DespawnAll(uint32 delay=0)
Definition ScriptedCreature.cpp:71
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:184
@ GO_XT002_DOORS
Definition ulduar.h:214
@ TYPE_XT002
Definition ulduar.h:35

References SummonList::DespawnAll(), DONE, ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_STATE_ACTIVE, GO_XT002_DOORS, m_pInstance, ScriptedAI::me, SAY_DEATH, ZoneScript::SetData(), summons, and TYPE_XT002.

◆ JustEngagedWith()

void boss_xt002::boss_xt002AI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

204 {
206 events.ScheduleEvent(EVENT_ENRAGE, 10min, 0, 0);
207 events.ScheduleEvent(EVENT_CHECK_ROOM, 5s, 0, 0);
208 RescheduleEvents(); // Other events are scheduled here
209
210 me->setActive(true);
212
213 if (m_pInstance)
214 {
218 pGo->SetGoState(GO_STATE_READY);
219 }
220
221 me->CallForHelp(175);
223 AttachHeart();
224 }
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:110
@ GO_STATE_READY
Definition GameObjectData.h:690
@ IN_PROGRESS
Definition InstanceScript.h:59
@ EMOTE_ONESHOT_NONE
Definition SharedDefines.h:1894
@ UNIT_NPC_EMOTESTATE
Definition UpdateFields.h:140
@ ACHIEVEMENT_MUST_DECONSTRUCT_FASTER
Definition boss_xt002.cpp:120
@ SAY_AGGRO
Definition boss_xt002.cpp:98
@ EVENT_ENRAGE
Definition boss_xt002.cpp:77
@ EVENT_CHECK_ROOM
Definition boss_xt002.cpp:82
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2828
void CallForHelp(float fRadius, Unit *target=nullptr)
Definition Creature.cpp:2474
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:665
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21372
void setActive(bool isActiveObject)
Definition Object.cpp:1094
void RescheduleEvents()
Definition boss_xt002.cpp:151
void AttachHeart()
Definition boss_xt002.cpp:189

References ACHIEVEMENT_MUST_DECONSTRUCT_FASTER, ACHIEVEMENT_TIMED_TYPE_EVENT, AttachHeart(), Creature::CallForHelp(), InstanceScript::DoStartTimedAchievement(), EMOTE_ONESHOT_NONE, EVENT_CHECK_ROOM, EVENT_ENRAGE, ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_STATE_READY, GO_XT002_DOORS, IN_PROGRESS, m_pInstance, ScriptedAI::me, RescheduleEvents(), SAY_AGGRO, WorldObject::setActive(), ZoneScript::SetData(), Creature::SetInCombatWithZone(), Unit::SetUInt32Value(), TYPE_XT002, and UNIT_NPC_EMOTESTATE.

◆ JustReachedHome()

void boss_xt002::boss_xt002AI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

201{ me->setActive(false); }

References ScriptedAI::me, and WorldObject::setActive().

◆ JustSummoned()

void boss_xt002::boss_xt002AI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

186{ summons.Summon(cr); }
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88

References SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_xt002::boss_xt002AI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

227 {
228 if (victim->IsPlayer() && !urand(0, 2))
229 {
230 Talk(SAY_SLAY);
231 }
232 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ SAY_SLAY
Definition boss_xt002.cpp:102
bool IsPlayer() const
Definition Object.h:200

References Object::IsPlayer(), SAY_SLAY, and urand().

◆ RescheduleEvents()

void boss_xt002::boss_xt002AI::RescheduleEvents ( )
inline
152 {
153 events.RescheduleEvent(EVENT_GRAVITY_BOMB, 1s, 1);
154 events.RescheduleEvent(EVENT_TYMPANIC_TANTARUM, 1min, 1);
155 if (!_hardMode)
156 events.RescheduleEvent(EVENT_HEALTH_CHECK, 2s, 1);
157 }
@ EVENT_GRAVITY_BOMB
Definition boss_xt002.cpp:75
@ EVENT_TYMPANIC_TANTARUM
Definition boss_xt002.cpp:78
@ EVENT_HEALTH_CHECK
Definition boss_xt002.cpp:74

References _hardMode, EVENT_GRAVITY_BOMB, EVENT_HEALTH_CHECK, and EVENT_TYMPANIC_TANTARUM.

Referenced by JustEngagedWith(), and UpdateAI().

◆ Reset()

void boss_xt002::boss_xt002AI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

160 {
162 events.Reset();
163
164 me->ResetLootMode();
166
167 // first heart expose
168 _healthCheck = 75;
169 _hardMode = false;
170 _nerfAchievement = true;
171 _gravityAchievement = true;
172
176
177 if (m_pInstance)
178 {
182 pGo->SetGoState(GO_STATE_ACTIVE);
183 }
184 }
@ NOT_STARTED
Definition InstanceScript.h:58
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:173
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:251
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:275
void ResetLootMode()
Definition Creature.h:249
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:674
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18086
void RemoveAllAuras()
Definition Unit.cpp:5351
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:720
uint8 _healthCheck
Definition boss_xt002.cpp:144

References _gravityAchievement, _hardMode, _healthCheck, _nerfAchievement, ACHIEVEMENT_MUST_DECONSTRUCT_FASTER, ACHIEVEMENT_TIMED_TYPE_EVENT, SummonList::DespawnAll(), InstanceScript::DoStopTimedAchievement(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_STATE_ACTIVE, GO_XT002_DOORS, m_pInstance, ScriptedAI::me, NOT_STARTED, Unit::RemoveAllAuras(), Unit::RemoveUnitFlag(), Creature::ResetLootMode(), Object::SetByteValue(), Unit::SetControlled(), ZoneScript::SetData(), summons, TYPE_XT002, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_FIELD_BYTES_1, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_STAND_STATE_STAND, and UNIT_STATE_STUNNED.

◆ SummonedCreatureDespawn()

void boss_xt002::boss_xt002AI::SummonedCreatureDespawn ( Creature cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

187{ summons.Despawn(cr); }
void Despawn(Creature const *summon)
Definition ScriptedCreature.h:89

References SummonList::Despawn(), and summons.

◆ UpdateAI()

void boss_xt002::boss_xt002AI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

303 {
304 if (!UpdateVictim())
305 return;
306
307 events.Update(diff);
309 return;
310
311 switch (events.ExecuteEvent())
312 {
313 // Control events
315 if (_hardMode)
316 {
317 return;
318 }
319
321 {
322 _healthCheck -= 25;
325
327
328 events.CancelEventGroup(1);
329 events.ScheduleEvent(EVENT_START_SECOND_PHASE, 5s);
330 return;
331 }
332 events.Repeat(1s);
333 break;
334 case EVENT_CHECK_ROOM:
335 events.Repeat(5s);
336 if (me->GetPositionX() < 722 || me->GetPositionX() > 987 || me->GetPositionY() < -139 || me->GetPositionY() > 124)
338
339 return;
340
341 // Abilities events
344 events.ScheduleEvent(EVENT_SEARING_LIGHT, 10s, 1);
345 break;
348 events.ScheduleEvent(EVENT_GRAVITY_BOMB, 10s, 1);
349 break;
354 events.Repeat(1min);
355 return;
356 case EVENT_ENRAGE:
359 break;
360
361 // Animation events
365 if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
367
368 events.ScheduleEvent(EVENT_RESTORE, 30s);
369 return;
370 // Restore from heartbreak
371 case EVENT_RESTORE:
372 if (_hardMode)
373 {
374 return;
375 }
376
378
380 // Hide heart
381 if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
383
384 events.ScheduleEvent(EVENT_REMOVE_EMOTE, 4s);
385 return;
389
391 return;
392 }
393
394 // Disabled by stunned state
396 }
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:117
@ UNIT_STAND_STATE_SUBMERGED
Definition UnitDefines.h:41
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
#define SPELL_GRAVITY_BOMB
Definition boss_xt002.cpp:67
@ ACTION_HIDE_HEART
Definition boss_xt002.cpp:117
@ ACTION_AWAKEN_HEART
Definition boss_xt002.cpp:116
@ SPELL_XT002_ENRAGE
Definition boss_xt002.cpp:38
@ SPELL_TYMPANIC_TANTARUM
Definition boss_xt002.cpp:37
#define SPELL_SEARING_LIGHT
Definition boss_xt002.cpp:68
@ SAY_HEART_OPENED
Definition boss_xt002.cpp:99
@ SAY_TYMPANIC_TANTRUM
Definition boss_xt002.cpp:101
@ EMOTE_TYMPANIC_TANTRUM
Definition boss_xt002.cpp:108
@ EMOTE_HEART_OPENED
Definition boss_xt002.cpp:106
@ SAY_HEART_CLOSED
Definition boss_xt002.cpp:100
@ SAY_BERSERK
Definition boss_xt002.cpp:103
@ EVENT_SEARING_LIGHT
Definition boss_xt002.cpp:76
@ EVENT_RESTORE
Definition boss_xt002.cpp:79
@ EVENT_START_SECOND_PHASE
Definition boss_xt002.cpp:80
bool UpdateVictim()
Definition CreatureAI.cpp:280
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:208
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
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:1235
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1046
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:719
CreatureAI * GetAI(Creature *pCreature) const override
Definition boss_xt002.cpp:131
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void DoAction(int32 param) override
Definition boss_xt002.cpp:249

References _hardMode, _healthCheck, ACTION_AWAKEN_HEART, ACTION_HIDE_HEART, Unit::CastCustomSpell(), Unit::CastSpell(), UnitAI::DoMeleeAttackIfReady(), EMOTE_HEART_OPENED, EMOTE_TYMPANIC_TANTRUM, CreatureAI::EnterEvadeMode(), EVENT_CHECK_ROOM, EVENT_ENRAGE, EVENT_GRAVITY_BOMB, EVENT_HEALTH_CHECK, EVENT_REMOVE_EMOTE, EVENT_RESTORE, EVENT_SEARING_LIGHT, EVENT_START_SECOND_PHASE, EVENT_TYMPANIC_TANTARUM, Vehicle::GetPassenger(), Position::GetPositionX(), Position::GetPositionY(), Unit::GetVehicleKit(), Unit::HasUnitState(), Unit::HealthBelowPct(), HEART_VEHICLE_SEAT, ScriptedAI::me, Unit::RemoveUnitFlag(), RescheduleEvents(), SAY_BERSERK, SAY_HEART_CLOSED, SAY_HEART_OPENED, SAY_TYMPANIC_TANTRUM, Object::SetByteValue(), Unit::SetControlled(), Unit::SetUnitFlag(), SPELL_GRAVITY_BOMB, SPELL_SEARING_LIGHT, SPELL_TYMPANIC_TANTARUM, SPELL_XT002_ENRAGE, SPELLVALUE_MAX_TARGETS, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_FIELD_BYTES_1, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_STAND_STATE_STAND, UNIT_STAND_STATE_SUBMERGED, UNIT_STATE_CASTING, UNIT_STATE_STUNNED, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _gravityAchievement

bool boss_xt002::boss_xt002AI::_gravityAchievement

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

◆ _hardMode

bool boss_xt002::boss_xt002AI::_hardMode

◆ _healthCheck

uint8 boss_xt002::boss_xt002AI::_healthCheck

Referenced by Reset(), and UpdateAI().

◆ _nerfAchievement

bool boss_xt002::boss_xt002AI::_nerfAchievement

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

◆ events

EventMap boss_xt002::boss_xt002AI::events

◆ m_pInstance

InstanceScript* boss_xt002::boss_xt002AI::m_pInstance

◆ summons

SummonList boss_xt002::boss_xt002AI::summons

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