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

Public Member Functions

 boss_ragnarosAI (Creature *creature)
 
void Reset () override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void DoAction (int32 action) override
 
void JustSummoned (Creature *summon) override
 
void SetGUID (ObjectGuid guid, int32 index) override
 
void SummonedCreatureDies (Creature *summon, Unit *) override
 
void EnterCombat (Unit *) override
 
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
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 
virtual void ExecuteEvent (uint32)
 
void Reset () override
 
void EnterCombat (Unit *) 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
 
void UpdateAI (uint32 diff) override
 
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 EnterCombat (Unit *) override
 
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 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 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void EnterCombat (Unit *)
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
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)
 
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)
 
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)
 
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
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _EnterCombat ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
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
EventMap events
 
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_ragnarosAI()

boss_ragnaros::boss_ragnarosAI::boss_ragnarosAI ( Creature creature)
inline
121 : BossAI(creature, DATA_RAGNAROS),
122 _isIntroDone(false),
125 _hasSubmergedOnce(false),
127 {
128 }
@ DATA_RAGNAROS
Definition: molten_core.h:39
Definition: ScriptedCreature.h:433
bool _hasSubmergedOnce
Definition: boss_ragnaros.cpp:448
bool _hasYelledMagmaBurst
Definition: boss_ragnaros.cpp:446
bool _isKnockbackEmoteAllowed
Definition: boss_ragnaros.cpp:449
bool _isIntroDone
Definition: boss_ragnaros.cpp:445
bool _processingMagmaBurst
Definition: boss_ragnaros.cpp:447

Member Function Documentation

◆ AttackStart()

void boss_ragnaros::boss_ragnarosAI::AttackStart ( Unit target)
inlineoverridevirtual

Reimplemented from ScriptedAI.

230 {
231 if (target && me->Attack(target, true))
232 {
233 DoStartNoMovement(target);
234 }
235 }
void DoStartNoMovement(Unit *target)
Definition: ScriptedCreature.cpp:229
Creature * me
Definition: ScriptedCreature.h:267
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10233

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

Referenced by HandleEmerge().

◆ CanAIAttack()

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

Reimplemented from UnitAI.

255 {
256 return me->IsWithinMeleeRange(victim);
257 }
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:682

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

◆ DamageTaken()

void boss_ragnaros::boss_ragnarosAI::DamageTaken ( Unit ,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

156 {
157 if (events.IsInPhase(PHASE_SUBMERGED) && damage >= me->GetHealth())
158 {
159 damage = 0;
160 }
161 }
@ PHASE_SUBMERGED
Definition: boss_ragnaros.cpp:109
events
Definition: boss_sartura.cpp:43
uint32 GetHealth() const
Definition: Unit.h:1439

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

◆ DoAction()

void boss_ragnaros::boss_ragnarosAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

164 {
165 if (action == ACTION_FINISH_RAGNAROS_INTRO)
166 {
169 }
170 }
@ PHASE_INTRO
Definition: boss_ragnaros.cpp:107
@ EVENT_INTRO_SAY
Definition: boss_ragnaros.cpp:89
@ ACTION_FINISH_RAGNAROS_INTRO
Definition: molten_core.h:49
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
void SetPhase(uint8 phase)
Definition: EventMap.cpp:28
EventMap extraEvents
Definition: boss_ragnaros.cpp:444

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

◆ EnterCombat()

void boss_ragnaros::boss_ragnarosAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

208 {
209 _EnterCombat();
210 events.SetPhase(PHASE_EMERGED);
212 }
@ PHASE_EMERGED
Definition: boss_ragnaros.cpp:108
void _EnterCombat()
Definition: ScriptedCreature.cpp:580
void ScheduleCombatEvents()
Definition: boss_ragnaros.cpp:478

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

◆ EnterEvadeMode()

void boss_ragnaros::boss_ragnarosAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

238 {
239 if (!me->GetThreatMgr().GetThreatList().empty())
240 {
242 {
243 // 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
246 }
247 }
248 else
249 {
251 }
252 }
@ EVENT_MAGMA_BLAST
Definition: boss_ragnaros.cpp:81
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:195
ThreatContainer::StorageType const & GetThreatList() const
Definition: ThreatMgr.h:274
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2143

References _processingMagmaBurst, CreatureAI::EnterEvadeMode(), EVENT_MAGMA_BLAST, ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), ScriptedAI::me, and PHASE_EMERGED.

