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

Public Member Functions

 boss_ragnaros (Creature *creature)
 
void Reset () override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void DoAction (int32 action) override
 
void JustSummoned (Creature *summon) override
 
void SetGUID (ObjectGuid const &guid, int32 index) override
 
void SummonedCreatureDies (Creature *summon, Unit *) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *victim) override
 
void AttackStart (Unit *target) override
 
void EnterEvadeMode (EvadeReason why) override
 
bool CanAIAttack (Unit const *victim) const 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 (const Position *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 >
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
 
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
 
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 void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
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)
 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 Member Functions

void HandleEmerge ()
 
void ScheduleCombatEvents ()
 
bool IsVictimWithinMeleeRange () const
 

Private Attributes

EventMap extraEvents
 
bool _isIntroDone
 
bool _hasYelledMagmaBurst
 
bool _processingMagmaBurst
 
bool _hasSubmergedOnce
 
bool _isKnockbackEmoteAllowed
 
GuidSet _lavaBurstGUIDS
 

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_ragnaros()

boss_ragnaros::boss_ragnaros ( Creature creature)
inline
117 : BossAI(creature, DATA_RAGNAROS),
118 _isIntroDone(false),
121 _hasSubmergedOnce(false),
123 {
124 }
Definition ScriptedCreature.h:485
@ DATA_RAGNAROS
Definition molten_core.h:40
bool _isIntroDone
Definition boss_ragnaros.cpp:420
bool _hasYelledMagmaBurst
Definition boss_ragnaros.cpp:421
bool _isKnockbackEmoteAllowed
Definition boss_ragnaros.cpp:424
bool _hasSubmergedOnce
Definition boss_ragnaros.cpp:423
bool _processingMagmaBurst
Definition boss_ragnaros.cpp:422

Member Function Documentation

◆ AttackStart()

void boss_ragnaros::AttackStart ( Unit target)
inlineoverridevirtual

Reimplemented from UnitAI.

216 {
217 if (target && me->Attack(target, true))
218 DoStartNoMovement(target);
219 }
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:7272
void DoStartNoMovement(Unit *target)
Definition ScriptedCreature.cpp:258
Creature * me
Definition ScriptedCreature.h:281

References Unit::Attack(), ScriptedAI::DoStartNoMovement(), and ScriptedAI::me.

Referenced by HandleEmerge().

◆ CanAIAttack()

bool boss_ragnaros::CanAIAttack ( Unit const *  victim) const
inlineoverridevirtual

Reimplemented from UnitAI.

239 {
240 // Used for Magma Blast handling to force EnterEvadeMode if there are no melee targets
241 return me->IsWithinMeleeRange(victim);
242 }
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition Unit.cpp:782

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

◆ DamageTaken()

void boss_ragnaros::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.

152 {
153 if (events.IsInPhase(PHASE_SUBMERGED) && damage >= me->GetHealth())
154 {
155 damage = 0;
156 }
157 }
@ PHASE_SUBMERGED
Definition boss_ragnaros.cpp:110
events
Definition boss_sartura.cpp:43
uint32 GetHealth() const
Definition Unit.h:1108

References Unit::GetHealth(), ScriptedAI::me, and PHASE_SUBMERGED.

◆ DoAction()

void boss_ragnaros::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

160 {
161 if (action == ACTION_FINISH_RAGNAROS_INTRO)
162 {
165 }
166 }
@ PHASE_INTRO
Definition boss_ragnaros.cpp:108
@ EVENT_INTRO_SAY
Definition boss_ragnaros.cpp:90
void SetPhase(PhaseIndex phase)
Definition EventMap.cpp:28
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:48
@ ACTION_FINISH_RAGNAROS_INTRO
Definition molten_core.h:50
EventMap extraEvents
Definition boss_ragnaros.cpp:419

References ACTION_FINISH_RAGNAROS_INTRO, EVENT_INTRO_SAY, extraEvents, PHASE_INTRO, EventMap::ScheduleEvent(), and EventMap::SetPhase().

◆ EnterEvadeMode()

void boss_ragnaros::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

222 {
224 {
226 {
227 // Boss try to evade, but still got some targets on threat list - it means that none of these targets are in melee range - cast magma blast
230 }
231 }
232 else
233 {
235 }
236 }
@ PHASE_EMERGED
Definition boss_ragnaros.cpp:109
@ EVENT_MAGMA_BLAST
Definition boss_ragnaros.cpp:82
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:526
bool IsThreatListEmpty(bool includeOffline=false) const
Definition ThreatManager.cpp:267
ThreatManager & GetThreatMgr()
Definition Unit.h:951

References _processingMagmaBurst, BossAI::EnterEvadeMode(), EVENT_MAGMA_BLAST, Unit::GetThreatMgr(), ThreatManager::IsThreatListEmpty(), ScriptedAI::me, and PHASE_EMERGED.

◆ HandleEmerge()

void boss_ragnaros::HandleEmerge ( )
inlineprivate
429 {
430 if (events.IsInPhase(PHASE_EMERGED))
431 return;
432
433 events.SetPhase(PHASE_EMERGED);
437
442
444
445 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
446 AttackStart(target);
447 }
@ EMOTE_ONESHOT_EMERGE
Definition SharedDefines.h:2049
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
@ REACT_AGGRESSIVE
Definition Unit.h:568
@ UNIT_NPC_EMOTESTATE
Definition UpdateFields.h:140
@ SPELL_RAGNA_SUBMERGE_VISUAL
Definition boss_ragnaros.cpp:47
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
void CancelEventGroup(GroupIndex group)
Definition EventMap.cpp:177
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:111
Definition Unit.h:664
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5157
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:17323
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2172
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
void AttackStart(Unit *target) override
Definition boss_ragnaros.cpp:215
void ScheduleCombatEvents()
Definition boss_ragnaros.cpp:449

References AttackStart(), EventMap::CancelEventGroup(), EMOTE_ONESHOT_EMERGE, extraEvents, Unit::HandleEmoteCommand(), ScriptedAI::me, PHASE_EMERGED, PHASE_SUBMERGED, Random, REACT_AGGRESSIVE, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), ScheduleCombatEvents(), UnitAI::SelectTarget(), EventMap::SetPhase(), Creature::SetReactState(), Unit::SetUInt32Value(), SPELL_RAGNA_SUBMERGE_VISUAL, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, and UNIT_NPC_EMOTESTATE.

Referenced by SummonedCreatureDies(), and UpdateAI().

◆ IsVictimWithinMeleeRange()

bool boss_ragnaros::IsVictimWithinMeleeRange ( ) const
inlineprivate
460 {
461 return me->GetVictim() && me->IsWithinMeleeRange(me->GetVictim());
462 }
Unit * GetVictim() const
Definition Unit.h:903

