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

Public Member Functions

 boss_majordomoAI (Creature *creature)
 
void JustDied (Unit *) override
 
void JustSummoned (Creature *summon) override
 
void InitializeAI () override
 
void Reset () override
 
bool CanAIAttack (Unit const *) const override
 
void KilledUnit (Unit *victim) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void SummonedCreatureDies (Creature *summon, Unit *) override
 
void JustReachedHome () override
 
void DamageTaken (Unit *, uint32 &damage, 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 MovementInform (uint32 type, uint32 pointId) override
 
void SpellHit (Unit *, SpellInfo const *spellInfo) override
 
void DoAction (int32 action) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () 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)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
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.
 
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.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Attributes

GuidSet static_minionsGUIDS
 
GuidSet aliveMinionsGUIDS
 
std::unordered_map< uint32, MajordomoAddDatamajordomoSummonsData
 

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
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_majordomoAI()

boss_majordomo::boss_majordomoAI::boss_majordomoAI ( Creature creature)
inline
141: BossAI(creature, DATA_MAJORDOMO_EXECUTUS) {}
Definition ScriptedCreature.h:467
@ DATA_MAJORDOMO_EXECUTUS
Definition molten_core.h:39

Member Function Documentation

◆ CanAIAttack()

bool boss_majordomo::boss_majordomoAI::CanAIAttack ( Unit const *  ) const
inlineoverridevirtual

Reimplemented from UnitAI.

229 {
231 }
@ DONE
Definition InstanceScript.h:61
InstanceScript *const instance
Definition ScriptedCreature.h:474
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:242

References DATA_MAJORDOMO_EXECUTUS, DONE, InstanceScript::GetBossState(), and BossAI::instance.

◆ DamageTaken()

void boss_majordomo::boss_majordomoAI::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.

311 {
312 if (events.IsInPhase(PHASE_COMBAT) && me->GetHealth() <= damage)
313 {
314 damage = 0;
315 }
316 }
@ PHASE_COMBAT
Definition boss_majordomo_executus.cpp:114
events
Definition boss_sartura.cpp:43
uint32 GetHealth() const
Definition Unit.h:1038
Creature * me
Definition ScriptedCreature.h:280

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

◆ DoAction()

void boss_majordomo::boss_majordomoAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

519 {
521 {
524 }
525 }
@ PHASE_RAGNAROS_SUMMONING
Definition boss_majordomo_executus.cpp:116
@ EVENT_RAGNAROS_SUMMON_1
Definition boss_majordomo_executus.cpp:86
@ ACTION_START_RAGNAROS_INTRO
Definition molten_core.h:49

References ACTION_START_RAGNAROS_INTRO, EVENT_RAGNAROS_SUMMON_1, and PHASE_RAGNAROS_SUMMONING.

◆ InitializeAI()

void boss_majordomo::boss_majordomoAI::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

162 {
165 {
166 events.SetPhase(PHASE_COMBAT);
167
168 std::list<TempSummon*> p_summons;
170 if (!p_summons.empty())
171 {
172 for (TempSummon const* summon : p_summons)
173 {
174 if (summon)
175 {
176 static_minionsGUIDS.insert(summon->GetGUID());
177 majordomoSummonsData[summon->GetGUID().GetCounter()] = MajordomoAddData(summon->GetGUID(), summon->GetEntry(), summon->GetPosition());
178 }
179 }
180 }
181 }
182 else
183 {
184 events.SetPhase(PHASE_NONE);
185 me->SetImmuneToAll(true);
188 }
189 }
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:315
@ SUMMON_GROUP_ADDS
Definition boss_majordomo_executus.cpp:107
@ PHASE_NONE
Definition boss_majordomo_executus.cpp:113
@ FACTION_MAJORDOMO_FRIENDLY
Definition boss_majordomo_executus.cpp:106
Definition TemporarySummon.h:40
virtual void InitializeAI()
Definition UnitAI.h:204
void SetFaction(uint32 faction)
Definition Unit.cpp:10097
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:735
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition Unit.h:883
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2445
Definition boss_majordomo_executus.cpp:125
std::unordered_map< uint32, MajordomoAddData > majordomoSummonsData
Definition boss_majordomo_executus.cpp:529
GuidSet static_minionsGUIDS
Definition boss_majordomo_executus.cpp:527

References DATA_MAJORDOMO_EXECUTUS, DONE, FACTION_MAJORDOMO_FRIENDLY, InstanceScript::GetBossState(), UnitAI::InitializeAI(), BossAI::instance, majordomoSummonsData, ScriptedAI::me, PHASE_COMBAT, PHASE_NONE, Unit::SetFaction(), Unit::SetImmuneToAll(), Unit::SetNpcFlag(), static_minionsGUIDS, SUMMON_GROUP_ADDS, WorldObject::SummonCreatureGroup(), and UNIT_NPC_FLAG_GOSSIP.

◆ JustDied()

void boss_majordomo::boss_majordomoAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

144 {
146 me->DespawnOrUnsummon(10s, 0s);
147 }
@ SAY_DEATH
Definition boss_majordomo_executus.cpp:44
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2183
Talk
Definition hyjal.cpp:82

References Creature::DespawnOrUnsummon(), ScriptedAI::me, and SAY_DEATH.

◆ JustEngagedWith()

void boss_majordomo::boss_majordomoAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

242 {
243 if (!events.IsInPhase(PHASE_COMBAT))
244 {
245 return;
246 }
247
252
256
257 aliveMinionsGUIDS.clear();
259 }
@ SPELL_SEPARATION_ANXIETY
Definition boss_majordomo_executus.cpp:63
@ SPELL_AEGIS_OF_RAGNAROS
Definition boss_majordomo_executus.cpp:56
@ SAY_AGGRO
Definition boss_majordomo_executus.cpp:29
@ EVENT_TELEPORT_TARGET
Definition boss_majordomo_executus.cpp:79
@ EVENT_TELEPORT_RANDOM
Definition boss_majordomo_executus.cpp:78
@ EVENT_SHIELD_REFLECTION
Definition boss_majordomo_executus.cpp:77
void _JustEngagedWith()
Definition ScriptedCreature.cpp:657
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:248
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:392
GuidSet aliveMinionsGUIDS
Definition boss_majordomo_executus.cpp:528

References BossAI::_JustEngagedWith(), aliveMinionsGUIDS, UnitAI::DoCastAOE(), UnitAI::DoCastSelf(), EVENT_SHIELD_REFLECTION, EVENT_TELEPORT_RANDOM, EVENT_TELEPORT_TARGET, PHASE_COMBAT, SAY_AGGRO, SPELL_AEGIS_OF_RAGNAROS, SPELL_SEPARATION_ANXIETY, and static_minionsGUIDS.

◆ JustReachedHome()

void boss_majordomo::boss_majordomoAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

300 {
303 {
304 events.Reset();
305 events.SetPhase(PHASE_DEFEAT_OUTRO);
307 }
308 }
@ PHASE_DEFEAT_OUTRO
Definition boss_majordomo_executus.cpp:115
@ EVENT_DEFEAT_OUTRO_1
Definition boss_majordomo_executus.cpp:82
void _JustReachedHome()
Definition ScriptedCreature.h:512

References BossAI::_JustReachedHome(), DATA_MAJORDOMO_EXECUTUS, DONE, EVENT_DEFEAT_OUTRO_1, InstanceScript::GetBossState(), BossAI::instance, and PHASE_DEFEAT_OUTRO.

◆ JustSummoned()

void boss_majordomo::boss_majordomoAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