◆ HandleEmerge()

void boss_ragnaros::boss_ragnarosAI::HandleEmerge ( )
inlineprivate
454 {
455 if (events.IsInPhase(PHASE_EMERGED))
456 {
457 return;
458 }
459
460 events.SetPhase(PHASE_EMERGED);
464
469
471
472 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
473 {
474 AttackStart(target);
475 }
476 }
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ REACT_AGGRESSIVE
Definition: Unit.h:1025
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
@ SPELL_RAGNA_SUBMERGE_VISUAL
Definition: boss_ragnaros.cpp:46
@ EMOTE_ONESHOT_EMERGE
Definition: SharedDefines.h:2015
void CancelEventGroup(uint32 group)
Definition: EventMap.cpp:209
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
void SetReactState(ReactStates st)
Definition: Creature.h:88
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
Definition: Unit.h:1290
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4823
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1958
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1481
void AttackStart(Unit *target) override
Definition: boss_ragnaros.cpp:229

References AttackStart(), EventMap::CancelEventGroup(), EMOTE_ONESHOT_EMERGE, extraEvents, Unit::HandleEmoteCommand(), ScriptedAI::me, PHASE_EMERGED, PHASE_SUBMERGED, REACT_AGGRESSIVE, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), ScheduleCombatEvents(), UnitAI::SelectTarget(), EventMap::SetPhase(), Creature::SetReactState(), Object::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::boss_ragnarosAI::IsVictimWithinMeleeRange ( ) const
inlineprivate
489 {
490 return me->GetVictim() && me->IsWithinMeleeRange(me->GetVictim());
491 }
Unit * GetVictim() const
Definition: Unit.h:1386

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

Referenced by UpdateAI().

◆ JustDied()

void boss_ragnaros::boss_ragnarosAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

215 {
216 _JustDied();
219 }
constexpr float DEATH_ORIENTATION
Definition: boss_ragnaros.cpp:112
void Reset()
Definition: EventMap.cpp:21
void _JustDied()
Definition: ScriptedCreature.cpp:569
void SetFacingTo(float ori)
Definition: Unit.cpp:20643

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

◆ JustSummoned()

void boss_ragnaros::boss_ragnarosAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

173 {
174 BossAI::JustSummoned(summon);
175 if (summon->GetEntry() == NPC_FLAME_OF_RAGNAROS)
176 {
177 summon->CastSpell((Unit*)nullptr, SPELL_INTENSE_HEAT, true, nullptr, nullptr, me->GetGUID());
178 }
179 else if (summon->GetEntry() == NPC_SON_OF_FLAME)
180 {
181 DoZoneInCombat(summon);
182 }
183 }
@ NPC_SON_OF_FLAME
Definition: boss_ragnaros.cpp:98
@ NPC_FLAME_OF_RAGNAROS
Definition: boss_ragnaros.cpp:99
@ SPELL_INTENSE_HEAT
Definition: boss_ragnaros.cpp:51
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:93
void JustSummoned(Creature *summon) override
Definition: ScriptedCreature.cpp:608
uint32 GetEntry() const
Definition: Object.h:109
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
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:1168

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::boss_ragnarosAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

222 {
223 if (roll_chance_i(25) && victim->IsPlayer())
224 {
225 Talk(SAY_KILL);
226 }
227 }
bool roll_chance_i(int chance)
Definition: Random.h:59
@ SAY_KILL
Definition: boss_ragnaros.cpp:34
Talk
Definition: boss_fathomlord_karathress.cpp:23
bool IsPlayer() const
Definition: Object.h:194

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

◆ Reset()

void boss_ragnaros::boss_ragnarosAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

131 {
132 _Reset();
133
134 // Never reset intro events!
135 if (_isIntroDone && !(extraEvents.GetPhaseMask() & (1 << (PHASE_INTRO - 1))))
136 {
141 me->SetImmuneToAll(false);
144 }
145
146 _hasYelledMagmaBurst = false;
147 _processingMagmaBurst = false;
148 _hasSubmergedOnce = false;
152 _lavaBurstGUIDS.clear();
153 }
@ UNIT_STATE_ROOT
Definition: Unit.h:335
uint8 GetPhaseMask() const
Definition: EventMap.h:87
void _Reset()
Definition: ScriptedCreature.cpp:557
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:18089
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:1676
GuidSet _lavaBurstGUIDS
Definition: boss_ragnaros.cpp:451

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(), Object::SetUInt32Value(), UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_NPC_EMOTESTATE, and UNIT_STATE_ROOT.