References Unit::GetVictim(), Unit::IsWithinMeleeRange(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ JustDied()

void boss_ragnaros::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

203 {
204 _JustDied();
207 }
constexpr float DEATH_ORIENTATION
Definition boss_ragnaros.cpp:113
void _JustDied()
Definition ScriptedCreature.cpp:664
void Reset()
Definition EventMap.cpp:21
void SetFacingTo(float ori)
Definition Unit.cpp:16411

References BossAI::_JustDied(), DEATH_ORIENTATION, extraEvents, ScriptedAI::me, EventMap::Reset(), and Unit::SetFacingTo().

◆ JustEngagedWith()

void boss_ragnaros::JustEngagedWith ( Unit )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

196 {
198 events.SetPhase(PHASE_EMERGED);
200 }
void _JustEngagedWith()
Definition ScriptedCreature.cpp:677

References BossAI::_JustEngagedWith(), PHASE_EMERGED, and ScheduleCombatEvents().

◆ JustSummoned()

void boss_ragnaros::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

169 {
170 BossAI::JustSummoned(summon);
171 if (summon->GetEntry() == NPC_FLAME_OF_RAGNAROS)
172 summon->CastSpell((Unit*)nullptr, SPELL_INTENSE_HEAT, true, nullptr, nullptr, me->GetGUID());
173 else if (summon->GetEntry() == NPC_SON_OF_FLAME)
174 DoZoneInCombat(summon);
175 }
@ NPC_SON_OF_FLAME
Definition boss_ragnaros.cpp:99
@ NPC_FLAME_OF_RAGNAROS
Definition boss_ragnaros.cpp:100
@ SPELL_INTENSE_HEAT
Definition boss_ragnaros.cpp:52
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:725
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition CreatureAI.cpp:117
uint32 GetEntry() const
Definition Object.h:117
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
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:1350

References Unit::CastSpell(), CreatureAI::DoZoneInCombat(), Object::GetEntry(), Object::GetGUID(), BossAI::JustSummoned(), ScriptedAI::me, NPC_FLAME_OF_RAGNAROS, NPC_SON_OF_FLAME, and SPELL_INTENSE_HEAT.

◆ KilledUnit()

void boss_ragnaros::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

210 {
211 if (roll_chance_i(25) && victim->IsPlayer())
212 Talk(SAY_KILL);
213 }
bool roll_chance_i(int chance)
Definition Random.h:63
@ SAY_KILL
Definition boss_ragnaros.cpp:35
bool IsPlayer() const
Definition Object.h:201
Talk
Definition hyjal.cpp:82

References Object::IsPlayer(), roll_chance_i(), and SAY_KILL.

◆ Reset()

void boss_ragnaros::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

127 {
128 _Reset();
129
130 // Never reset intro events!
131 if (_isIntroDone && !(extraEvents.GetPhaseMask() & (1 << (PHASE_INTRO - 1))))
132 {
137 me->SetImmuneToAll(false);
140 }
141
142 _hasYelledMagmaBurst = false;
143 _processingMagmaBurst = false;
144 _hasSubmergedOnce = false;
148 _lavaBurstGUIDS.clear();
149 }
@ UNIT_STATE_ROOT
Definition UnitDefines.h:183
void _Reset()
Definition ScriptedCreature.cpp:644
PhaseMask GetPhaseMask() const
Definition EventMap.h:86
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:14268
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition Unit.h:924
GuidSet _lavaBurstGUIDS
Definition boss_ragnaros.cpp:426

References _hasSubmergedOnce, _hasYelledMagmaBurst, _isIntroDone, _isKnockbackEmoteAllowed, _lavaBurstGUIDS, _processingMagmaBurst, BossAI::_Reset(), EMOTE_ONESHOT_EMERGE, extraEvents, EventMap::GetPhaseMask(), Unit::HandleEmoteCommand(), ScriptedAI::me, PHASE_EMERGED, PHASE_INTRO, REACT_AGGRESSIVE, Unit::RemoveUnitFlag(), EventMap::Reset(), Unit::SetControlled(), Unit::SetImmuneToAll(), EventMap::SetPhase(), Creature::SetReactState(), Unit::SetUInt32Value(), UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_NPC_EMOTESTATE, and UNIT_STATE_ROOT.

◆ ScheduleCombatEvents()

void boss_ragnaros::ScheduleCombatEvents ( )
inlineprivate
450 {
451 events.RescheduleEvent(EVENT_ERUPTION, 15s, PHASE_EMERGED, PHASE_EMERGED);
454 events.RescheduleEvent(EVENT_LAVA_BURST, 10s, PHASE_EMERGED, PHASE_EMERGED);
455 events.RescheduleEvent(EVENT_SUBMERGE, 180s, PHASE_EMERGED, PHASE_EMERGED);
457 }
@ EVENT_WRATH_OF_RAGNAROS
Definition boss_ragnaros.cpp:78
@ EVENT_MIGHT_OF_RAGNAROS
Definition boss_ragnaros.cpp:80
@ EVENT_HAND_OF_RAGNAROS
Definition boss_ragnaros.cpp:79
@ EVENT_SUBMERGE
Definition boss_ragnaros.cpp:83
@ EVENT_LAVA_BURST
Definition boss_ragnaros.cpp:81
@ EVENT_ERUPTION
Definition boss_ragnaros.cpp:77

References EVENT_ERUPTION, EVENT_HAND_OF_RAGNAROS, EVENT_LAVA_BURST, EVENT_MIGHT_OF_RAGNAROS, EVENT_SUBMERGE, EVENT_WRATH_OF_RAGNAROS, and PHASE_EMERGED.

Referenced by HandleEmerge(), and JustEngagedWith().

◆ SetGUID()

void boss_ragnaros::SetGUID ( ObjectGuid const &  guid,
int32  index 
)
inlineoverridevirtual

Reimplemented from UnitAI.

178 {
179 if (index == GO_LAVA_BURST)
180 {
181 if (_lavaBurstGUIDS.empty())
183
184 _lavaBurstGUIDS.insert(guid);
185 }
186 }
@ EVENT_LAVA_BURST_TRIGGER
Definition boss_ragnaros.cpp:84
@ GO_LAVA_BURST
Definition molten_core.h:113

References _lavaBurstGUIDS, EVENT_LAVA_BURST_TRIGGER, extraEvents, GO_LAVA_BURST, and EventMap::ScheduleEvent().

◆ SummonedCreatureDies()

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

Reimplemented from CreatureAI.

189 {
190 summons.Despawn(summon);
192 HandleEmerge();
193 }
SummonList summons
Definition ScriptedCreature.h:539
bool HasEntry(uint32 entry) const
Definition ScriptedCreature.cpp:94
void Despawn(Creature const *summon)
Definition ScriptedCreature.h:89
void HandleEmerge()
Definition boss_ragnaros.cpp:428

References SummonList::Despawn(), HandleEmerge(), SummonList::HasEntry(), NPC_SON_OF_FLAME, PHASE_SUBMERGED, and BossAI::summons.

◆ UpdateAI()

void boss_ragnaros::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

245 {
246 if (!extraEvents.Empty())
247 {
248 extraEvents.Update(diff);
249
250 while (uint32 const eventId = extraEvents.ExecuteEvent())
251 {
252 switch (eventId)
253 {
254 // Intro events
255 case EVENT_INTRO_SAY:
256 {
259 break;
260 }
262 {
263 _isIntroDone = true;
267 me->SetImmuneToAll(false);
270 break;
271 }
272 // Submerge events
273 case EVENT_EMERGE:
274 {
275 HandleEmerge();
276 break;
277 }
279 {
281 break;
282 }
284 {
285 if (!_lavaBurstGUIDS.empty())
286 {
288
289 if (GameObject* go = ObjectAccessor::GetGameObject(*me, lavaBurstGUID))
290 {
291 go->CastSpell(nullptr, SPELL_LAVA_BURST_TRAP);
292 go->SendCustomAnim(0);
293 }
294
295 _lavaBurstGUIDS.erase(lavaBurstGUID);
297 }
298 else
299 {
300 events.RescheduleEvent(EVENT_LAVA_BURST, 10s, PHASE_EMERGED, PHASE_EMERGED);
301 }
302
303 break;
304 }
305 }
306 }
307 }
308
309 if (!UpdateVictim())
310 {
312 return;
313 }
314
315 events.Update(diff);
316
318 return;
319
320 // Base combat events - (mainly emerge phase)
321 while (uint32 const eventId = events.ExecuteEvent())
322 {
323 switch (eventId)
324 {
326 {
328
329 if (urand(0, 1))
331 events.Repeat(25s);
332 break;
333 }
335 {
338 {
342 }
343 events.Repeat(20s);
344 break;
345 }
346 case EVENT_LAVA_BURST:
347 {
349 break;
350 }
352 {
353 _processingMagmaBurst = false;
354
356 {
358
360 {
363 }
364 }
365
366 break;
367 }
369 {
370 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [](Unit const* target)
371 {
372 return target->IsPlayer() && target->getPowerType() == POWER_MANA;
373 }))
374 {
376 {
380 }
381 }
382 events.Repeat(11s, 30s);
383 break;
384 }
385 case EVENT_SUBMERGE:
386 {
387 events.CancelEventGroup(PHASE_EMERGED);
388 events.SetPhase(PHASE_SUBMERGED);
392 me->AttackStop();
397 //me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
398
400
402
404 _hasSubmergedOnce = true;
405
407 break;
408 }
409 }
410
412 return;
413 }
414
416 }
std::uint32_t uint32
Definition Define.h:107
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ EMOTE_STATE_SUBMERGED
Definition SharedDefines.h:1974
@ POWER_MANA
Definition SharedDefines.h:257
@ SPELL_CAST_OK
Definition SharedDefines.h:1126
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ REACT_PASSIVE
Definition Unit.h:566
@ SPELL_WRATH_OF_RAGNAROS
Definition boss_ragnaros.cpp:42
@ SPELL_RAGNAROS_SUBMERGE_EFFECT
Definition boss_ragnaros.cpp:49
@ SPELL_MAGMA_BLAST
Definition boss_ragnaros.cpp:44
@ SPELL_HAND_OF_RAGNAROS
Definition boss_ragnaros.cpp:41
@ SPELL_SUMMON_SONS_FLAME
Definition boss_ragnaros.cpp:53
@ SPELL_LAVA_BURST
Definition boss_ragnaros.cpp:43
@ SPELL_LAVA_BURST_TRAP
Definition boss_ragnaros.cpp:63
@ SPELL_MIGHT_OF_RAGNAROS
Definition boss_ragnaros.cpp:51
@ SAY_ARRIVAL5_RAG
Definition boss_ragnaros.cpp:30
@ SAY_MAGMABURST
Definition boss_ragnaros.cpp:36
@ SAY_REINFORCEMENTS1
Definition boss_ragnaros.cpp:31
@ SAY_KNOCKBACK
Definition boss_ragnaros.cpp:33
@ SAY_REINFORCEMENTS2
Definition boss_ragnaros.cpp:32
@ SAY_WRATH
Definition boss_ragnaros.cpp:34
@ EVENT_EMERGE
Definition boss_ragnaros.cpp:87
@ EVENT_INTRO_MAKE_ATTACKABLE
Definition boss_ragnaros.cpp:91
@ EVENT_RESET_KNOCKBACK_EMOTE
Definition boss_ragnaros.cpp:94
bool UpdateVictim()
Definition CreatureAI.cpp:353
void Update(uint32 time)
Definition EventMap.h:67
bool Empty() const
Definition EventMap.h:95
void Repeat(Milliseconds time)
Definition EventMap.cpp:76
EventId ExecuteEvent()
Definition EventMap.cpp:86
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:70
Definition GameObject.h:120
Definition ObjectGuid.h:118
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.
Definition UnitAI.cpp:296
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:285
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:277
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4302
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
Powers getPowerType() const
Definition Unit.h:1131
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7436
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:133
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:184
void DoResetThreatList()
Definition ScriptedCreature.cpp:473
bool IsVictimWithinMeleeRange() const
Definition boss_ragnaros.cpp:459