150 {
151 if (summon->GetEntry() == NPC_RAGNAROS)
152 {
153 summon->CastSpell(summon, SPELL_RAGNAROS_FADE);
154 summon->CastSpell(summon, SPELL_RAGNAROS_SUBMERGE_EFFECT, true);
156 summon->SetImmuneToAll(true);
158 }
159 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:251
@ REACT_PASSIVE
Definition Unit.h:548
@ SPELL_RAGNAROS_SUBMERGE_EFFECT
Definition boss_majordomo_executus.cpp:72
@ SPELL_RAGNAROS_FADE
Definition boss_majordomo_executus.cpp:71
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:95
uint32 GetEntry() const
Definition Object.h:115
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1178
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:719
@ NPC_RAGNAROS
Definition molten_core.h:60

References Unit::CastSpell(), Object::GetEntry(), NPC_RAGNAROS, REACT_PASSIVE, Unit::SetImmuneToAll(), Creature::SetReactState(), Unit::SetUnitFlag(), SPELL_RAGNAROS_FADE, SPELL_RAGNAROS_SUBMERGE_EFFECT, and UNIT_FLAG_NON_ATTACKABLE.

◆ KilledUnit()

void boss_majordomo::boss_majordomoAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

234 {
235 if (roll_chance_i(25) && victim->IsPlayer())
236 {
237 Talk(SAY_SLAY);
238 }
239 }
bool roll_chance_i(int chance)
Definition Random.h:60
@ SAY_SLAY
Definition boss_majordomo_executus.cpp:31
bool IsPlayer() const
Definition Object.h:200

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

◆ MovementInform()

void boss_majordomo::boss_majordomoAI::MovementInform ( uint32  type,
uint32  pointId 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

499 {
500 if (type == POINT_MOTION_TYPE && pointId == POINT_RAGNAROS_SUMMON)
501 {
504 }
505 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ POINT_RAGNAROS_SUMMON
Definition boss_majordomo_executus.cpp:110
@ SPELL_SUMMON_RAGNAROS
Definition boss_majordomo_executus.cpp:68
@ EVENT_RAGNAROS_SUMMON_2
Definition boss_majordomo_executus.cpp:87

References UnitAI::DoCastAOE(), EVENT_RAGNAROS_SUMMON_2, PHASE_RAGNAROS_SUMMONING, POINT_MOTION_TYPE, POINT_RAGNAROS_SUMMON, and SPELL_SUMMON_RAGNAROS.

◆ Reset()

void boss_majordomo::boss_majordomoAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

192 {
193 me->ResetLootMode();
194 events.Reset();
195 aliveMinionsGUIDS.clear();
196
198 {
199 events.SetPhase(PHASE_COMBAT);
201
202 for (auto const& summon : majordomoSummonsData)
203 {
204 if (ObjectAccessor::GetCreature(*me, summon.second.guid))
205 {
206 continue;
207 }
208
209 if (Creature* spawn = me->SummonCreature(summon.second.creatureEntry, summon.second.spawnPos))
210 {
211 static_minionsGUIDS.erase(summon.second.guid); // Erase the guid from the previous, no longer existing, spawn.
212 static_minionsGUIDS.insert(spawn->GetGUID());
213 majordomoSummonsData.erase(summon.second.guid.GetCounter());
214 majordomoSummonsData[spawn->GetGUID().GetCounter()] = MajordomoAddData(spawn->GetGUID(), spawn->GetEntry(), spawn->GetPosition());
215 }
216 }
217
219 }
220 else
221 {
222 static_minionsGUIDS.clear();
223 majordomoSummonsData.clear();
225 }
226 }
@ NOT_STARTED
Definition InstanceScript.h:58
SummonList summons
Definition ScriptedCreature.h:517
Definition Creature.h:43
void ResetLootMode()
Definition Creature.h:249
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:385
void DespawnAll(uint32 delay=0)
Definition ScriptedCreature.cpp:71
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:736
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2368
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:210

References aliveMinionsGUIDS, DATA_MAJORDOMO_EXECUTUS, SummonList::DespawnAll(), DONE, InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), BossAI::instance, majordomoSummonsData, ScriptedAI::me, NOT_STARTED, PHASE_COMBAT, Unit::RemoveNpcFlag(), Creature::ResetLootMode(), InstanceScript::SetBossState(), static_minionsGUIDS, WorldObject::SummonCreature(), BossAI::summons, and UNIT_NPC_FLAG_GOSSIP.

◆ SpellHit()

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

Reimplemented from CreatureAI.

508 {
509 if (events.IsInPhase(PHASE_DEFEAT_OUTRO) && spellInfo->Id == SPELL_TELEPORT_SELF)
510 {
514 events.SetPhase(PHASE_NONE);
515 }
516 }
@ SPELL_TELEPORT_SELF
Definition boss_majordomo_executus.cpp:67
Position const MajordomoRagnaros
Definition boss_majordomo_executus.cpp:119
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:340
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:20031
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), SpellInfo::Id, MajordomoRagnaros, ScriptedAI::me, Unit::NearTeleportTo(), PHASE_DEFEAT_OUTRO, PHASE_NONE, Creature::SetHomePosition(), Unit::SetNpcFlag(), SPELL_TELEPORT_SELF, and UNIT_NPC_FLAG_GOSSIP.

◆ SummonedCreatureDies()

void boss_majordomo::boss_majordomoAI::SummonedCreatureDies ( Creature summon,
Unit  
)
inlineoverridevirtual

Reimplemented from CreatureAI.

262 {
263 aliveMinionsGUIDS.erase(summon->GetGUID());
264 if (summon->GetEntry() == NPC_FLAMEWAKER_HEALER || summon->GetEntry() == NPC_FLAMEWAKER_ELITE)
265 {
266 uint32 const remainingAdds = std::count_if(aliveMinionsGUIDS.begin(), aliveMinionsGUIDS.end(), [](ObjectGuid const& summonGuid)
267 {
268 return summonGuid.GetEntry() == NPC_FLAMEWAKER_HEALER || summonGuid.GetEntry() == NPC_FLAMEWAKER_ELITE;
269 });
270
271 // Last remaining add
272 if (remainingAdds == 1)
273 {
276 }
277 // 50% of adds
278 else if (remainingAdds == 4)
279 {
281 }
282 else if (!remainingAdds)
283 {
284 static_minionsGUIDS.clear();
285
287 events.CancelEventGroup(PHASE_COMBAT);
289 me->SetImmuneToAll(true);
293 return;
294 }
296 }
297 }
std::uint32_t uint32
Definition Define.h:107
@ ENCOUNTER_CREDIT_KILL_CREATURE
Definition Map.h:151
@ SPELL_IMMUNE_POLY
Definition boss_majordomo_executus.cpp:61
@ SPELL_ENCOURAGEMENT
Definition boss_majordomo_executus.cpp:59
@ SPELL_CHAMPION
Definition boss_majordomo_executus.cpp:60
@ SAY_LAST_ADD
Definition boss_majordomo_executus.cpp:35
@ SAY_DEFEAT
Definition boss_majordomo_executus.cpp:32
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:504
void UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Unit *source)
Definition Map.cpp:2655
Definition ObjectGuid.h:118
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:112
Map * GetMap() const
Definition Object.h:536
@ NPC_FLAMEWAKER_ELITE
Definition molten_core.h:62
@ NPC_FLAMEWAKER_HEALER
Definition molten_core.h:61

References aliveMinionsGUIDS, DATA_MAJORDOMO_EXECUTUS, UnitAI::DoCastAOE(), DONE, ENCOUNTER_CREDIT_KILL_CREATURE, BossAI::EnterEvadeMode(), FACTION_MAJORDOMO_FRIENDLY, Object::GetEntry(), Object::GetGUID(), WorldObject::GetMap(), BossAI::instance, ScriptedAI::me, NPC_FLAMEWAKER_ELITE, NPC_FLAMEWAKER_HEALER, PHASE_COMBAT, SAY_DEFEAT, SAY_LAST_ADD, InstanceScript::SetBossState(), Unit::SetFaction(), Unit::SetImmuneToAll(), SPELL_CHAMPION, SPELL_ENCOURAGEMENT, SPELL_IMMUNE_POLY, static_minionsGUIDS, and Map::UpdateEncounterState().

◆ UpdateAI()

void boss_majordomo::boss_majordomoAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

319 {
320
321 switch (events.GetPhaseMask())
322 {
323 case (1 << (PHASE_COMBAT - 1)):
324 {
325 if (!UpdateVictim())
326 {
327 return;
328 }
329
330 events.Update(diff);
331
333 {
334 return;
335 }
336
337 while (uint32 const eventId = events.ExecuteEvent())
338 {
339 switch (eventId)
340 {
342 {
343 if (rand_chance() <= 50.f)
344 {
346 }
347 else
348 {
350 }
351 events.RepeatEvent(30000);
352 break;
353 }
355 {
356 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
357 {
360 }
361
362 events.RepeatEvent(30000);
363 break;
364 }
366 {
369 events.RepeatEvent(30000);
370 break;
371 }
372 }
373
375 {
376 return;
377 }
378 }
379
381 break;
382 }
383 case (1 << (PHASE_DEFEAT_OUTRO - 1)):
384 {
385 events.Update(diff);
386 while (uint32 const eventId = events.ExecuteEvent())
387 {
388 switch (eventId)
389 {
391 {
394 break;
395 }
397 {
400 break;
401 }
403 {
405 break;
406 }
407 }
408 }
409 break;
410 }
411 case (1 << (PHASE_RAGNAROS_SUMMONING - 1)):
412 {
413 events.Update(diff);
414 while (uint32 const eventId = events.ExecuteEvent())
415 {
416 switch (eventId)
417 {
419 {
421 {
422 lavaSplash->SetRespawnTime(900);
423 lavaSplash->Refresh();
424 }
426 {
427 lavaSteam->SetRespawnTime(900);
428 lavaSteam->Refresh();
429 }
431 // Next event will get triggered in MovementInform
432 me->SetWalk(true);
434 break;
435 }
437 {
439 {
440 me->SetFacingToObject(lavaSteam);
441 }
442
446 break;
447 }
449 {
451 {
452 ragnaros->AI()->Talk(SAY_ARRIVAL1_RAG);
453 }
455 break;
456 }
458 {
461 break;
462 }
464 {
466 {
467 ragnaros->AI()->Talk(SAY_ARRIVAL3_RAG);
468 }
469
471 break;
472 }
474 {
476 {
477 ragnaros->CastSpell(me, SPELL_ELEMENTAL_FIRE, true);
478 ragnaros->AI()->DoAction(ACTION_FINISH_RAGNAROS_INTRO);
479 }
480 break;
481 }
482 // Additional events
484 {
486 {
487 ragnaros->RemoveAurasDueToSpell(SPELL_RAGNAROS_FADE);
488 ragnaros->CastSpell(ragnaros, SPELL_RAGNA_EMERGE);
489 }
490 }break;
491 }
492 }
493 break;
494 }
495 }
496 }
double rand_chance()
Definition Random.cpp:83
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
Position const MajordomoMoveRagPos
Definition boss_majordomo_executus.cpp:121
@ SPELL_ELEMENTAL_FIRE
Definition boss_majordomo_executus.cpp:69
@ SPELL_RAGNA_EMERGE
Definition boss_majordomo_executus.cpp:70
@ SPELL_TELEPORT_TARGET
Definition boss_majordomo_executus.cpp:58
@ SPELL_DAMAGE_REFLECTION
Definition boss_majordomo_executus.cpp:54
@ SPELL_HATE_TO_ZERO
Definition boss_majordomo_executus.cpp:62
@ SPELL_TELEPORT_RANDOM
Definition boss_majordomo_executus.cpp:57
@ SPELL_MAGIC_REFLECTION
Definition boss_majordomo_executus.cpp:53
@ SAY_DEFEAT_2
Definition boss_majordomo_executus.cpp:37
@ SAY_ARRIVAL2_MAJ
Definition boss_majordomo_executus.cpp:34
@ SAY_ARRIVAL1_RAG
Definition boss_majordomo_executus.cpp:47
@ SAY_DEFEAT_3
Definition boss_majordomo_executus.cpp:38
@ SAY_RAG_SUM_2
Definition boss_majordomo_executus.cpp:43
@ SAY_ARRIVAL3_RAG
Definition boss_majordomo_executus.cpp:48
@ SAY_SUMMON_MAJ
Definition boss_majordomo_executus.cpp:33
@ EVENT_RAGNAROS_SUMMON_4
Definition boss_majordomo_executus.cpp:89
@ EVENT_RAGNAROS_SUMMON_3
Definition boss_majordomo_executus.cpp:88
@ EVENT_RAGNAROS_SUMMON_5
Definition boss_majordomo_executus.cpp:90
@ EVENT_RAGNAROS_EMERGE
Definition boss_majordomo_executus.cpp:93
@ EVENT_DEFEAT_OUTRO_2
Definition boss_majordomo_executus.cpp:83
@ EVENT_RAGNAROS_SUMMON_6
Definition boss_majordomo_executus.cpp:91
@ EVENT_DEFEAT_OUTRO_3
Definition boss_majordomo_executus.cpp:84
bool UpdateVictim()
Definition CreatureAI.cpp:280
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3208
Definition GameObject.h:120
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:213
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:110
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:177
Definition Unit.h:636
MotionMaster * GetMotionMaster()
Definition Unit.h:1673
void SetFacingToObject(WorldObject *object)
Definition Unit.cpp:20591
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
@ DATA_LAVA_SPLASH
Definition molten_core.h:44
@ DATA_LAVA_STEAM
Definition molten_core.h:43
@ DATA_RAGNAROS
Definition molten_core.h:40
@ ACTION_FINISH_RAGNAROS_INTRO
Definition molten_core.h:50
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:184

References ACTION_FINISH_RAGNAROS_INTRO, DATA_LAVA_SPLASH, DATA_LAVA_STEAM, DATA_RAGNAROS, UnitAI::DoCast(), UnitAI::DoCastAOE(), UnitAI::DoCastSelf(), UnitAI::DoMeleeAttackIfReady(), EVENT_DEFEAT_OUTRO_1, EVENT_DEFEAT_OUTRO_2, EVENT_DEFEAT_OUTRO_3, EVENT_RAGNAROS_EMERGE, EVENT_RAGNAROS_SUMMON_1, EVENT_RAGNAROS_SUMMON_2, EVENT_RAGNAROS_SUMMON_3, EVENT_RAGNAROS_SUMMON_4, EVENT_RAGNAROS_SUMMON_5, EVENT_RAGNAROS_SUMMON_6, EVENT_SHIELD_REFLECTION, EVENT_TELEPORT_RANDOM, EVENT_TELEPORT_TARGET, ObjectAccessor::GetCreature(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), Unit::HasUnitState(), BossAI::instance, MajordomoMoveRagPos, ScriptedAI::me, MotionMaster::MovePoint(), PHASE_COMBAT, PHASE_DEFEAT_OUTRO, PHASE_RAGNAROS_SUMMONING, POINT_RAGNAROS_SUMMON, rand_chance(), Random, SAY_ARRIVAL1_RAG, SAY_ARRIVAL2_MAJ, SAY_ARRIVAL3_RAG, SAY_DEFEAT_2, SAY_DEFEAT_3, SAY_RAG_SUM_2, SAY_SUMMON_MAJ, UnitAI::SelectTarget(), Unit::SetFacingToObject(), Creature::SetWalk(), SPELL_DAMAGE_REFLECTION, SPELL_ELEMENTAL_FIRE, SPELL_HATE_TO_ZERO, SPELL_MAGIC_REFLECTION, SPELL_RAGNA_EMERGE, SPELL_RAGNAROS_FADE, SPELL_TELEPORT_RANDOM, SPELL_TELEPORT_SELF, SPELL_TELEPORT_TARGET, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ aliveMinionsGUIDS

GuidSet boss_majordomo::boss_majordomoAI::aliveMinionsGUIDS
private

◆ majordomoSummonsData

std::unordered_map<uint32, MajordomoAddData> boss_majordomo::boss_majordomoAI::majordomoSummonsData
private

Referenced by InitializeAI(), and Reset().

◆ static_minionsGUIDS

GuidSet boss_majordomo::boss_majordomoAI::static_minionsGUIDS
private

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