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
 
void UpdateAI (uint32 diff) override
 
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
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent.
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void 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 DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, 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)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
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 *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always 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)
 
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
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
bool _ProccessHealthCheckEvent (uint8 healthPct, uint32 damage, std::function< void()> exec) const
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_majordomoAI()

boss_majordomo::boss_majordomoAI::boss_majordomoAI ( Creature creature)
inline
140: BossAI(creature, DATA_MAJORDOMO_EXECUTUS) {}
@ DATA_MAJORDOMO_EXECUTUS
Definition: molten_core.h:40
Definition: ScriptedCreature.h:456

Member Function Documentation

◆ CanAIAttack()

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

Reimplemented from UnitAI.

228 {
230 }
@ DONE
Definition: InstanceScript.h:59
InstanceScript *const instance
Definition: ScriptedCreature.h:461
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:230

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

◆ DamageTaken()

void boss_majordomo::boss_majordomoAI::DamageTaken ( Unit ,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from BossAI.

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

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

◆ DoAction()

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

Reimplemented from UnitAI.

518 {
520 {
523 }
524 }
@ PHASE_RAGNAROS_SUMMONING
Definition: boss_majordomo_executus.cpp:115
@ EVENT_RAGNAROS_SUMMON_1
Definition: boss_majordomo_executus.cpp:85
@ ACTION_START_RAGNAROS_INTRO
Definition: molten_core.h:50

References ACTION_START_RAGNAROS_INTRO, EVENT_RAGNAROS_SUMMON_1, and PHASE_RAGNAROS_SUMMONING.

◆ InitializeAI()

void boss_majordomo::boss_majordomoAI::InitializeAI ( )
inlineoverridevirtual

Reimplemented from UnitAI.

161 {
164 {
165 events.SetPhase(PHASE_COMBAT);
166
167 std::list<TempSummon*> p_summons;
169 if (!p_summons.empty())
170 {
171 for (TempSummon const* summon : p_summons)
172 {
173 if (summon)
174 {
175 static_minionsGUIDS.insert(summon->GetGUID());
176 majordomoSummonsData[summon->GetGUID().GetCounter()] = MajordomoAddData(summon->GetGUID(), summon->GetEntry(), summon->GetPosition());
177 }
178 }
179 }
180 }
181 else
182 {
183 events.SetPhase(PHASE_NONE);
184 me->SetImmuneToAll(true);
187 }
188 }
@ UNIT_NPC_FLAG_GOSSIP
Definition: Unit.h:516
@ SUMMON_GROUP_ADDS
Definition: boss_majordomo_executus.cpp:106
@ PHASE_NONE
Definition: boss_majordomo_executus.cpp:112
@ FACTION_MAJORDOMO_FRIENDLY
Definition: boss_majordomo_executus.cpp:105
virtual void InitializeAI()
Definition: UnitAI.h:193
Definition: TemporarySummon.h:40
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition: Object.cpp:2395
void SetFaction(uint32 faction)
Definition: Unit.cpp:10029
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:1647
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:1678
Definition: boss_majordomo_executus.cpp:124
std::unordered_map< uint32, MajordomoAddData > majordomoSummonsData
Definition: boss_majordomo_executus.cpp:528
GuidSet static_minionsGUIDS
Definition: boss_majordomo_executus.cpp:526

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 BossAI.

143 {
145 me->DespawnOrUnsummon(10s, 0s);
146 }
@ SAY_DEATH
Definition: boss_majordomo_executus.cpp:43
Talk
Definition: boss_fathomlord_karathress.cpp:23
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2108

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 BossAI.

241 {
242 if (!events.IsInPhase(PHASE_COMBAT))
243 {
244 return;
245 }
246
251
255
256 aliveMinionsGUIDS.clear();
258 }
@ SPELL_SEPARATION_ANXIETY
Definition: boss_majordomo_executus.cpp:62
@ SPELL_AEGIS_OF_RAGNAROS
Definition: boss_majordomo_executus.cpp:55
@ SAY_AGGRO
Definition: boss_majordomo_executus.cpp:28
@ EVENT_TELEPORT_TARGET
Definition: boss_majordomo_executus.cpp:78
@ EVENT_TELEPORT_RANDOM
Definition: boss_majordomo_executus.cpp:77
@ EVENT_SHIELD_REFLECTION
Definition: boss_majordomo_executus.cpp:76
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:249
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:369
void _JustEngagedWith()
Definition: ScriptedCreature.cpp:598
GuidSet aliveMinionsGUIDS
Definition: boss_majordomo_executus.cpp:527

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 BossAI.

299 {
302 {
303 events.Reset();
304 events.SetPhase(PHASE_DEFEAT_OUTRO);
306 }
307 }
@ PHASE_DEFEAT_OUTRO
Definition: boss_majordomo_executus.cpp:114
@ EVENT_DEFEAT_OUTRO_1
Definition: boss_majordomo_executus.cpp:81
void _JustReachedHome()
Definition: ScriptedCreature.h:491

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 BossAI.

149 {
150 if (summon->GetEntry() == NPC_RAGNAROS)
151 {
152 summon->CastSpell(summon, SPELL_RAGNAROS_FADE);
153 summon->CastSpell(summon, SPELL_RAGNAROS_SUBMERGE_EFFECT, true);
155 summon->SetImmuneToAll(true);
157 }
158 }
@ REACT_PASSIVE
Definition: Unit.h:1023
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
@ SPELL_RAGNAROS_SUBMERGE_EFFECT
Definition: boss_majordomo_executus.cpp:71
@ SPELL_RAGNAROS_FADE
Definition: boss_majordomo_executus.cpp:70
@ NPC_RAGNAROS
Definition: molten_core.h:61
void SetReactState(ReactStates st)
Definition: Creature.h:89
uint32 GetEntry() const
Definition: Object.h:109
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:1169
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1481

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 ScriptedAI.

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

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

◆ MovementInform()

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

Reimplemented from ScriptedAI.

498 {
499 if (type == POINT_MOTION_TYPE && pointId == POINT_RAGNAROS_SUMMON)
500 {
503 }
504 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ POINT_RAGNAROS_SUMMON
Definition: boss_majordomo_executus.cpp:109
@ SPELL_SUMMON_RAGNAROS
Definition: boss_majordomo_executus.cpp:67
@ EVENT_RAGNAROS_SUMMON_2
Definition: boss_majordomo_executus.cpp:86

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 BossAI.

191 {
192 me->ResetLootMode();
193 events.Reset();
194 aliveMinionsGUIDS.clear();
195
197 {
198 events.SetPhase(PHASE_COMBAT);
200
201 for (auto const& summon : majordomoSummonsData)
202 {
203 if (ObjectAccessor::GetCreature(*me, summon.second.guid))
204 {
205 continue;
206 }
207
208 if (Creature* spawn = me->SummonCreature(summon.second.creatureEntry, summon.second.spawnPos))
209 {
210 static_minionsGUIDS.erase(summon.second.guid); // Erase the guid from the previous, no longer existing, spawn.
211 static_minionsGUIDS.insert(spawn->GetGUID());
212 majordomoSummonsData.erase(summon.second.guid.GetCounter());
213 majordomoSummonsData[spawn->GetGUID().GetCounter()] = MajordomoAddData(spawn->GetGUID(), spawn->GetEntry(), spawn->GetPosition());
214 }
215 }
216
218 }
219 else
220 {
221 static_minionsGUIDS.clear();
222 majordomoSummonsData.clear();
224 }
225 }
@ NOT_STARTED
Definition: InstanceScript.h:56
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:67
SummonList summons
Definition: ScriptedCreature.h:497
Definition: Creature.h:46
void ResetLootMode()
Definition: Creature.h:237
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:2318
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:1648
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:317

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 ScriptedAI.

507 {
508 if (events.IsInPhase(PHASE_DEFEAT_OUTRO) && spellInfo->Id == SPELL_TELEPORT_SELF)
509 {
513 events.SetPhase(PHASE_NONE);
514 }
515 }
@ SPELL_TELEPORT_SELF
Definition: boss_majordomo_executus.cpp:66
Position const MajordomoRagnaros
Definition: boss_majordomo_executus.cpp:118
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:328
float GetPositionZ() const
Definition: Position.h:119
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition: Unit.cpp:20148

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.

261 {
262 aliveMinionsGUIDS.erase(summon->GetGUID());
263 if (summon->GetEntry() == NPC_FLAMEWAKER_HEALER || summon->GetEntry() == NPC_FLAMEWAKER_ELITE)
264 {
265 uint32 const remainingAdds = std::count_if(aliveMinionsGUIDS.begin(), aliveMinionsGUIDS.end(), [](ObjectGuid const& summonGuid)
266 {
267 return summonGuid.GetEntry() == NPC_FLAMEWAKER_HEALER || summonGuid.GetEntry() == NPC_FLAMEWAKER_ELITE;
268 });
269
270 // Last remaining add
271 if (remainingAdds == 1)
272 {
275 }
276 // 50% of adds
277 else if (remainingAdds == 4)
278 {
280 }
281 else if (!remainingAdds)
282 {
283 static_minionsGUIDS.clear();
284
286 events.CancelEventGroup(PHASE_COMBAT);
288 me->SetImmuneToAll(true);
292 return;
293 }
295 }
296 }
std::uint32_t uint32
Definition: Define.h:108
@ ENCOUNTER_CREDIT_KILL_CREATURE
Definition: Map.h:307
@ SPELL_IMMUNE_POLY
Definition: boss_majordomo_executus.cpp:60
@ SPELL_ENCOURAGEMENT
Definition: boss_majordomo_executus.cpp:58
@ SPELL_CHAMPION
Definition: boss_majordomo_executus.cpp:59
@ SAY_LAST_ADD
Definition: boss_majordomo_executus.cpp:34
@ SAY_DEFEAT
Definition: boss_majordomo_executus.cpp:31
@ NPC_FLAMEWAKER_ELITE
Definition: molten_core.h:63
@ NPC_FLAMEWAKER_HEALER
Definition: molten_core.h:62
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:197
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
Map * GetMap() const
Definition: Object.h:517
Definition: ObjectGuid.h:120
void UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Unit *source)
Definition: Map.cpp:3450

References aliveMinionsGUIDS, DATA_MAJORDOMO_EXECUTUS, UnitAI::DoCastAOE(), DONE, ENCOUNTER_CREDIT_KILL_CREATURE, CreatureAI::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  diff)
inlineoverridevirtual

