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

Public Member Functions

 boss_razorscale (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void ScheduleAirEvents ()
 
void ScheduleGroundEvents ()
 
void DoAction (int32 action) override
 
void MovementInform (uint32 type, uint32 pointId) override
 
void SpellHit (Unit *, SpellInfo const *spellInfo) override
 
void SummonMinions ()
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDies (Creature *summon, Unit *) override
 
uint32 GetData (uint32 id) const override
 
void HandleMusic (bool active)
 
void EnterEvadeMode (EvadeReason why) override
 
void JustDied (Unit *) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () 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 (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &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
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, 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 *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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 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 EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
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, int32 aura=0)
 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
 

Private Attributes

uint8 _engineersAlive {}
 
uint8 _defenderCnt {}
 
uint8 _trapperCnt {}
 
uint8 _harpoonHits {}
 
uint32 _flyCount {}
 
bool _permaGround {}
 

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 ()
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- 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 BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_razorscale()

boss_razorscale::boss_razorscale ( Creature creature)
inlineexplicit
212 : BossAI(creature, BOSS_RAZORSCALE)
213 {
214 Initialize();
215 }
Definition ScriptedCreature.h:485
void Initialize()
Definition boss_razorscale.cpp:217
@ BOSS_RAZORSCALE
Definition ulduar.h:33

References Initialize().

Member Function Documentation

◆ DamageTaken()

void boss_razorscale::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 UnitAI.

361 {
362 if (!_permaGround && me->HealthBelowPctDamaged(50, damage) && events.IsInPhase(PHASE_GROUND))
363 {
364 _permaGround = true;
367 }
368 }
@ REACT_AGGRESSIVE
Definition Unit.h:569
@ ACTION_START_PERMA_GROUND
Definition boss_razorscale.cpp:123
@ PHASE_GROUND
Definition boss_razorscale.cpp:141
events
Definition boss_sartura.cpp:43
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1118
Creature * me
Definition ScriptedCreature.h:281
bool _permaGround
Definition boss_razorscale.cpp:538
void DoAction(int32 action) override
Definition boss_razorscale.cpp:270

References _permaGround, ACTION_START_PERMA_GROUND, DoAction(), Unit::HealthBelowPctDamaged(), ScriptedAI::me, PHASE_GROUND, REACT_AGGRESSIVE, and Creature::SetReactState().

◆ DoAction()

void boss_razorscale::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

271 {
272 switch (action)
273 {
275 me->SetImmuneToPC(false);
276 me->SetSpeedRate(MOVE_RUN, 3.0f);
277 me->StopMoving();
279 break;
282 events.SetPhase(PHASE_GROUND);
283 _harpoonHits = 0;
284 me->SetSpeedRate(MOVE_RUN, 3.0f);
286 break;
288 me->SetDisableGravity(false);
292 events.ScheduleEvent(EVENT_RESUME_CHASE, 1s);
294 break;
295 default:
296 break;
297 }
298 }
@ FORCED_MOVEMENT_NONE
Definition MotionMaster.h:86
@ MOVE_RUN
Definition UnitDefines.h:357
@ EMOTE_PERMA_GROUND
Definition boss_razorscale.cpp:169
@ SPELL_WING_BUFFET
Definition boss_razorscale.cpp:38
@ SPELL_STUN_SELF
Definition boss_razorscale.cpp:47
static Position const RazorLandPos
Definition boss_razorscale.cpp:176
@ ACTION_GROUND_PHASE
Definition boss_razorscale.cpp:122
@ ACTION_START_FIGHT
Definition boss_razorscale.cpp:121
static Position const RazorFlightPos
Definition boss_razorscale.cpp:174
@ POINT_RAZORSCALE_LAND
Definition boss_razorscale.cpp:154
@ POINT_RAZORSCALE_FLIGHT
Definition boss_razorscale.cpp:153
@ EVENT_RESUME_CHASE
Definition boss_razorscale.cpp:102
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5050
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4312
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
void StopMoving()
Definition Unit.cpp:13034
void SetSpeedRate(UnitMoveType mtype, float rate)
Definition Unit.h:1742
void SetDisableGravity(bool disable)
Definition Unit.cpp:16506
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10631
Talk
Definition hyjal.cpp:82
uint8 _harpoonHits
Definition boss_razorscale.cpp:536
void ScheduleGroundEvents()
Definition boss_razorscale.cpp:261

References _harpoonHits, ACTION_GROUND_PHASE, ACTION_START_FIGHT, ACTION_START_PERMA_GROUND, UnitAI::DoCastSelf(), EMOTE_PERMA_GROUND, EVENT_RESUME_CHASE, Fly, FORCED_MOVEMENT_NONE, Unit::GetMotionMaster(), Unit::InterruptNonMeleeSpells(), ScriptedAI::me, MOVE_RUN, MotionMaster::MovePoint(), PHASE_GROUND, POINT_RAZORSCALE_FLIGHT, POINT_RAZORSCALE_LAND, RazorFlightPos, RazorLandPos, Unit::RemoveAura(), ScheduleGroundEvents(), Unit::SetDisableGravity(), Unit::SetImmuneToPC(), Unit::SetSpeedRate(), SPELL_STUN_SELF, SPELL_WING_BUFFET, and Unit::StopMoving().

Referenced by DamageTaken(), and SpellHit().

◆ EnterEvadeMode()

void boss_razorscale::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

403 {
404 if (why == EVADE_REASON_BOUNDARY && !events.IsInPhase(PHASE_PERMA_GROUND))
405 return;
407
408 // Despawn dark rune minions summoned by spawner spells (not tracked by BossAI summons)
410 {
411 std::list<Creature*> minions;
412 me->GetCreatureListWithEntryInGrid(minions, entry, 200.0f);
413 for (Creature* creature : minions)
414 creature->DespawnOrUnsummon();
415 }
416
419 HandleMusic(false);
420 }
std::uint32_t uint32
Definition Define.h:107
@ ENCOUNTER_FRAME_DISENGAGE
Definition InstanceScript.h:47
@ PHASE_PERMA_GROUND
Definition boss_razorscale.cpp:142
InstanceScript *const instance
Definition ScriptedCreature.h:492
SummonList summons
Definition ScriptedCreature.h:539
void _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition ScriptedCreature.cpp:702
@ EVADE_REASON_BOUNDARY
Definition CreatureAI.h:89
Definition Creature.h:47
void SendEncounterUnit(uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
Definition InstanceScript.cpp:775
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition Object.cpp:2614
void HandleMusic(bool active)
Definition boss_razorscale.cpp:397
@ NPC_DARK_RUNE_SENTINEL
Definition ulduar.h:193
@ NPC_DARK_RUNE_GUARDIAN
Definition ulduar.h:191
@ NPC_DARK_RUNE_WATCHER
Definition ulduar.h:192

References BossAI::_EnterEvadeMode(), SummonList::DespawnAll(), ENCOUNTER_FRAME_DISENGAGE, CreatureAI::EVADE_REASON_BOUNDARY, WorldObject::GetCreatureListWithEntryInGrid(), HandleMusic(), BossAI::instance, ScriptedAI::me, NPC_DARK_RUNE_GUARDIAN, NPC_DARK_RUNE_SENTINEL, NPC_DARK_RUNE_WATCHER, PHASE_PERMA_GROUND, InstanceScript::SendEncounterUnit(), and BossAI::summons.

◆ GetData()

uint32 boss_razorscale::GetData ( uint32  id) const
inlineoverridevirtual

Reimplemented from UnitAI.

393 {
394 return (id == DATA_QUICK_SHAVE_ID && _flyCount <= 1) ? 1 : 0;
395 }
@ DATA_QUICK_SHAVE_ID
Definition boss_razorscale.cpp:147
uint32 _flyCount
Definition boss_razorscale.cpp:537

References _flyCount, and DATA_QUICK_SHAVE_ID.

◆ HandleMusic()

void boss_razorscale::HandleMusic ( bool  active)
inline
398 {
400 }
@ WORLD_STATE_RAZORSCALE_MUSIC
Definition boss_razorscale.cpp:160
void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue)
Definition InstanceScript.cpp:639

References InstanceScript::DoUpdateWorldState(), BossAI::instance, and WORLD_STATE_RAZORSCALE_MUSIC.

Referenced by EnterEvadeMode(), JustDied(), and JustEngagedWith().

◆ Initialize()

void boss_razorscale::Initialize ( )
inline
218 {
219 _engineersAlive = 3;
220 _defenderCnt = 0;
221 _trapperCnt = 0;
222 _harpoonHits = 0;
223 _flyCount = 0;
224 _permaGround = false;
225 me->SetDisableGravity(true);
226 }
uint8 _defenderCnt
Definition boss_razorscale.cpp:534
uint8 _engineersAlive
Definition boss_razorscale.cpp:533
uint8 _trapperCnt
Definition boss_razorscale.cpp:535

References _defenderCnt, _engineersAlive, _flyCount, _harpoonHits, _permaGround, _trapperCnt, ScriptedAI::me, and Unit::SetDisableGravity().

Referenced by boss_razorscale(), and Reset().

◆ JustDied()

void boss_razorscale::JustDied ( Unit )
inlineoverridevirtual

◆ JustEngagedWith()

void boss_razorscale::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

243 {
245 me->SetImmuneToPC(false);
249 events.ScheduleEvent(EVENT_BERSERK, 10min);
250 HandleMusic(true);
251 }
@ ENCOUNTER_FRAME_ENGAGE
Definition InstanceScript.h:46
@ EVENT_BERSERK
Definition boss_razorscale.cpp:91
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged - this happens after JustEnteredCombat.
Definition ScriptedCreature.h:525
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
void ScheduleAirEvents()
Definition boss_razorscale.cpp:253

References ACTION_START_FIGHT, SummonList::DoAction(), ENCOUNTER_FRAME_ENGAGE, EVENT_BERSERK, HandleMusic(), BossAI::instance, BossAI::JustEngagedWith(), ScriptedAI::me, ScheduleAirEvents(), InstanceScript::SendEncounterUnit(), Unit::SetImmuneToPC(), and BossAI::summons.

◆ JustSummoned()

void boss_razorscale::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

371 {
372 BossAI::JustSummoned(summon);
373 if (summon->GetEntry() == NPC_EXPEDITION_DEFENDER)
374 summon->AI()->SetData(0, _defenderCnt++);
375 else if (summon->GetEntry() == NPC_EXPEDITION_TRAPPER)
376 summon->AI()->SetData(0, _trapperCnt++);
377 }
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:725
CreatureAI * AI() const
Definition Creature.h:144
uint32 GetEntry() const
Definition Object.h:117
virtual void SetData(uint32, uint32)
Definition UnitAI.h:219
@ NPC_EXPEDITION_TRAPPER
Definition ulduar.h:190
@ NPC_EXPEDITION_DEFENDER
Definition ulduar.h:189

References _defenderCnt, _trapperCnt, Creature::AI(), Object::GetEntry(), BossAI::JustSummoned(), NPC_EXPEDITION_DEFENDER, NPC_EXPEDITION_TRAPPER, and UnitAI::SetData().

◆ MovementInform()

void boss_razorscale::MovementInform ( uint32  type,
uint32  pointId 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

301 {
302 if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
303 return;
304
305 switch (pointId)
306 {
310 break;
314 break;
316 me->SetDisableGravity(false);
317 if (!_permaGround)
318 {
323 summons.DoAction(ACTION_GROUND_PHASE, commanderPred);
324 events.ScheduleEvent(EVENT_FLAME_BREATH, 30s, 0, PHASE_GROUND);
325 }
326 break;
328 me->SetSpeedRate(MOVE_RUN, 3.0f);
330 break;
335 ++_flyCount;
336 break;
337 default:
338 break;
339 }
340 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ EFFECT_MOTION_TYPE
Definition MotionMaster.h:56
static Position const RazorGroundPos
Definition boss_razorscale.cpp:177
@ POINT_RAZORSCALE_TAKEOFF
Definition boss_razorscale.cpp:156
@ POINT_RAZORSCALE_FLIGHT_2
Definition boss_razorscale.cpp:157
@ POINT_RAZORSCALE_GROUND
Definition boss_razorscale.cpp:155
@ EVENT_FLAME_BREATH
Definition boss_razorscale.cpp:99
static Position const RazorFlightPos2
Definition boss_razorscale.cpp:175
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition CreatureAI.cpp:117
Definition ScriptedCreature.h:168
void MoveLand(uint32 id, Position const &pos, float speed=0.0f)
Use to move the unit from the air to the ground. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:554
void SetFacingTo(float ori)
Definition Unit.cpp:16455
float GetOrientation() const
Definition Position.h:124
@ NPC_EXPEDITION_COMMANDER
Definition ulduar.h:187

References _flyCount, _permaGround, ACTION_GROUND_PHASE, SummonList::DoAction(), UnitAI::DoCastSelf(), CreatureAI::DoZoneInCombat(), EFFECT_MOTION_TYPE, EVENT_FLAME_BREATH, Unit::GetMotionMaster(), Position::GetOrientation(), ScriptedAI::me, MOVE_RUN, MotionMaster::MoveLand(), MotionMaster::MovePoint(), NPC_EXPEDITION_COMMANDER, NPC_EXPEDITION_TRAPPER, PHASE_GROUND, POINT_MOTION_TYPE, POINT_RAZORSCALE_FLIGHT, POINT_RAZORSCALE_FLIGHT_2, POINT_RAZORSCALE_GROUND, POINT_RAZORSCALE_LAND, POINT_RAZORSCALE_TAKEOFF, RazorFlightPos, RazorFlightPos2, RazorGroundPos, RazorLandPos, REACT_AGGRESSIVE, ScheduleAirEvents(), Unit::SetDisableGravity(), Unit::SetFacingTo(), Creature::SetReactState(), Unit::SetSpeedRate(), SPELL_STUN_SELF, and BossAI::summons.

◆ Reset()

void boss_razorscale::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

229 {
230 _Reset();
231 Initialize();
232 events.SetPhase(PHASE_NONE);
235 if (Is25ManRaid())
237 me->SetImmuneToPC(true);
238 me->SetCombatMovement(false);
240 }
@ GROUP_EXPEDITION
Definition boss_razorscale.cpp:150
@ GROUP_FIRE_STATE_10
Definition boss_razorscale.cpp:151
@ GROUP_FIRE_STATE_25
Definition boss_razorscale.cpp:152
@ PHASE_NONE
Definition boss_razorscale.cpp:139
void _Reset()
Definition ScriptedCreature.cpp:644
void SetCombatMovement(bool allowMovement)
Definition Creature.cpp:3916
void SetAnimTier(AnimTier animTier)
Definition Unit.cpp:11926
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2525
bool Is25ManRaid() const
Definition ScriptedCreature.h:389

References BossAI::_Reset(), Fly, GROUP_EXPEDITION, GROUP_FIRE_STATE_10, GROUP_FIRE_STATE_25, Initialize(), ScriptedAI::Is25ManRaid(), ScriptedAI::me, PHASE_NONE, Unit::SetAnimTier(), Creature::SetCombatMovement(), Unit::SetImmuneToPC(), and WorldObject::SummonCreatureGroup().

◆ ScheduleAirEvents()

void boss_razorscale::ScheduleAirEvents ( )
inline
254 {
255 events.SetPhase(PHASE_AIR);
256 events.ScheduleEvent(EVENT_FIREBALL_AIR, 3s, 0, PHASE_AIR);
257 events.ScheduleEvent(EVENT_DEVOURING_FLAME, 9s, 0, PHASE_AIR);
258 events.ScheduleEvent(EVENT_SUMMON_MINIONS, 1s, 0, PHASE_AIR);
259 }
@ EVENT_SUMMON_MINIONS
Definition boss_razorscale.cpp:94
@ EVENT_FIREBALL_AIR
Definition boss_razorscale.cpp:92
@ EVENT_DEVOURING_FLAME
Definition boss_razorscale.cpp:93
@ PHASE_AIR
Definition boss_razorscale.cpp:140

References EVENT_DEVOURING_FLAME, EVENT_FIREBALL_AIR, EVENT_SUMMON_MINIONS, and PHASE_AIR.

Referenced by JustEngagedWith(), and MovementInform().

◆ ScheduleGroundEvents()

void boss_razorscale::ScheduleGroundEvents ( )
inline
262 {
263 events.SetPhase(PHASE_PERMA_GROUND);
264 events.ScheduleEvent(EVENT_FIREBOLT, 3s, 0, PHASE_PERMA_GROUND);
265 events.ScheduleEvent(EVENT_FUSE_ARMOR, 15s, 0, PHASE_PERMA_GROUND);
267 events.ScheduleEvent(EVENT_DEVOURING_FLAME, 22s, 0, PHASE_PERMA_GROUND);
268 }
@ EVENT_FUSE_ARMOR
Definition boss_razorscale.cpp:101
@ EVENT_FLAME_BREATH_GROUNDED
Definition boss_razorscale.cpp:96
@ EVENT_FIREBOLT
Definition boss_razorscale.cpp:100

References EVENT_DEVOURING_FLAME, EVENT_FIREBOLT, EVENT_FLAME_BREATH_GROUNDED, EVENT_FUSE_ARMOR, and PHASE_PERMA_GROUND.

Referenced by DoAction().

◆ SpellHit()

void boss_razorscale::SpellHit ( Unit ,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

343 {
344 if (spellInfo->Id == SPELL_HARPOON_TRIGGER)
345 {
346 _harpoonHits++;
347 if (_harpoonHits >= RAID_MODE<uint32>(2, 4))
349 }
350 }
@ SPELL_HARPOON_TRIGGER
Definition boss_razorscale.cpp:57

References _harpoonHits, ACTION_GROUND_PHASE, DoAction(), SpellInfo::Id, and SPELL_HARPOON_TRIGGER.

◆ SummonedCreatureDies()

void boss_razorscale::SummonedCreatureDies ( Creature summon,
Unit  
)
inlineoverridevirtual

Reimplemented from CreatureAI.

380 {
381 if (summon->GetEntry() == NPC_EXPEDITION_ENGINEER)
382 {
384 if (_engineersAlive == 0)
385 {
388 }
389 }
390 }
@ ACTION_ENGINEER_DEAD
Definition boss_razorscale.cpp:130
@ NPC_EXPEDITION_ENGINEER
Definition ulduar.h:188

References _engineersAlive, ACTION_ENGINEER_DEAD, SummonList::DoAction(), Object::GetEntry(), NPC_EXPEDITION_COMMANDER, NPC_EXPEDITION_ENGINEER, and BossAI::summons.

◆ SummonMinions()

void boss_razorscale::SummonMinions ( )
inline
353 {
354 float x = frand(540.0f, 640.0f);
355 float y = frand(-230.0f, -195.0f);
356 float z = 391.517f;
358 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:51
float frand(float min, float max)
Definition Random.cpp:57
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2448
@ NPC_RAZORSCALE_SPAWNER
Definition ulduar.h:185

References frand(), ScriptedAI::me, NPC_RAZORSCALE_SPAWNER, WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_DESPAWN.

Referenced by UpdateAI().

◆ UpdateAI()

void boss_razorscale::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

430 {
431 if (!UpdateVictim())
432 return;
433
434 events.Update(diff);
435
437 return;
438
439 while (uint32 eventId = events.ExecuteEvent())
440 {
441 switch (eventId)
442 {
443 case EVENT_BERSERK:
446 break;
448 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true))
449 DoCast(target, SPELL_FIREBALL);
450 events.Repeat(3s, 4s);
451 break;
453 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.0f, true))
455 events.Repeat(_permaGround ? Seconds(10) : Seconds(6), _permaGround ? Seconds(12) : Seconds(12));
456 break;
458 {
459 uint8 count = RAID_MODE<uint8>(2, urand(2, 4));
460 uint32 delay = 5;
461 for (uint8 i = 0; i < count; ++i)
462 {
463 events.ScheduleEvent(EVENT_SUMMON_MINIONS_DELAYED, Milliseconds(delay * 1000), 0, PHASE_AIR);
464 delay += urand(2, 5);
465 }
466 events.Repeat(48s);
467 break;
468 }
471 break;
475 if (Unit* victim = me->GetVictim())
476 DoCast(victim, SPELL_FLAME_BREATH);
477 events.ScheduleEvent(EVENT_WING_BUFFET, 2s, 0, PHASE_GROUND);
478 break;
481 if (Unit* victim = me->GetVictim())
482 DoCast(victim, SPELL_FLAME_BREATH);
483 events.Repeat(21s);
484 break;
487 {
492 }
493 events.ScheduleEvent(EVENT_FIREBOLT, 2s, 0, PHASE_GROUND);
494 events.ScheduleEvent(EVENT_RESUME_AIR, 4s, 0, PHASE_GROUND);
495 break;
496 case EVENT_RESUME_AIR:
497 {
498 me->SetDisableGravity(true);
499 events.SetPhase(PHASE_AIR);
504 break;
505 }
506 case EVENT_FIREBOLT:
508 break;
509 case EVENT_FUSE_ARMOR:
510 if (Unit* victim = me->GetVictim())
511 if (!victim->HasAura(SPELL_FUSED_ARMOR))
512 DoCast(victim, SPELL_FUSE_ARMOR);
513 events.Repeat(12s);
514 break;
516 me->SetCombatMovement(true);
517 if (Unit* victim = me->GetVictim())
518 me->GetMotionMaster()->MoveChase(victim);
519 break;
520 default:
521 break;
522 }
523
525 return;
526 }
527
528 if (events.IsInPhase(PHASE_PERMA_GROUND))
530 }
std::uint8_t uint8
Definition Define.h:109
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:30
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ REACT_PASSIVE
Definition Unit.h:567
@ EMOTE_BREATH
Definition boss_razorscale.cpp:170
@ EMOTE_BERSERK
Definition boss_razorscale.cpp:171
@ SPELL_FLAME_BREATH
Definition boss_razorscale.cpp:36
@ SPELL_FIREBOLT
Definition boss_razorscale.cpp:40
@ SPELL_FIREBALL
Definition boss_razorscale.cpp:39
@ SPELL_FUSED_ARMOR
Definition boss_razorscale.cpp:45
@ SPELL_FUSE_ARMOR
Definition boss_razorscale.cpp:44
@ SPELL_BERSERK
Definition boss_razorscale.cpp:46
@ SPELL_DEVOURING_FLAME
Definition boss_razorscale.cpp:41
@ ACTION_STOP_CONTROLLERS
Definition boss_razorscale.cpp:129
@ EVENT_WING_BUFFET
Definition boss_razorscale.cpp:97
@ EVENT_RESUME_AIR
Definition boss_razorscale.cpp:98
@ EVENT_SUMMON_MINIONS_DELAYED
Definition boss_razorscale.cpp:95
bool UpdateVictim()
Definition CreatureAI.cpp:350
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:316
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:179
Definition Unit.h:665
Unit * GetVictim() const
Definition Unit.h:904
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
void SummonMinions()
Definition boss_razorscale.cpp:352

References _permaGround, ACTION_START_FIGHT, ACTION_STOP_CONTROLLERS, SummonList::DoAction(), UnitAI::DoCast(), UnitAI::DoCastSelf(), UnitAI::DoMeleeAttackIfReady(), EMOTE_BERSERK, EMOTE_BREATH, EVENT_BERSERK, EVENT_DEVOURING_FLAME, EVENT_FIREBALL_AIR, EVENT_FIREBOLT, EVENT_FLAME_BREATH, EVENT_FLAME_BREATH_GROUNDED, EVENT_FUSE_ARMOR, EVENT_RESUME_AIR, EVENT_RESUME_CHASE, EVENT_SUMMON_MINIONS, EVENT_SUMMON_MINIONS_DELAYED, EVENT_WING_BUFFET, Fly, FORCED_MOVEMENT_NONE, Unit::GetMotionMaster(), Unit::GetVictim(), Unit::HasUnitState(), ScriptedAI::me, MotionMaster::MoveChase(), MotionMaster::MovePoint(), NPC_EXPEDITION_COMMANDER, NPC_EXPEDITION_ENGINEER, NPC_EXPEDITION_TRAPPER, PHASE_AIR, PHASE_GROUND, PHASE_PERMA_GROUND, POINT_RAZORSCALE_FLIGHT_2, Random, RazorFlightPos2, REACT_PASSIVE, Unit::RemoveAura(), UnitAI::SelectTarget(), Creature::SetCombatMovement(), Unit::SetDisableGravity(), Creature::SetReactState(), SPELL_BERSERK, SPELL_DEVOURING_FLAME, SPELL_FIREBALL, SPELL_FIREBOLT, SPELL_FLAME_BREATH, SPELL_FUSE_ARMOR, SPELL_FUSED_ARMOR, SPELL_STUN_SELF, SPELL_WING_BUFFET, SummonMinions(), BossAI::summons, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ _defenderCnt

uint8 boss_razorscale::_defenderCnt {}
private
534{};

Referenced by Initialize(), and JustSummoned().

◆ _engineersAlive

uint8 boss_razorscale::_engineersAlive {}
private
533{};

Referenced by Initialize(), and SummonedCreatureDies().

◆ _flyCount

uint32 boss_razorscale::_flyCount {}
private
537{};

Referenced by GetData(), Initialize(), and MovementInform().

◆ _harpoonHits

uint8 boss_razorscale::_harpoonHits {}
private
536{};

Referenced by DoAction(), Initialize(), and SpellHit().

◆ _permaGround

bool boss_razorscale::_permaGround {}
private
538{};

Referenced by DamageTaken(), Initialize(), MovementInform(), and UpdateAI().

◆ _trapperCnt

uint8 boss_razorscale::_trapperCnt {}
private
535{};

Referenced by Initialize(), and JustSummoned().


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