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

Public Member Functions

 boss_uromAI (Creature *c)
 
uint8 GetPhaseByCurrentPosition ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *who) override
 
void JustSummoned (Creature *pSummon) override
 
void LeaveCombat ()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
void MoveInLineOfSight (Unit *) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void EnterEvadeMode (EvadeReason why) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
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=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
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 IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellCastFinished (SpellInfo const *, SpellFinishReason)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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 ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, 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

InstanceScriptpInstance
 
EventMap events
 
bool lock
 
bool inCenter
 
float x
 
float y
 
float z
 
int32 releaseLockTimer
 
- 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)
 
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_uromAI()

boss_urom::boss_uromAI::boss_uromAI ( Creature c)
inline
102 : ScriptedAI(c)
103 {
105 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1221
Definition ScriptedCreature.h:190
InstanceScript * pInstance
Definition boss_urom.cpp:107

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ AttackStart()

void boss_urom::boss_uromAI::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from UnitAI.

192 {
193 if (lock)
194 return;
195
196 if (me->GetDistance(1103.0f, 1049.0f, 510.0f) < 55.0f)
198 }
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1278
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:210
Creature * me
Definition ScriptedCreature.h:280
bool lock
Definition boss_urom.cpp:109

References ScriptedAI::AttackStart(), WorldObject::GetDistance(), lock, and ScriptedAI::me.

◆ EnterEvadeMode()

void boss_urom::boss_uromAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

371 {
372 me->SetCanFly(false);
373 me->SetDisableGravity(false);
375 inCenter = false;
377 }
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:215
void SetCanFly(bool enable)
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Unit.cpp:20386
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18063
void SetDisableGravity(bool disable)
Definition Unit.cpp:20326
bool inCenter
Definition boss_urom.cpp:109

References CreatureAI::EnterEvadeMode(), inCenter, ScriptedAI::me, Unit::SetCanFly(), Unit::SetControlled(), Unit::SetDisableGravity(), and UNIT_STATE_ROOT.

◆ GetPhaseByCurrentPosition()

uint8 boss_urom::boss_uromAI::GetPhaseByCurrentPosition ( )
inline
114 {
115 for (uint8 i = 0; i < 4; ++i)
116 if (me->GetDistance(cords[i][0], cords[i][1], cords[i][2]) < 20.0f)
117 return i;
118
119 return 0;
120 }
std::uint8_t uint8
Definition Define.h:109
float cords[5][4]
Definition boss_urom.cpp:78

References cords, WorldObject::GetDistance(), and ScriptedAI::me.

Referenced by JustEngagedWith(), and SpellHit().

◆ JustDied()

void boss_urom::boss_uromAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

219 {
221 if (pInstance)
222 {
224 }
225
226 // Body teleportation required only when boss is flying in the center
227 if (inCenter)
228 {
229 me->SetCanFly(false);
230 me->SetDisableGravity(false);
231 me->NearTeleportTo(x, y, z, 0.0f);
232 }
233 }
@ DONE
Definition InstanceScript.h:61
@ SAY_DEATH
Definition boss_urom.cpp:67
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:19733
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
Talk
Definition hyjal.cpp:82
@ DATA_UROM
Definition oculus.h:36
float z
Definition boss_urom.cpp:110
float x
Definition boss_urom.cpp:110
float y
Definition boss_urom.cpp:110

References DATA_UROM, DONE, inCenter, ScriptedAI::me, Unit::NearTeleportTo(), pInstance, SAY_DEATH, Unit::SetCanFly(), ZoneScript::SetData(), Unit::SetDisableGravity(), x, y, and z.

◆ JustEngagedWith()

void boss_urom::boss_uromAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

145 {
146 if (lock)
147 return;
148
150 if (phase == 3)
151 {
153
154 if (pInstance)
156
158 me->SetHomePosition(cords[0][0], cords[0][1], cords[0][2], cords[0][3]);
161
162 events.RescheduleEvent(EVENT_FROSTBOMB, 7s, 11s);
163 events.RescheduleEvent(EVENT_TELEPORT_TO_CENTER, 30s, 35s);
164 events.RescheduleEvent(EVENT_TIME_BOMB, 20s, 25s);
165 }
166 else
167 {
168 lock = true;
169
170 switch (phase)
171 {
172 case 0:
176 break;
177 case 1:
181 break;
182 case 2:
186 break;
187 }
188 }
189 }
@ IN_PROGRESS
Definition InstanceScript.h:59
events
Definition boss_sartura.cpp:43
phase
Definition boss_skadi.cpp:99
@ SAY_SUMMON_3
Definition boss_urom.cpp:63
@ SAY_AGGRO
Definition boss_urom.cpp:64
@ SAY_SUMMON_1
Definition boss_urom.cpp:61
@ SAY_SUMMON_2
Definition boss_urom.cpp:62
@ SPELL_SUMMON_MENAGERIE_2
Definition boss_urom.cpp:27
@ SPELL_SUMMON_MENAGERIE_3
Definition boss_urom.cpp:28
@ SPELL_EVOCATION
Definition boss_urom.cpp:25
@ SPELL_SUMMON_MENAGERIE_1
Definition boss_urom.cpp:26
@ EVENT_FROSTBOMB
Definition boss_urom.cpp:53
@ EVENT_TELEPORT_TO_CENTER
Definition boss_urom.cpp:54
@ EVENT_TIME_BOMB
Definition boss_urom.cpp:56
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2829
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:339
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4188
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
Definition Unit.cpp:4212
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:1194
uint8 GetPhaseByCurrentPosition()
Definition boss_urom.cpp:113

References Unit::CastSpell(), cords, DATA_UROM, EVENT_FROSTBOMB, EVENT_TELEPORT_TO_CENTER, EVENT_TIME_BOMB, Unit::FindCurrentSpellBySpellId(), GetPhaseByCurrentPosition(), IN_PROGRESS, Unit::InterruptNonMeleeSpells(), lock, ScriptedAI::me, pInstance, SAY_AGGRO, SAY_SUMMON_1, SAY_SUMMON_2, SAY_SUMMON_3, ZoneScript::SetData(), Creature::SetHomePosition(), Creature::SetInCombatWithZone(), SPELL_EVOCATION, SPELL_SUMMON_MENAGERIE_1, SPELL_SUMMON_MENAGERIE_2, and SPELL_SUMMON_MENAGERIE_3.

◆ JustSummoned()

void boss_urom::boss_uromAI::JustSummoned ( Creature pSummon)
inlineoverridevirtual

Reimplemented from CreatureAI.

201 {
202 pSummon->SetInCombatWithZone();
203 if (Unit* v = pSummon->SelectVictim())
204 if (pSummon->AI())
205 pSummon->AI()->AttackStart(v);
206 }
Unit * SelectVictim()
Definition Unit.cpp:14758
CreatureAI * AI() const
Definition Creature.h:145
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:27
Definition Unit.h:650

References Creature::AI(), UnitAI::AttackStart(), Creature::SelectVictim(), and Creature::SetInCombatWithZone().

◆ KilledUnit()

void boss_urom::boss_uromAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

236 {
238 }
@ SAY_PLAYER_KILL
Definition boss_urom.cpp:68

References SAY_PLAYER_KILL.

◆ LeaveCombat()

void boss_urom::boss_uromAI::LeaveCombat ( )
inline
209 {
212 me->CombatStop(true);
213 me->LoadCreaturesAddon(true);
214 me->SetLootRecipient(nullptr);
216 }
bool LoadCreaturesAddon(bool reload=false)
Definition Creature.cpp:2720
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1333
void ResetPlayerDamageReq()
Definition Creature.cpp:3748
void ClearAllThreat()
Definition ThreatMgr.cpp:417
void CombatStop(bool includingCast=false)
Definition Unit.cpp:10512
void RemoveAllAuras()
Definition Unit.cpp:5387
ThreatMgr & GetThreatMgr()
Definition Unit.h:936

References ThreatMgr::ClearAllThreat(), Unit::CombatStop(), Unit::GetThreatMgr(), Creature::LoadCreaturesAddon(), ScriptedAI::me, Unit::RemoveAllAuras(), Creature::ResetPlayerDamageReq(), and Creature::SetLootRecipient().

Referenced by SpellHit(), and UpdateAI().

◆ MoveInLineOfSight()

void boss_urom::boss_uromAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

304{}

◆ Reset()

void boss_urom::boss_uromAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

123 {
124 if (pInstance)
125 {
129 else
131 }
132
134 events.Reset();
135 lock = false;
136 inCenter = false;
137 x = 0.0f;
138 y = 0.0f;
139 z = 0.0f;
141 me->ApplySpellImmune(0, IMMUNITY_ID, 49838, true);
142 }
@ NOT_STARTED
Definition InstanceScript.h:58
@ IMMUNITY_ID
Definition SharedDefines.h:1411
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:255
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:13464
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:733
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:734
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
@ DATA_VAROS
Definition oculus.h:35
int32 releaseLockTimer
Definition boss_urom.cpp:111

References Unit::ApplySpellImmune(), Unit::CastSpell(), DATA_UROM, DATA_VAROS, DONE, ZoneScript::GetData(), IMMUNITY_ID, inCenter, lock, ScriptedAI::me, NOT_STARTED, pInstance, releaseLockTimer, Unit::RemoveUnitFlag(), ZoneScript::SetData(), Unit::SetUnitFlag(), SPELL_EVOCATION, UNIT_FLAG_NON_ATTACKABLE, x, y, and z.

◆ SpellHit()

void boss_urom::boss_uromAI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

241 {
242 switch (spell->Id)
243 {
245 {
246 for( uint8 i = 0; i < 4; ++i )
247 me->SummonCreature(summons[0][i], cords[0][0] + ((i % 2) ? 4.0f : -4.0f), cords[0][1] + (i < 2 ? 4.0f : -4.0f), cords[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
249 me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
251 LeaveCombat();
254 }
255 break;
257 {
258 for( uint8 i = 0; i < 4; ++i )
259 me->SummonCreature(summons[1][i], cords[1][0] + ((i % 2) ? 4.0f : -4.0f), cords[1][1] + (i < 2 ? 4.0f : -4.0f), cords[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
261 me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
263 LeaveCombat();
266 }
267 break;
269 {
270 for( uint8 i = 0; i < 4; ++i )
271 me->SummonCreature(summons[2][i], cords[2][0] + ((i % 2) ? 4.0f : -4.0f), cords[2][1] + (i < 2 ? 4.0f : -4.0f), cords[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
273 me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
275 LeaveCombat();
278 }
279 break;
280 case SPELL_TELEPORT:
283 me->StopMoving();
286 me->SetCanFly(true);
287 me->SetDisableGravity(true);
288 me->NearTeleportTo(1103.69f, 1048.76f, 512.279f, 1.16f);
289 inCenter = true;
290
293
294 //At this point we are still in casting state so we need to clear it for DoCastAOE not to fail
298 events.RescheduleEvent(EVENT_TELE_BACK, DUNGEON_MODE(9s, 7s));
299 default:
300 break;
301 }
302 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:50
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ EMOTE_ARCANE_EXPLOSION
Definition boss_urom.cpp:65
@ SAY_ARCANE_EXPLOSION
Definition boss_urom.cpp:66
@ SPELL_TELEPORT
Definition boss_urom.cpp:29
@ SPELL_EMPOWERED_ARCANE_EXPLOSION
Definition boss_urom.cpp:33
float summons[3][4]
Definition boss_urom.cpp:71
@ EVENT_TELE_BACK
Definition boss_urom.cpp:55
void MoveIdle()
Definition MotionMaster.cpp:233
void Clear(bool reset=true)
Definition MotionMaster.h:182
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:284
void ClearUnitState(uint32 f)
Definition Unit.h:722
MotionMaster * GetMotionMaster()
Definition Unit.h:1713
void StopMoving()
Definition Unit.cpp:16656
void AddUnitState(uint32 f)
Definition Unit.h:720
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:2359
void DestroyForVisiblePlayers()
Definition Object.cpp:2947
const T & DUNGEON_MODE(const T &normal5, const T &heroic10) const
Definition ScriptedCreature.h:388
void LeaveCombat()
Definition boss_urom.cpp:208

References Unit::AddUnitState(), Unit::CastSpell(), MotionMaster::Clear(), Unit::ClearUnitState(), cords, WorldObject::DestroyForVisiblePlayers(), UnitAI::DoCastAOE(), ScriptedAI::DUNGEON_MODE(), EMOTE_ARCANE_EXPLOSION, EVENT_TELE_BACK, Unit::GetMotionMaster(), GetPhaseByCurrentPosition(), SpellInfo::Id, inCenter, LeaveCombat(), ScriptedAI::me, MotionMaster::MoveIdle(), Unit::NearTeleportTo(), releaseLockTimer, SAY_ARCANE_EXPLOSION, Unit::SetCanFly(), Unit::SetControlled(), Unit::SetDisableGravity(), Creature::SetHomePosition(), Unit::SetUnitFlag(), SPELL_EMPOWERED_ARCANE_EXPLOSION, SPELL_EVOCATION, SPELL_SUMMON_MENAGERIE_1, SPELL_SUMMON_MENAGERIE_2, SPELL_SUMMON_MENAGERIE_3, SPELL_TELEPORT, Unit::StopMoving(), WorldObject::SummonCreature(), summons, TEMPSUMMON_TIMED_DESPAWN, UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, and UNIT_STATE_ROOT.

◆ UpdateAI()

void boss_urom::boss_uromAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

307 {
309 {
310 if (releaseLockTimer >= 5000)
311 {
312 lock = false;
313 if (me->IsInCombat())
314 {
315 LeaveCombat();
317 }
319 }
320 else
321 releaseLockTimer += diff;
322 }
323
324 if (!UpdateVictim())
325 return;
326
327 events.Update(diff);
328
330 return;
331
333
334 switch (events.ExecuteEvent())
335 {
336 case 0:
337 break;
338 case EVENT_FROSTBOMB:
339 if (Unit* v = me->GetVictim())
340 me->CastSpell(v, SPELL_FROSTBOMB, false);
341 events.Repeat(7s, 11s);
342 break;
343 case EVENT_TIME_BOMB:
344 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
345 DoCast(target, SPELL_TIME_BOMB);
346 events.Repeat(20s, 25s);
347 break;
349 x = me->GetPositionX();
350 y = me->GetPositionY();
351 z = me->GetPositionZ();
352 me->CastSpell(me, SPELL_TELEPORT, false);
353 events.Repeat(25s, 30s);
354 events.DelayEvents(10s);
355 break;
356 case EVENT_TELE_BACK:
358 me->DisableSpline();
359 me->SetCanFly(false);
360 me->SetDisableGravity(false);
361 me->NearTeleportTo(x, y, z, 0.0f);
365 inCenter = false;
366 break;
367 }
368 }
@ SPELL_FROSTBOMB
Definition boss_urom.cpp:31
@ SPELL_TIME_BOMB
Definition boss_urom.cpp:32
bool UpdateVictim()
Definition CreatureAI.cpp:287
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:314
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:110
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:177
void DisableSpline()
Definition Unit.cpp:637
Unit * GetVictim() const
Definition Unit.h:886
bool HasUnitState(const uint32 f) const
Definition Unit.h:721
bool IsInCombat() const
Definition Unit.h:917
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References Unit::CastSpell(), Unit::DisableSpline(), UnitAI::DoCast(), UnitAI::DoMeleeAttackIfReady(), EVENT_FROSTBOMB, EVENT_TELE_BACK, EVENT_TELEPORT_TO_CENTER, EVENT_TIME_BOMB, Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetVictim(), Unit::HasUnitState(), inCenter, Unit::IsInCombat(), LeaveCombat(), lock, ScriptedAI::me, MotionMaster::MoveChase(), MotionMaster::MoveIdle(), Unit::NearTeleportTo(), Random, releaseLockTimer, Unit::RemoveUnitFlag(), UnitAI::SelectTarget(), Unit::SetCanFly(), Unit::SetControlled(), Unit::SetDisableGravity(), SPELL_EVOCATION, SPELL_FROSTBOMB, SPELL_TELEPORT, SPELL_TIME_BOMB, UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, UNIT_STATE_ROOT, CreatureAI::UpdateVictim(), x, y, and z.

Member Data Documentation

◆ events

EventMap boss_urom::boss_uromAI::events

◆ inCenter

bool boss_urom::boss_uromAI::inCenter

◆ lock

bool boss_urom::boss_uromAI::lock

◆ pInstance

InstanceScript* boss_urom::boss_uromAI::pInstance

◆ releaseLockTimer

int32 boss_urom::boss_uromAI::releaseLockTimer

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

◆ x

float boss_urom::boss_uromAI::x

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

◆ y

float boss_urom::boss_uromAI::y

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

◆ z

float boss_urom::boss_uromAI::z

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


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