◆ ScheduleCombatEvents()

void boss_ragnaros::boss_ragnarosAI::ScheduleCombatEvents ( )
inlineprivate
479 {
480 events.RescheduleEvent(EVENT_ERUPTION, 15000, PHASE_EMERGED, PHASE_EMERGED);
483 events.RescheduleEvent(EVENT_LAVA_BURST, 10000, PHASE_EMERGED, PHASE_EMERGED);
484 events.RescheduleEvent(EVENT_SUBMERGE, 180000, PHASE_EMERGED, PHASE_EMERGED);
486 }
@ EVENT_WRATH_OF_RAGNAROS
Definition: boss_ragnaros.cpp:77
@ EVENT_MIGHT_OF_RAGNAROS
Definition: boss_ragnaros.cpp:79
@ EVENT_HAND_OF_RAGNAROS
Definition: boss_ragnaros.cpp:78
@ EVENT_SUBMERGE
Definition: boss_ragnaros.cpp:82
@ EVENT_LAVA_BURST
Definition: boss_ragnaros.cpp:80
@ EVENT_ERUPTION
Definition: boss_ragnaros.cpp:76

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 EnterCombat(), and HandleEmerge().

◆ SetGUID()

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

Reimplemented from UnitAI.

186 {
187 if (index == GO_LAVA_BURST)
188 {
189 if (_lavaBurstGUIDS.empty())
190 {
192 }
193
194 _lavaBurstGUIDS.insert(guid);
195 }
196 }
@ EVENT_LAVA_BURST_TRIGGER
Definition: boss_ragnaros.cpp:83
@ GO_LAVA_BURST
Definition: molten_core.h:112

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

◆ SummonedCreatureDies()

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

Reimplemented from CreatureAI.

199 {
200 summons.Despawn(summon);
202 {
203 HandleEmerge();
204 }
205 }
bool HasEntry(uint32 entry) const
Definition: ScriptedCreature.cpp:89
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:90
SummonList summons
Definition: ScriptedCreature.h:466
void HandleEmerge()
Definition: boss_ragnaros.cpp:453

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

◆ UpdateAI()

void boss_ragnaros::boss_ragnarosAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