Reimplemented from BossAI.

318 {
319
320 switch (events.GetPhaseMask())
321 {
322 case (1 << (PHASE_COMBAT - 1)):
323 {
324 if (!UpdateVictim())
325 {
326 return;
327 }
328
329 events.Update(diff);
330
332 {
333 return;
334 }
335
336 while (uint32 const eventId = events.ExecuteEvent())
337 {
338 switch (eventId)
339 {
341 {
342 if (rand_chance() <= 50.f)
343 {
345 }
346 else
347 {
349 }
350 events.RepeatEvent(30000);
351 break;
352 }
354 {
355 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
356 {
359 }
360
361 events.RepeatEvent(30000);
362 break;
363 }
365 {
368 events.RepeatEvent(30000);
369 break;
370 }
371 }
372
374 {
375 return;
376 }
377 }
378
380 break;
381 }
382 case (1 << (PHASE_DEFEAT_OUTRO - 1)):
383 {
384 events.Update(diff);
385 while (uint32 const eventId = events.ExecuteEvent())
386 {
387 switch (eventId)
388 {
390 {
393 break;
394 }
396 {
399 break;
400 }
402 {
404 break;
405 }
406 }
407 }
408 break;
409 }
410 case (1 << (PHASE_RAGNAROS_SUMMONING - 1)):
411 {
412 events.Update(diff);
413 while (uint32 const eventId = events.ExecuteEvent())
414 {
415 switch (eventId)
416 {
418 {
420 {
421 lavaSplash->SetRespawnTime(900);
422 lavaSplash->Refresh();
423 }
425 {
426 lavaSteam->SetRespawnTime(900);
427 lavaSteam->Refresh();
428 }
430 // Next event will get triggered in MovementInform
431 me->SetWalk(true);
433 break;
434 }
436 {
438 {
439 me->SetFacingToObject(lavaSteam);
440 }
441
445 break;
446 }
448 {
450 {
451 ragnaros->AI()->Talk(SAY_ARRIVAL1_RAG);
452 }
454 break;
455 }
457 {
460 break;
461 }
463 {
465 {
466 ragnaros->AI()->Talk(SAY_ARRIVAL3_RAG);
467 }
468
470 break;
471 }
473 {
475 {
476 ragnaros->CastSpell(me, SPELL_ELEMENTAL_FIRE, true);
477 ragnaros->AI()->DoAction(ACTION_FINISH_RAGNAROS_INTRO);
478 }
479 break;
480 }
481 // Additional events
483 {
485 {
486 ragnaros->RemoveAurasDueToSpell(SPELL_RAGNAROS_FADE);
487 ragnaros->CastSpell(ragnaros, SPELL_RAGNA_EMERGE);
488 }
489 }break;
490 }
491 }
492 break;
493 }
494 }
495 }
double rand_chance()
Definition: Random.cpp:83
@ UNIT_STATE_CASTING
Definition: Unit.h:340
Position const MajordomoMoveRagPos
Definition: boss_majordomo_executus.cpp:120
@ SPELL_ELEMENTAL_FIRE
Definition: boss_majordomo_executus.cpp:68
@ SPELL_RAGNA_EMERGE
Definition: boss_majordomo_executus.cpp:69
@ SPELL_TELEPORT_TARGET
Definition: boss_majordomo_executus.cpp:57
@ SPELL_DAMAGE_REFLECTION
Definition: boss_majordomo_executus.cpp:53
@ SPELL_HATE_TO_ZERO
Definition: boss_majordomo_executus.cpp:61
@ SPELL_TELEPORT_RANDOM
Definition: boss_majordomo_executus.cpp:56
@ SPELL_MAGIC_REFLECTION
Definition: boss_majordomo_executus.cpp:52
@ SAY_DEFEAT_2
Definition: boss_majordomo_executus.cpp:36
@ SAY_ARRIVAL2_MAJ
Definition: boss_majordomo_executus.cpp:33
@ SAY_ARRIVAL1_RAG
Definition: boss_majordomo_executus.cpp:46
@ SAY_DEFEAT_3
Definition: boss_majordomo_executus.cpp:37
@ SAY_RAG_SUM_2
Definition: boss_majordomo_executus.cpp:42
@ SAY_ARRIVAL3_RAG
Definition: boss_majordomo_executus.cpp:47
@ SAY_SUMMON_MAJ
Definition: boss_majordomo_executus.cpp:32
@ EVENT_RAGNAROS_SUMMON_4
Definition: boss_majordomo_executus.cpp:88
@ EVENT_RAGNAROS_SUMMON_3
Definition: boss_majordomo_executus.cpp:87
@ EVENT_RAGNAROS_SUMMON_5
Definition: boss_majordomo_executus.cpp:89
@ EVENT_RAGNAROS_EMERGE
Definition: boss_majordomo_executus.cpp:92
@ EVENT_DEFEAT_OUTRO_2
Definition: boss_majordomo_executus.cpp:82
@ EVENT_RAGNAROS_SUMMON_6
Definition: boss_majordomo_executus.cpp:90
@ EVENT_DEFEAT_OUTRO_3
Definition: boss_majordomo_executus.cpp:83
@ DATA_LAVA_SPLASH
Definition: molten_core.h:45
@ DATA_LAVA_STEAM
Definition: molten_core.h:44
@ DATA_RAGNAROS
Definition: molten_core.h:41
@ ACTION_FINISH_RAGNAROS_INTRO
Definition: molten_core.h:51
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:189
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
bool UpdateVictim()
Definition: CreatureAI.cpp:269
bool SetWalk(bool enable) override
Definition: Creature.cpp:3081
Definition: GameObject.h:122
Definition: Unit.h:1290
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20792
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210

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