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=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 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.
 
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 ()
 
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 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:
 
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
107 : ScriptedAI(c)
108 {
110 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
Definition ScriptedCreature.h:190
InstanceScript * pInstance
Definition boss_urom.cpp:112

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ AttackStart()

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

Reimplemented from UnitAI.

197 {
198 if (lock)
199 return;
200
201 if (me->GetDistance(1103.0f, 1049.0f, 510.0f) < 55.0f)
203 }
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1256
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:210
Creature * me
Definition ScriptedCreature.h:280
bool lock
Definition boss_urom.cpp:114

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

◆ EnterEvadeMode()

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

Reimplemented from CreatureAI.

376 {
377 me->SetCanFly(false);
378 me->SetDisableGravity(false);
380 inCenter = false;
382 }
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:208
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:3222
bool SetCanFly(bool enable, bool packetOnly=false) override
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Creature.cpp:3307
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18086
bool inCenter
Definition boss_urom.cpp:114

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

◆ GetPhaseByCurrentPosition()

uint8 boss_urom::boss_uromAI::GetPhaseByCurrentPosition ( )
inline
119 {
120 for (uint8 i = 0; i < 4; ++i)
121 if (me->GetDistance(cords[i][0], cords[i][1], cords[i][2]) < 20.0f)
122 return i;
123
124 return 0;
125 }
std::uint8_t uint8
Definition Define.h:109
float cords[5][4]
Definition boss_urom.cpp:83

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

Referenced by JustEngagedWith(), and SpellHit().

◆ JustDied()

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

Reimplemented from CreatureAI.

224 {
226 if (pInstance)
227 {
229 }
230
231 // Body teleportation required only when boss is flying in the center
232 if (inCenter)
233 {
234 me->SetCanFly(false);
235 me->SetDisableGravity(false);
236 me->NearTeleportTo(x, y, z, 0.0f);
237 }
238 }
@ DONE
Definition InstanceScript.h:61
@ SAY_DEATH
Definition boss_urom.cpp:72
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:20031
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:115
float x
Definition boss_urom.cpp:115
float y
Definition boss_urom.cpp:115

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

◆ JustEngagedWith()

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

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

150 {
151 if (lock)
152 return;
153
155 if (phase == 3)
156 {
158
159 if (pInstance)
161
163 me->SetHomePosition(cords[0][0], cords[0][1], cords[0][2], cords[0][3]);
166
167 events.RescheduleEvent(EVENT_FROSTBOMB, 7s, 11s);
168 events.RescheduleEvent(EVENT_TELEPORT_TO_CENTER, 30s, 35s);
169 events.RescheduleEvent(EVENT_TIME_BOMB, 20s, 25s);
170 }
171 else
172 {
173 lock = true;
174
175 switch (phase)
176 {
177 case 0:
181 break;
182 case 1:
186 break;
187 case 2:
191 break;
192 }
193 }
194 }
@ IN_PROGRESS
Definition InstanceScript.h:59
events
Definition boss_sartura.cpp:43
phase
Definition boss_skadi.cpp:103
@ SAY_SUMMON_3
Definition boss_urom.cpp:68
@ SAY_AGGRO
Definition boss_urom.cpp:69
@ SAY_SUMMON_1
Definition boss_urom.cpp:66
@ SAY_SUMMON_2
Definition boss_urom.cpp:67
@ 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:58
@ EVENT_TELEPORT_TO_CENTER
Definition boss_urom.cpp:59
@ EVENT_TIME_BOMB
Definition boss_urom.cpp:61
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2828
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:340
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4161
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
Definition Unit.cpp:4176
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
uint8 GetPhaseByCurrentPosition()
Definition boss_urom.cpp:118

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.

206 {
207 pSummon->SetInCombatWithZone();
208 if (Unit* v = pSummon->SelectVictim())
209 if (pSummon->AI())
210 pSummon->AI()->AttackStart(v);
211 }
Unit * SelectVictim()
Definition Unit.cpp:14785
CreatureAI * AI() const
Definition Creature.h:141
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:27
Definition Unit.h:636

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

◆ KilledUnit()

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

Reimplemented from CreatureAI.

241 {
243 }
@ SAY_PLAYER_KILL
Definition boss_urom.cpp:73

References SAY_PLAYER_KILL.

◆ LeaveCombat()

void boss_urom::boss_uromAI::LeaveCombat ( )
inline
214 {
217 me->CombatStop(true);
218 me->LoadCreaturesAddon(true);
219 me->SetLootRecipient(nullptr);
221 }
bool LoadCreaturesAddon(bool reload=false)
Definition Creature.cpp:2715
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1326
void ResetPlayerDamageReq()
Definition Creature.cpp:3834
void ClearAllThreat()
Definition ThreatMgr.cpp:417
void CombatStop(bool includingCast=false)
Definition Unit.cpp:10481
void RemoveAllAuras()
Definition Unit.cpp:5351
ThreatMgr & GetThreatMgr()
Definition Unit.h:912

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.

309{}

◆ Reset()

void boss_urom::boss_uromAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

128 {
129 if (pInstance)
130 {
134 else
136 }
137
139 events.Reset();
140 lock = false;
141 inCenter = false;
142 x = 0.0f;
143 y = 0.0f;
144 z = 0.0f;
146 me->ApplySpellImmune(0, IMMUNITY_ID, 49838, true);
147 }
@ NOT_STARTED
Definition InstanceScript.h:58
@ IMMUNITY_ID
Definition SharedDefines.h:1400
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:251
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:13434
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:719
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:720
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
@ DATA_VAROS
Definition oculus.h:35
int32 releaseLockTimer
Definition boss_urom.cpp:116

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.

246 {
247 switch (spell->Id)
248 {
250 {
251 for( uint8 i = 0; i < 4; ++i )
252 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);
254 me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
256 LeaveCombat();
259 }
260 break;
262 {
263 for( uint8 i = 0; i < 4; ++i )
264 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);
266 me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
268 LeaveCombat();
271 }
272 break;
274 {
275 for( uint8 i = 0; i < 4; ++i )
276 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);
278 me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
280 LeaveCombat();
283 }
284 break;
285 case SPELL_TELEPORT:
288 me->StopMoving();
291 me->SetCanFly(true);
292 me->SetDisableGravity(true);
293 me->NearTeleportTo(1103.69f, 1048.76f, 512.279f, 1.16f);
294 inCenter = true;
295
298
299 //At this point we are still in casting state so we need to clear it for DoCastAOE not to fail
303 events.RescheduleEvent(EVENT_TELE_BACK, DUNGEON_MODE(9000, 7000));
304 default:
305 break;
306 }
307 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:48
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ EMOTE_ARCANE_EXPLOSION
Definition boss_urom.cpp:70
@ SAY_ARCANE_EXPLOSION
Definition boss_urom.cpp:71
@ SPELL_EMPOWERED_ARCANE_EXPLOSION_N
Definition boss_urom.cpp:34
@ SPELL_EMPOWERED_ARCANE_EXPLOSION_H
Definition boss_urom.cpp:35
@ SPELL_TELEPORT
Definition boss_urom.cpp:29
float summons[3][4]
Definition boss_urom.cpp:76
@ EVENT_TELE_BACK
Definition boss_urom.cpp:60
void MoveIdle()
Definition MotionMaster.cpp:232
void Clear(bool reset=true)
Definition MotionMaster.h:167
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:248
void ClearUnitState(uint32 f)
Definition Unit.h:708
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
void StopMoving()
Definition Unit.cpp:16702
void AddUnitState(uint32 f)
Definition Unit.h:706
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
void DestroyForNearbyPlayers()
Definition Object.cpp:2955
const T & DUNGEON_MODE(const T &normal5, const T &heroic10) const
Definition ScriptedCreature.h:388
void LeaveCombat()
Definition boss_urom.cpp:213

