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 sGossipSelect (Player *player, uint32 menuId, uint32) 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 (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual 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, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void 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
130: 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.

216 {
218 }
@ 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.

293 {
294 if (events.IsInPhase(PHASE_COMBAT) && me->GetHealth() <= damage)
295 {
296 damage = 0;
297 }
298 }
@ PHASE_COMBAT
Definition boss_majordomo_executus.cpp:108
events
Definition boss_sartura.cpp:43
uint32 GetHealth() const
Definition Unit.h:1109
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.

495 {
497 {
500 }
501 }
@ PHASE_RAGNAROS_SUMMONING
Definition boss_majordomo_executus.cpp:110
@ 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.

151 {
154 {
155 events.SetPhase(PHASE_COMBAT);
156
157 std::list<TempSummon*> p_summons;
159 if (!p_summons.empty())
160 {
161 for (TempSummon const* summon : p_summons)
162 {
163 if (summon)
164 {
165 static_minionsGUIDS.insert(summon->GetGUID());
166 majordomoSummonsData[summon->GetGUID().GetCounter()] = MajordomoAddData(summon->GetGUID(), summon->GetEntry(), summon->GetPosition());
167 }
168 }
169 }
170 }
171 else
172 {
173 events.SetPhase(PHASE_NONE);
174 me->SetImmuneToAll(true);
177 }
178 }
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:322
@ SUMMON_GROUP_ADDS
Definition boss_majordomo_executus.cpp:101
@ PHASE_NONE
Definition boss_majordomo_executus.cpp:107
@ FACTION_MAJORDOMO_FRIENDLY
Definition boss_majordomo_executus.cpp:100
Definition TemporarySummon.h:50
virtual void InitializeAI()
Definition UnitAI.h:209
void SetFaction(uint32 faction)
Definition Unit.cpp:7117
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:765
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition Unit.h:925
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2525
Definition boss_majordomo_executus.cpp:119
std::unordered_map< uint32, MajordomoAddData > majordomoSummonsData
Definition boss_majordomo_executus.cpp:517
GuidSet static_minionsGUIDS
Definition boss_majordomo_executus.cpp:515

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.

133 {
135 me->DespawnOrUnsummon(10s, 0s);
136 }
@ SAY_DEATH
Definition boss_majordomo_executus.cpp:44
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2199
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.

226 {
227 if (!events.IsInPhase(PHASE_COMBAT))
228 return;
229
234
238
239 aliveMinionsGUIDS.clear();
241 }
@ 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:286
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
GuidSet aliveMinionsGUIDS
Definition boss_majordomo_executus.cpp:516

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.

282 {
285 {
286 events.Reset();
287 events.SetPhase(PHASE_DEFEAT_OUTRO);
289 }
290 }
@ PHASE_DEFEAT_OUTRO
Definition boss_majordomo_executus.cpp:109
@ 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.

139 {
140 if (summon->GetEntry() == NPC_RAGNAROS)
141 {
142 summon->CastSpell(summon, SPELL_RAGNAROS_FADE);
143 summon->CastSpell(summon, SPELL_RAGNAROS_SUBMERGE_EFFECT, true);
145 summon->SetImmuneToAll(true);
147 }
148 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ REACT_PASSIVE
Definition Unit.h:567
@ 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:100
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:1361
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
@ 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.

221 {
222 Talk(SAY_SLAY, victim);
223 }
@ SAY_SLAY
Definition boss_majordomo_executus.cpp:31

References SAY_SLAY.

◆ MovementInform()

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

Reimplemented from CreatureAI.

475 {
476 if (type == POINT_MOTION_TYPE && pointId == POINT_RAGNAROS_SUMMON)
477 {
480 }
481 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
@ POINT_RAGNAROS_SUMMON
Definition boss_majordomo_executus.cpp:104
@ 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.

181 {
182 me->ResetLootMode();
183 events.Reset();
184 aliveMinionsGUIDS.clear();
185
187 {
188 events.SetPhase(PHASE_COMBAT);
190
191 for (auto const& summon : majordomoSummonsData)
192 {
193 if (ObjectAccessor::GetCreature(*me, summon.second.guid))
194 continue;
195
196 if (Creature* spawn = me->SummonCreature(summon.second.creatureEntry, summon.second.spawnPos))
197 {
198 static_minionsGUIDS.erase(summon.second.guid); // Erase the guid from the previous, no longer existing, spawn.
199 static_minionsGUIDS.insert(spawn->GetGUID());
200 majordomoSummonsData.erase(summon.second.guid.GetCounter());
201 majordomoSummonsData[spawn->GetGUID().GetCounter()] = MajordomoAddData(spawn->GetGUID(), spawn->GetEntry(), spawn->GetPosition());
202 }
203 }
204
206 }
207 else
208 {
209 static_minionsGUIDS.clear();
210 majordomoSummonsData.clear();
212 }
213 }
@ NOT_STARTED
Definition InstanceScript.h:58
SummonList summons
Definition ScriptedCreature.h:539
Definition Creature.h:47
void ResetLootMode()
Definition Creature.h:250
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:400
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:766
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2448
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234

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.

◆ sGossipSelect()

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

Reimplemented from UnitAI.

504 {
505 if (menuId == MENU_ID_RAGNAROS_SUMMON)
506 {
507 CloseGossipMenuFor(player);
509 Talk(SAY_RAG_SUM_1, player);
511 }
512 }
void CloseGossipMenuFor(Player *player)
Definition ScriptedGossip.cpp:56
@ MENU_ID_RAGNAROS_SUMMON
Definition boss_majordomo_executus.cpp:98
@ SAY_RAG_SUM_1
Definition boss_majordomo_executus.cpp:42
void DoAction(int32 action) override
Definition boss_majordomo_executus.cpp:494

References ACTION_START_RAGNAROS_INTRO, CloseGossipMenuFor(), DoAction(), ScriptedAI::me, MENU_ID_RAGNAROS_SUMMON, Unit::RemoveNpcFlag(), SAY_RAG_SUM_1, and UNIT_NPC_FLAG_GOSSIP.

◆ SpellHit()

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

Reimplemented from CreatureAI.

484 {
485 if (events.IsInPhase(PHASE_DEFEAT_OUTRO) && spellInfo->Id == SPELL_TELEPORT_SELF)
486 {
490 events.SetPhase(PHASE_NONE);
491 }
492 }
@ SPELL_TELEPORT_SELF
Definition boss_majordomo_executus.cpp:67
Position const MajordomoRagnaros
Definition boss_majordomo_executus.cpp:113
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:347
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:15959
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.

244 {
245 aliveMinionsGUIDS.erase(summon->GetGUID());
246 if (summon->GetEntry() == NPC_FLAMEWAKER_HEALER || summon->GetEntry() == NPC_FLAMEWAKER_ELITE)
247 {
248 uint32 const remainingAdds = std::count_if(aliveMinionsGUIDS.begin(), aliveMinionsGUIDS.end(), [](ObjectGuid const& summonGuid)
249 {
250 return summonGuid.GetEntry() == NPC_FLAMEWAKER_HEALER || summonGuid.GetEntry() == NPC_FLAMEWAKER_ELITE;
251 });
252
253 // Last remaining add
254 if (remainingAdds == 1)
255 {
258 }
259 // 50% of adds
260 else if (remainingAdds == 4)
261 {
263 }
264 else if (!remainingAdds)
265 {
266 static_minionsGUIDS.clear();
267
269 events.CancelEventGroup(PHASE_COMBAT);
271 me->SetImmuneToAll(true);
275 return;
276 }
278 }
279 }
std::uint32_t uint32
Definition Define.h:107
@ ENCOUNTER_CREDIT_KILL_CREATURE
Definition Map.h:163
@ 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:2918
Definition ObjectGuid.h:121
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
Map * GetMap() const
Definition Object.h:631
@ 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.

301 {
302
303 switch (events.GetPhaseMask())
304 {
305 case (1 << (PHASE_COMBAT - 1)):
306 {
307 if (!UpdateVictim())
308 return;
309
310 events.Update(diff);
311
313 return;
314
315 while (uint32 const eventId = events.ExecuteEvent())
316 {
317 switch (eventId)
318 {
320 {
321 if (rand_chance() <= 50.f)
322 {
324 }
325 else
326 {
328 }
329 events.Repeat(30s);
330 break;
331 }
333 {
334 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, false))
335 {
338 }
339
340 events.Repeat(30s);
341 break;
342 }
344 {
347 events.Repeat(30s);
348 break;
349 }
350 }
351
353 return;
354 }
355
357 break;
358 }
359 case (1 << (PHASE_DEFEAT_OUTRO - 1)):
360 {
361 events.Update(diff);
362 while (uint32 const eventId = events.ExecuteEvent())
363 {
364 switch (eventId)
365 {
367 {
370 break;
371 }
373 {
376 break;
377 }
379 {
381 break;
382 }
383 }
384 }
385 break;
386 }
387 case (1 << (PHASE_RAGNAROS_SUMMONING - 1)):
388 {
389 events.Update(diff);
390 while (uint32 const eventId = events.ExecuteEvent())
391 {
392 switch (eventId)
393 {
395 {
397 {
398 lavaSplash->SetRespawnTime(900);
399 lavaSplash->Refresh();
400 }
402 {
403 lavaSteam->SetRespawnTime(900);
404 lavaSteam->Refresh();
405 }
407 // Next event will get triggered in MovementInform
408 me->SetWalk(true);
410 break;
411 }
413 {
415 {
416 me->SetFacingToObject(lavaSteam);
417 }
418
422 break;
423 }
425 {
427 {
428 ragnaros->AI()->Talk(SAY_ARRIVAL1_RAG);
429 }
431 break;
432 }
434 {
437 break;
438 }
440 {
442 {
443 ragnaros->AI()->Talk(SAY_ARRIVAL3_RAG);
444 }
445
447 break;
448 }
450 {
452 {
453 ragnaros->CastSpell(me, SPELL_ELEMENTAL_FIRE, true);
454 ragnaros->AI()->DoAction(ACTION_FINISH_RAGNAROS_INTRO);
455 }
456 break;
457 }
458 // Additional events
460 {
462 {
463 ragnaros->RemoveAurasDueToSpell(SPELL_RAGNAROS_FADE);
464 ragnaros->CastSpell(ragnaros, SPELL_RAGNA_EMERGE);
465 }
466 }break;
467 }
468 }
469 break;
470 }
471 }
472 }
@ 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:115
@ 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:350
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3343
Definition GameObject.h:120
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:115
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:179
Definition Unit.h:665
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:16465
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
@ 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:208

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: