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

Public Member Functions

 boss_majordomo (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 - this happens after JustEnteredCombat.
 
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
 
void sGossipHello (Player *player) override
 
void sGossipSelect (Player *player, uint32, uint32 action) override
 
- 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 uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true)
 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 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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_majordomo()

boss_majordomo::boss_majordomo ( Creature creature)
inline
136: BossAI(creature, DATA_MAJORDOMO_EXECUTUS) {}
Definition ScriptedCreature.h:485
@ DATA_MAJORDOMO_EXECUTUS
Definition molten_core.h:39

Member Function Documentation

◆ CanAIAttack()

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

Reimplemented from UnitAI.

222 {
224 }
@ DONE
Definition InstanceScript.h:61
InstanceScript *const instance
Definition ScriptedCreature.h:492
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252

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

◆ DamageTaken()

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

300 {
301 if (events.IsInPhase(PHASE_COMBAT) && me->GetHealth() <= damage)
302 {
303 damage = 0;
304 }
305 }
@ PHASE_COMBAT
Definition boss_majordomo_executus.cpp:114
events
Definition boss_sartura.cpp:43
uint32 GetHealth() const
Definition Unit.h:1108
Creature * me
Definition ScriptedCreature.h:281

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

◆ DoAction()

void boss_majordomo::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

502 {
504 {
507 }
508 }
@ 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.

Referenced by sGossipSelect().

◆ InitializeAI()

void boss_majordomo::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

157 {
160 {
161 events.SetPhase(PHASE_COMBAT);
162
163 std::list<TempSummon*> p_summons;
165 if (!p_summons.empty())
166 {
167 for (TempSummon const* summon : p_summons)
168 {
169 if (summon)
170 {
171 static_minionsGUIDS.insert(summon->GetGUID());
172 majordomoSummonsData[summon->GetGUID().GetCounter()] = MajordomoAddData(summon->GetGUID(), summon->GetEntry(), summon->GetPosition());
173 }
174 }
175 }
176 }
177 else
178 {
179 events.SetPhase(PHASE_NONE);
180 me->SetImmuneToAll(true);
183 }
184 }
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:322
@ 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:50
virtual void InitializeAI()
Definition UnitAI.h:209
void SetFaction(uint32 faction)
Definition Unit.cpp:7056
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:764
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition Unit.h:924
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2471
Definition boss_majordomo_executus.cpp:125
std::unordered_map< uint32, MajordomoAddData > majordomoSummonsData
Definition boss_majordomo_executus.cpp:556
GuidSet static_minionsGUIDS
Definition boss_majordomo_executus.cpp:554

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::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

139 {
141 me->DespawnOrUnsummon(10s, 0s);
142 }
@ SAY_DEATH
Definition boss_majordomo_executus.cpp:44
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2126
Talk
Definition hyjal.cpp:82

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

◆ JustEngagedWith()

void boss_majordomo::JustEngagedWith ( Unit )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

233 {
234 if (!events.IsInPhase(PHASE_COMBAT))
235 return;
236
241
245
246 aliveMinionsGUIDS.clear();
248 }
@ 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:677
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:285
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
GuidSet aliveMinionsGUIDS
Definition boss_majordomo_executus.cpp:555

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::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

289 {
292 {
293 events.Reset();
294 events.SetPhase(PHASE_DEFEAT_OUTRO);
296 }
297 }
@ PHASE_DEFEAT_OUTRO
Definition boss_majordomo_executus.cpp:115
@ EVENT_DEFEAT_OUTRO_1
Definition boss_majordomo_executus.cpp:82
void _JustReachedHome()
Definition ScriptedCreature.h:534

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

◆ JustSummoned()

void boss_majordomo::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

145 {
146 if (summon->GetEntry() == NPC_RAGNAROS)
147 {
148 summon->CastSpell(summon, SPELL_RAGNAROS_FADE);
149 summon->CastSpell(summon, SPELL_RAGNAROS_SUBMERGE_EFFECT, true);
151 summon->SetImmuneToAll(true);
153 }
154 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ REACT_PASSIVE
Definition Unit.h:566
@ 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:99
uint32 GetEntry() const
Definition Object.h:117
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
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
@ 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::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

227 {
228 if (roll_chance_i(25) && victim->IsPlayer())
229 Talk(SAY_SLAY);
230 }
bool roll_chance_i(int chance)
Definition Random.h:63
@ SAY_SLAY
Definition boss_majordomo_executus.cpp:31
bool IsPlayer() const
Definition Object.h:201

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

◆ MovementInform()

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

Reimplemented from CreatureAI.

482 {
483 if (type == POINT_MOTION_TYPE && pointId == POINT_RAGNAROS_SUMMON)
484 {
487 }
488 }
@ 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::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

187 {
188 me->ResetLootMode();
189 events.Reset();
190 aliveMinionsGUIDS.clear();
191
193 {
194 events.SetPhase(PHASE_COMBAT);
196
197 for (auto const& summon : majordomoSummonsData)
198 {
199 if (ObjectAccessor::GetCreature(*me, summon.second.guid))
200 continue;
201
202 if (Creature* spawn = me->SummonCreature(summon.second.creatureEntry, summon.second.spawnPos))
203 {
204 static_minionsGUIDS.erase(summon.second.guid); // Erase the guid from the previous, no longer existing, spawn.
205 static_minionsGUIDS.insert(spawn->GetGUID());
206 majordomoSummonsData.erase(summon.second.guid.GetCounter());
207 majordomoSummonsData[spawn->GetGUID().GetCounter()] = MajordomoAddData(spawn->GetGUID(), spawn->GetEntry(), spawn->GetPosition());
208 }
209 }
210
212 }
213 else
214 {
215 static_minionsGUIDS.clear();
216 majordomoSummonsData.clear();
218 }
219 }
@ NOT_STARTED
Definition InstanceScript.h:58
SummonList summons
Definition ScriptedCreature.h:539
Definition Creature.h:47
void ResetLootMode()
Definition Creature.h:248
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:390
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:765
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:2394
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.

◆ sGossipHello()

void boss_majordomo::sGossipHello ( Player player)
inlineoverridevirtual

Reimplemented from UnitAI.

511 {
514 }
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition ScriptedGossip.cpp:28
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const &guid)
Definition ScriptedGossip.cpp:45
@ GOSSIP_SENDER_MAIN
Definition ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition ScriptedGossip.h:68
@ GOSSIP_ITEM_SUMMON_1
Definition boss_majordomo_executus.cpp:102
@ TEXT_ID_SUMMON_1
Definition boss_majordomo_executus.cpp:98
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114