260 {
261 if (!extraEvents.Empty())
262 {
263 extraEvents.Update(diff);
264
265 while (uint32 const eventId = extraEvents.ExecuteEvent())
266 {
267 switch (eventId)
268 {
269 // Intro events
270 case EVENT_INTRO_SAY:
271 {
274 break;
275 }
277 {
278 _isIntroDone = true;
282 me->SetImmuneToAll(false);
285 break;
286 }
287 // Submerge events
288 case EVENT_EMERGE:
289 {
290 HandleEmerge();
291 break;
292 }
294 {
296 break;
297 }
299 {
300 if (!_lavaBurstGUIDS.empty())
301 {
303
304 if (GameObject* go = ObjectAccessor::GetGameObject(*me, lavaBurstGUID))
305 {
306 go->CastSpell(nullptr, SPELL_LAVA_BURST_TRAP);
307 go->SendCustomAnim(0);
308 }
309
310 _lavaBurstGUIDS.erase(lavaBurstGUID);
312 }
313 else
314 {
315 events.RescheduleEvent(EVENT_LAVA_BURST, 10000, PHASE_EMERGED, PHASE_EMERGED);
316 }
317
318 break;
319 }
320 }
321 }
322 }
323
324 if (!UpdateVictim())
325 {
327 {
328 return;
329 }
330 }
331
332 events.Update(diff);
333
335 {
336 return;
337 }
338
339 // Base combat events - (mainly emerge phase)
340 while (uint32 const eventId = events.ExecuteEvent())
341 {
342 switch (eventId)
343 {
345 {
347
348 if (urand(0, 1))
349 {
351 }
352 events.RepeatEvent(25000);
353 break;
354 }
356 {
359 {
363 }
364 events.RepeatEvent(20000);
365 break;
366 }
367 case EVENT_LAVA_BURST:
368 {
370 break;
371 }
373 {
374 _processingMagmaBurst = false;
375
377 {
379
381 {
384 }
385 }
386
387 break;
388 }
390 {
391 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [](Unit const* target)
392 {
393 return target->IsPlayer() && target->getPowerType() == POWER_MANA;
394 }))
395 {
397 {
401 }
402 }
403 events.RepeatEvent(urand(11000, 30000));
404 break;
405 }
406 case EVENT_SUBMERGE:
407 {
408 events.CancelEventGroup(PHASE_EMERGED);
409 events.SetPhase(PHASE_SUBMERGED);
413 me->AttackStop();
418 //me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
419
421
423
425 {
426 _hasSubmergedOnce = true;
427 }
428
430 break;
431 }
432 }
433
435 {
436 return;
437 }
438 }
439
441 }
std::uint32_t uint32
Definition: Define.h:108
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ REACT_PASSIVE
Definition: Unit.h:1023
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ SPELL_WRATH_OF_RAGNAROS
Definition: boss_ragnaros.cpp:41
@ SPELL_RAGNAROS_SUBMERGE_EFFECT
Definition: boss_ragnaros.cpp:48
@ SPELL_MAGMA_BLAST
Definition: boss_ragnaros.cpp:43
@ SPELL_HAND_OF_RAGNAROS
Definition: boss_ragnaros.cpp:40
@ SPELL_SUMMON_SONS_FLAME
Definition: boss_ragnaros.cpp:52
@ SPELL_LAVA_BURST
Definition: boss_ragnaros.cpp:42
@ SPELL_LAVA_BURST_TRAP
Definition: boss_ragnaros.cpp:62
@ SPELL_MIGHT_OF_RAGNAROS
Definition: boss_ragnaros.cpp:50
@ SAY_ARRIVAL5_RAG
Definition: boss_ragnaros.cpp:29
@ SAY_MAGMABURST
Definition: boss_ragnaros.cpp:35
@ SAY_REINFORCEMENTS1
Definition: boss_ragnaros.cpp:30
@ SAY_KNOCKBACK
Definition: boss_ragnaros.cpp:32
@ SAY_REINFORCEMENTS2
Definition: boss_ragnaros.cpp:31
@ SAY_WRATH
Definition: boss_ragnaros.cpp:33
@ EVENT_EMERGE
Definition: boss_ragnaros.cpp:86
@ EVENT_INTRO_MAKE_ATTACKABLE
Definition: boss_ragnaros.cpp:90
@ EVENT_RESET_KNOCKBACK_EMOTE
Definition: boss_ragnaros.cpp:93
@ EMOTE_STATE_SUBMERGED
Definition: SharedDefines.h:1940
@ POWER_MANA
Definition: SharedDefines.h:241
@ SPELL_CAST_OK
Definition: SharedDefines.h:1110
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:135
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:189
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
bool Empty() const
Definition: EventMap.h:96
void RepeatEvent(uint32 time)
Definition: EventMap.cpp:99
void RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId=0, uint32 phase=0)
Definition: EventMap.cpp:81
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:249
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:241
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:354
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
Definition: UnitAI.cpp:257
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void DoResetThreatList()
Definition: ScriptedCreature.cpp:411
Definition: GameObject.h:813
Definition: ObjectGuid.h:120
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4057
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
Powers getPowerType() const
Definition: Unit.h:1458
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1480
bool AttackStop()
Definition: Unit.cpp:10356
bool IsVictimWithinMeleeRange() const
Definition: boss_ragnaros.cpp:488

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, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), EventMap::RepeatEvent(), 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(), Object::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::boss_ragnarosAI::_hasSubmergedOnce
private

Referenced by Reset(), and UpdateAI().

◆ _hasYelledMagmaBurst

bool boss_ragnaros::boss_ragnarosAI::_hasYelledMagmaBurst
private

Referenced by Reset(), and UpdateAI().

◆ _isIntroDone

bool boss_ragnaros::boss_ragnarosAI::_isIntroDone
private

Referenced by Reset(), and UpdateAI().

◆ _isKnockbackEmoteAllowed

bool boss_ragnaros::boss_ragnarosAI::_isKnockbackEmoteAllowed
private

Referenced by Reset(), and UpdateAI().

◆ _lavaBurstGUIDS

GuidSet boss_ragnaros::boss_ragnarosAI::_lavaBurstGUIDS
private

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

◆ _processingMagmaBurst

bool boss_ragnaros::boss_ragnarosAI::_processingMagmaBurst
private

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

◆ extraEvents

EventMap boss_ragnaros::boss_ragnarosAI::extraEvents
private