References _hasSubmergedOnce, _hasYelledMagmaBurst, _isIntroDone, _isKnockbackEmoteAllowed, _lavaBurstGUIDS, _processingMagmaBurst, Unit::AttackStop(), Unit::CastSpell(), UnitAI::DoCastAOE(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoResetThreatList(), CreatureAI::DoZoneInCombat(), EMOTE_STATE_SUBMERGED, EventMap::Empty(), EVENT_EMERGE, EVENT_HAND_OF_RAGNAROS, EVENT_INTRO_MAKE_ATTACKABLE, EVENT_INTRO_SAY, EVENT_LAVA_BURST, EVENT_LAVA_BURST_TRIGGER, EVENT_MAGMA_BLAST, EVENT_MIGHT_OF_RAGNAROS, EVENT_RESET_KNOCKBACK_EMOTE, EVENT_SUBMERGE, EVENT_WRATH_OF_RAGNAROS, EventMap::ExecuteEvent(), extraEvents, ObjectAccessor::GetGameObject(), Unit::getPowerType(), HandleEmerge(), Unit::HasUnitState(), Unit::InterruptNonMeleeSpells(), Object::IsPlayer(), IsVictimWithinMeleeRange(), ScriptedAI::me, PHASE_EMERGED, PHASE_INTRO, PHASE_SUBMERGED, POWER_MANA, Random, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), EventMap::Repeat(), EventMap::RescheduleEvent(), SAY_ARRIVAL5_RAG, SAY_KNOCKBACK, SAY_MAGMABURST, SAY_REINFORCEMENTS1, SAY_REINFORCEMENTS2, SAY_WRATH, EventMap::ScheduleEvent(), Acore::Containers::SelectRandomContainerElement(), UnitAI::SelectTarget(), Unit::SetImmuneToAll(), EventMap::SetPhase(), Creature::SetReactState(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), SPELL_CAST_OK, SPELL_HAND_OF_RAGNAROS, SPELL_LAVA_BURST, SPELL_LAVA_BURST_TRAP, SPELL_MAGMA_BLAST, SPELL_MIGHT_OF_RAGNAROS, SPELL_RAGNA_SUBMERGE_VISUAL, SPELL_RAGNAROS_SUBMERGE_EFFECT, SPELL_SUMMON_SONS_FLAME, SPELL_WRATH_OF_RAGNAROS, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_NPC_EMOTESTATE, UNIT_STATE_CASTING, EventMap::Update(), CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ _hasSubmergedOnce

bool boss_ragnaros::_hasSubmergedOnce
private

Referenced by Reset(), and UpdateAI().

◆ _hasYelledMagmaBurst

bool boss_ragnaros::_hasYelledMagmaBurst
private

Referenced by Reset(), and UpdateAI().

◆ _isIntroDone

bool boss_ragnaros::_isIntroDone
private

Referenced by Reset(), and UpdateAI().

◆ _isKnockbackEmoteAllowed

bool boss_ragnaros::_isKnockbackEmoteAllowed
private

Referenced by Reset(), and UpdateAI().

◆ _lavaBurstGUIDS

GuidSet boss_ragnaros::_lavaBurstGUIDS
private

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

◆ _processingMagmaBurst

bool boss_ragnaros::_processingMagmaBurst
private

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

◆ extraEvents

EventMap boss_ragnaros::extraEvents
private

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