References AddGossipItemFor(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ITEM_SUMMON_1, GOSSIP_SENDER_MAIN, ScriptedAI::me, SendGossipMenuFor(), and TEXT_ID_SUMMON_1.

◆ sGossipSelect()

void boss_majordomo::sGossipSelect ( Player player,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from UnitAI.

517 {
518 ClearGossipMenuFor(player);
519 switch (action)
520 {
522 {
525 break;
526 }
528 {
531 break;
532 }
534 {
537 break;
538 }
540 {
541 CloseGossipMenuFor(player);
543 Talk(SAY_RAG_SUM_1, player);
545 break;
546 }
547 default:
548 CloseGossipMenuFor(player);
549 break;
550 }
551 }
void ClearGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:56
@ TEXT_ID_SUMMON_2
Definition boss_majordomo_executus.cpp:99
@ TEXT_ID_SUMMON_3
Definition boss_majordomo_executus.cpp:100
@ GOSSIP_ITEM_SUMMON_2
Definition boss_majordomo_executus.cpp:103
@ GOSSIP_ITEM_SUMMON_3
Definition boss_majordomo_executus.cpp:104
@ SAY_RAG_SUM_1
Definition boss_majordomo_executus.cpp:42
void DoAction(int32 action) override
Definition boss_majordomo_executus.cpp:501

References ACTION_START_RAGNAROS_INTRO, AddGossipItemFor(), ClearGossipMenuFor(), CloseGossipMenuFor(), DoAction(), Object::GetGUID(), GOSSIP_ACTION_INFO_DEF, GOSSIP_ITEM_SUMMON_2, GOSSIP_ITEM_SUMMON_3, GOSSIP_SENDER_MAIN, ScriptedAI::me, Unit::RemoveNpcFlag(), SAY_RAG_SUM_1, SendGossipMenuFor(), TEXT_ID_SUMMON_2, TEXT_ID_SUMMON_3, and UNIT_NPC_FLAG_GOSSIP.

◆ SpellHit()

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

Reimplemented from CreatureAI.

491 {
492 if (events.IsInPhase(PHASE_DEFEAT_OUTRO) && spellInfo->Id == SPELL_TELEPORT_SELF)
493 {
497 events.SetPhase(PHASE_NONE);
498 }
499 }
@ 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:345
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:15921
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::SummonedCreatureDies ( Creature summon,
Unit  
)
inlineoverridevirtual

Reimplemented from CreatureAI.

251 {
252 aliveMinionsGUIDS.erase(summon->GetGUID());
253 if (summon->GetEntry() == NPC_FLAMEWAKER_HEALER || summon->GetEntry() == NPC_FLAMEWAKER_ELITE)
254 {
255 uint32 const remainingAdds = std::count_if(aliveMinionsGUIDS.begin(), aliveMinionsGUIDS.end(), [](ObjectGuid const& summonGuid)
256 {
257 return summonGuid.GetEntry() == NPC_FLAMEWAKER_HEALER || summonGuid.GetEntry() == NPC_FLAMEWAKER_ELITE;
258 });
259
260 // Last remaining add
261 if (remainingAdds == 1)
262 {
265 }
266 // 50% of adds
267 else if (remainingAdds == 4)
268 {
270 }
271 else if (!remainingAdds)
272 {
273 static_minionsGUIDS.clear();
274
276 events.CancelEventGroup(PHASE_COMBAT);
278 me->SetImmuneToAll(true);
282 return;
283 }
285 }
286 }
std::uint32_t uint32
Definition Define.h:107
@ ENCOUNTER_CREDIT_KILL_CREATURE
Definition Map.h:159
@ 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:526
void UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Unit *source)
Definition Map.cpp:2493
Definition ObjectGuid.h:118
Map * GetMap() const
Definition Object.h:625
@ 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::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

308 {
309
310 switch (events.GetPhaseMask())
311 {
312 case (1 << (PHASE_COMBAT - 1)):
313 {
314 if (!UpdateVictim())
315 return;
316
317 events.Update(diff);
318
320 return;
321
322 while (uint32 const eventId = events.ExecuteEvent())
323 {
324 switch (eventId)
325 {
327 {
328 if (rand_chance() <= 50.f)
329 {
331 }
332 else
333 {
335 }
336 events.Repeat(30s);
337 break;
338 }
340 {
341 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, false))
342 {
345 }
346
347 events.Repeat(30s);
348 break;
349 }
351 {
354 events.Repeat(30s);
355 break;
356 }
357 }
358
360 return;
361 }
362
364 break;
365 }
366 case (1 << (PHASE_DEFEAT_OUTRO - 1)):
367 {
368 events.Update(diff);
369 while (uint32 const eventId = events.ExecuteEvent())
370 {
371 switch (eventId)
372 {
374 {
377 break;
378 }
380 {
383 break;
384 }
386 {
388 break;
389 }
390 }
391 }
392 break;
393 }
394 case (1 << (PHASE_RAGNAROS_SUMMONING - 1)):
395 {
396 events.Update(diff);
397 while (uint32 const eventId = events.ExecuteEvent())
398 {
399 switch (eventId)
400 {
402 {
404 {
405 lavaSplash->SetRespawnTime(900);
406 lavaSplash->Refresh();
407 }
409 {
410 lavaSteam->SetRespawnTime(900);
411 lavaSteam->Refresh();
412 }
414 // Next event will get triggered in MovementInform
415 me->SetWalk(true);
417 break;
418 }
420 {
422 {
423 me->SetFacingToObject(lavaSteam);
424 }
425
429 break;
430 }
432 {
434 {
435 ragnaros->AI()->Talk(SAY_ARRIVAL1_RAG);
436 }
438 break;
439 }
441 {
444 break;
445 }
447 {
449 {
450 ragnaros->AI()->Talk(SAY_ARRIVAL3_RAG);
451 }
452
454 break;
455 }
457 {
459 {
460 ragnaros->CastSpell(me, SPELL_ELEMENTAL_FIRE, true);
461 ragnaros->AI()->DoAction(ACTION_FINISH_RAGNAROS_INTRO);
462 }
463 break;
464 }
465 // Additional events
467 {
469 {
470 ragnaros->RemoveAurasDueToSpell(SPELL_RAGNAROS_FADE);
471 ragnaros->CastSpell(ragnaros, SPELL_RAGNA_EMERGE);
472 }
473 }break;
474 }
475 }
476 break;
477 }
478 }
479 }
@ FORCED_MOVEMENT_NONE
Definition MotionMaster.h:86
double rand_chance()
Definition Random.cpp:91
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
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:353
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3247
Definition GameObject.h:120
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:111
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:178
Definition Unit.h:664
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:16421
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
@ 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, FORCED_MOVEMENT_NONE, 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::aliveMinionsGUIDS
private

◆ majordomoSummonsData

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

Referenced by InitializeAI(), and Reset().

◆ static_minionsGUIDS

GuidSet boss_majordomo::static_minionsGUIDS
private

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