References Unit::AddUnitState(), Unit::CastSpell(), MotionMaster::Clear(), Unit::ClearUnitState(), cords, WorldObject::DestroyForNearbyPlayers(), 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, Creature::SetCanFly(), Unit::SetControlled(), Creature::SetDisableGravity(), Creature::SetHomePosition(), Unit::SetUnitFlag(), SPELL_EMPOWERED_ARCANE_EXPLOSION_H, SPELL_EMPOWERED_ARCANE_EXPLOSION_N, 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.

312 {
314 {
315 if (releaseLockTimer >= 5000)
316 {
317 lock = false;
318 if (me->IsInCombat())
319 {
320 LeaveCombat();
322 }
324 }
325 else
326 releaseLockTimer += diff;
327 }
328
329 if (!UpdateVictim())
330 return;
331
332 events.Update(diff);
333
335 return;
336
338
339 switch (events.ExecuteEvent())
340 {
341 case 0:
342 break;
343 case EVENT_FROSTBOMB:
344 if (Unit* v = me->GetVictim())
345 me->CastSpell(v, SPELL_FROSTBOMB, false);
346 events.Repeat(7s, 11s);
347 break;
348 case EVENT_TIME_BOMB:
349 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
351 events.Repeat(20s, 25s);
352 break;
354 x = me->GetPositionX();
355 y = me->GetPositionY();
356 z = me->GetPositionZ();
357 me->CastSpell(me, SPELL_TELEPORT, false);
358 events.Repeat(25s, 30s);
359 events.DelayEvents(10s);
360 break;
361 case EVENT_TELE_BACK:
363 me->DisableSpline();
364 me->SetCanFly(false);
365 me->SetDisableGravity(false);
366 me->NearTeleportTo(x, y, z, 0.0f);
370 inCenter = false;
371 break;
372 }
373 }
@ SPELL_TIME_BOMB_H
Definition boss_urom.cpp:33
@ SPELL_FROSTBOMB
Definition boss_urom.cpp:31
@ SPELL_TIME_BOMB_N
Definition boss_urom.cpp:32
bool UpdateVictim()
Definition CreatureAI.cpp:280
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:313
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:636
Unit * GetVictim() const
Definition Unit.h:862
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
bool IsInCombat() const
Definition Unit.h:893
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(), ScriptedAI::DUNGEON_MODE(), 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(), Creature::SetCanFly(), Unit::SetControlled(), Creature::SetDisableGravity(), SPELL_EVOCATION, SPELL_FROSTBOMB, SPELL_TELEPORT, SPELL_TIME_BOMB_H, SPELL_TIME_BOMB_N, 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: