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

Public Member Functions

 boss_mandokirAI (Creature *creature)
 
void Reset () override
 
void JustDied (Unit *) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void KilledUnit (Unit *victim) override
 
void DoAction (int32 action) override
 
void SetGUID (ObjectGuid const &guid, int32 type) override
 
void MovementInform (uint32 type, uint32 id) override
 
void CalculateThreat (Unit *hatedUnit, float &threat, SpellInfo const *threatSpell) override
 
void DamageDealt (Unit *doneTo, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage to any victim (before damage apply)
 
bool OnTeleportUnreacheablePlayer (Player *player) override
 
void DoMeleeAttackIfReady (bool ignoreCasting)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- 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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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
 
Player * SelectTargetFromPlayerList (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)
 
WorldObject * GetSummoner () 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 SummonedCreatureDies (Creature *, Unit *)
 
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 OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
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 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

uint8 killCount
 
ObjectGuid reviveGUID
 
bool _useExecute
 
std::pair< ObjectGuid, float > _chargeTarget
 

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
Creature * me
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- 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)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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_mandokirAI()

boss_mandokir::boss_mandokirAI::boss_mandokirAI ( Creature *  creature)
inline
151: BossAI(creature, DATA_MANDOKIR) { }
Definition ScriptedCreature.h:496
@ DATA_MANDOKIR
Definition zulgurub.h:37

Member Function Documentation

◆ CalculateThreat()

void boss_mandokir::boss_mandokirAI::CalculateThreat ( Unit *  hatedUnit,
float &  threat,
SpellInfo const *  threatSpell 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

286 {
287 if (_chargeTarget.first == hatedUnit->GetGUID())
288 {
289 // Do not count DOTs/HOTs
290 if (!(threatSpell && (threatSpell->HasAura(SPELL_AURA_DAMAGE_SHIELD) || threatSpell->HasAttribute(SPELL_ATTR0_CU_NO_INITIAL_THREAT))))
291 {
292 _chargeTarget.second += threat;
293 }
294 }
295 }
@ SPELL_AURA_DAMAGE_SHIELD
Definition SpellAuraDefines.h:78
@ SPELL_ATTR0_CU_NO_INITIAL_THREAT
Definition SpellInfo.h:181
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
std::pair< ObjectGuid, float > _chargeTarget
Definition boss_mandokir.cpp:500

References _chargeTarget, Object::GetGUID(), SpellInfo::HasAttribute(), SpellInfo::HasAura(), SPELL_ATTR0_CU_NO_INITIAL_THREAT, and SPELL_AURA_DAMAGE_SHIELD.

◆ DamageDealt()

void boss_mandokir::boss_mandokirAI::DamageDealt ( Unit *  ,
uint32 &  ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage to any victim (before damage apply)

Reimplemented from UnitAI.

298 {
299 if (doneTo && doneTo == me->GetVictim())
300 {
301 if (doneTo->HealthBelowPctDamaged(20, damage))
302 {
303 if (!_useExecute)
304 {
305 _useExecute = true;
306 events.ScheduleEvent(EVENT_EXECUTE, 1s);
307 }
308 }
309 else if (_useExecute)
310 {
311 _useExecute = false;
312 events.CancelEvent(EVENT_EXECUTE);
313 }
314 }
315 }
@ EVENT_EXECUTE
Definition boss_mandokir.cpp:67
events
Definition boss_sartura.cpp:43
Unit * GetVictim() const
Definition Unit.h:910
Creature * me
Definition ScriptedCreature.h:292
bool _useExecute
Definition boss_mandokir.cpp:499

References _useExecute, EVENT_EXECUTE, Unit::GetVictim(), Unit::HealthBelowPctDamaged(), and ScriptedAI::me.

◆ DoAction()

void boss_mandokir::boss_mandokirAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

233 {
234 if (action == ACTION_START_REVIVE)
235 {
236 std::list<Creature*> creatures;
238 if (creatures.empty())
239 return;
240
241 for (std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
242 {
243 if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, (*itr)->GetGUID()))
244 {
245 chainedSpirit->AI()->SetGUID(reviveGUID);
246 chainedSpirit->AI()->DoAction(ACTION_REVIVE);
248 }
249 }
250 }
251 }
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition ScriptedCreature.cpp:947
@ ACTION_START_REVIVE
Definition boss_mandokir.cpp:73
@ ACTION_REVIVE
Definition boss_mandokir.cpp:74
creatures
Definition boss_prince_malchezaar.cpp:51
Definition Creature.h:47
void Clear()
Definition ObjectGuid.h:141
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
ObjectGuid reviveGUID
Definition boss_mandokir.cpp:498
@ NPC_CHAINED_SPIRIT
Definition zulgurub.h:65

References ACTION_REVIVE, ACTION_START_REVIVE, ObjectGuid::Clear(), ObjectAccessor::GetCreature(), GetCreatureListWithEntryInGrid(), Object::GetGUID(), ScriptedAI::me, NPC_CHAINED_SPIRIT, and reviveGUID.

◆ DoMeleeAttackIfReady()

void boss_mandokir::boss_mandokirAI::DoMeleeAttackIfReady ( bool  ignoreCasting)
inline
324 {
325 if (!ignoreCasting && me->HasUnitState(UNIT_STATE_CASTING))
326 {
327 return;
328 }
329
330 Unit* victim = me->GetVictim();
331 if (!victim || !victim->IsInWorld())
332 return;
333
334 if (!me->IsWithinMeleeRange(victim))
335 return;
336
337 //Make sure our attack is ready and we aren't currently casting before checking distance
338 bool mainHandSwung = false;
339
340 if (me->isAttackReady())
341 {
342 me->AttackerStateUpdate(victim, BASE_ATTACK, false, ignoreCasting);
344
345 mainHandSwung = true;
346 }
347
348 if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK) && !mainHandSwung)
349 {
350 me->AttackerStateUpdate(victim, OFF_ATTACK, false, ignoreCasting);
352 }
353 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ OFF_ATTACK
Definition Unit.h:224
@ BASE_ATTACK
Definition Unit.h:223
bool IsInWorld() const
Definition Object.h:115
Definition Unit.h:670
bool haveOffhandWeapon() const
Definition Unit.cpp:648
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition Unit.cpp:790
bool HasUnitState(const uint32 f) const
Definition Unit.h:742
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
Definition Unit.cpp:2767
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition Unit.h:895
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition Unit.cpp:769

References Unit::AttackerStateUpdate(), BASE_ATTACK, Unit::GetVictim(), Unit::HasUnitState(), Unit::haveOffhandWeapon(), Unit::isAttackReady(), Object::IsInWorld(), Unit::IsWithinMeleeRange(), ScriptedAI::me, OFF_ATTACK, Unit::resetAttackTimer(), and UNIT_STATE_CASTING.

◆ JustDied()

void boss_mandokir::boss_mandokirAI::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

178 {
179 std::list<Creature*> chainedSpirits;
181 for (Creature* spirit : chainedSpirits)
182 spirit->DespawnOrUnsummon();
183
186 }
@ DONE
Definition InstanceScript.h:61
InstanceScript *const instance
Definition ScriptedCreature.h:503
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:406
void SaveToDB()
Definition InstanceScript.cpp:43

References DATA_MANDOKIR, DONE, GetCreatureListWithEntryInGrid(), BossAI::instance, ScriptedAI::me, NPC_CHAINED_SPIRIT, InstanceScript::SaveToDB(), and InstanceScript::SetBossState().

◆ JustEngagedWith()

void boss_mandokir::boss_mandokirAI::JustEngagedWith ( Unit *  )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

189 {
191 events.ScheduleEvent(EVENT_OVERPOWER, 1s);
192 events.ScheduleEvent(EVENT_MORTAL_STRIKE, 14s, 28s);
193 events.ScheduleEvent(EVENT_WHIRLWIND, 24s, 30s);
194 events.ScheduleEvent(EVENT_CHECK_OHGAN, 1s);
195 events.ScheduleEvent(EVENT_WATCH_PLAYER, 12s, 24s);
196 events.ScheduleEvent(EVENT_CHARGE_PLAYER, 30s, 40s);
197 events.ScheduleEvent(EVENT_CLEAVE, 1s);
200 me->Dismount();
201 // Summon Ohgan (Spell missing) TEMP HACK
203 for (int i = 0; i < CHAINED_SPIRIT_COUNT; ++i)
204 {
206 }
208 }
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:53
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:54
@ SAY_AGGRO
Definition boss_mandokir.cpp:30
@ CHAINED_SPIRIT_COUNT
Definition boss_mandokir.cpp:84
Position const PosSummonChainedSpirits[CHAINED_SPIRIT_COUNT]
Definition boss_mandokir.cpp:88
@ EVENT_OVERPOWER
Definition boss_mandokir.cpp:61
@ EVENT_WHIRLWIND
Definition boss_mandokir.cpp:63
@ EVENT_WATCH_PLAYER
Definition boss_mandokir.cpp:65
@ EVENT_CHARGE_PLAYER
Definition boss_mandokir.cpp:66
@ EVENT_CLEAVE
Definition boss_mandokir.cpp:68
@ EVENT_MORTAL_STRIKE
Definition boss_mandokir.cpp:62
@ EVENT_CHECK_OHGAN
Definition boss_mandokir.cpp:64
void _JustEngagedWith()
Definition ScriptedCreature.cpp:681
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition CreatureAI.cpp:117
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:347
void Dismount()
Definition Unit.cpp:10363
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:2460
Talk
Definition hyjal.cpp:82
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
@ NPC_OHGAN
Definition zulgurub.h:63

References BossAI::_JustEngagedWith(), CHAINED_SPIRIT_COUNT, Unit::Dismount(), CreatureAI::DoZoneInCombat(), EVENT_CHARGE_PLAYER, EVENT_CHECK_OHGAN, EVENT_CLEAVE, EVENT_MORTAL_STRIKE, EVENT_OVERPOWER, EVENT_WATCH_PLAYER, EVENT_WHIRLWIND, Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ScriptedAI::me, NPC_CHAINED_SPIRIT, NPC_OHGAN, PosSummonChainedSpirits, SAY_AGGRO, Creature::SetHomePosition(), WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_DESPAWN, and TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT.

◆ KilledUnit()

void boss_mandokir::boss_mandokirAI::KilledUnit ( Unit *  victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

211 {
212 if (!victim->IsPlayer())
213 return;
214
215 reviveGUID = victim->GetGUID();
216 RevivePlayer(victim, reviveGUID);
217 if (++killCount == 3)
218 {
221 {
222 if (jindo->IsAlive())
223 {
224 jindo->AI()->Talk(SAY_GRATS_JINDO);
225 }
226 }
228 killCount = 0;
229 }
230 }
@ SAY_GRATS_JINDO
Definition boss_mandokir.cpp:35
@ SAY_DING_KILL
Definition boss_mandokir.cpp:31
void RevivePlayer(Unit *victim, ObjectGuid &reviveGUID)
Definition boss_mandokir.cpp:118
@ SPELL_LEVEL_UP
Definition boss_mandokir.cpp:48
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:121
bool IsPlayer() const
Definition Object.h:207
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
uint8 killCount
Definition boss_mandokir.cpp:497
@ DATA_JINDO
Definition zulgurub.h:38

References DATA_JINDO, UnitAI::DoCastSelf(), ObjectAccessor::GetCreature(), Object::GetGUID(), InstanceScript::GetGuidData(), BossAI::instance, Object::IsPlayer(), killCount, ScriptedAI::me, reviveGUID, RevivePlayer(), SAY_DING_KILL, SAY_GRATS_JINDO, and SPELL_LEVEL_UP.

◆ MovementInform()

void boss_mandokir::boss_mandokirAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

273 {
274 if (type == WAYPOINT_MOTION_TYPE)
275 {
276 me->SetWalk(false);
277 if (id == POINT_MANDOKIR_END)
278 {
281 }
282 }
283 }
@ NOT_STARTED
Definition InstanceScript.h:58
@ WAYPOINT_MOTION_TYPE
Definition MotionMaster.h:41
Position const PosMandokir[2]
Definition boss_mandokir.cpp:112
@ POINT_MANDOKIR_END
Definition boss_mandokir.cpp:83
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3416

References DATA_MANDOKIR, BossAI::instance, ScriptedAI::me, NOT_STARTED, POINT_MANDOKIR_END, PosMandokir, InstanceScript::SetBossState(), Creature::SetHomePosition(), Creature::SetWalk(), and WAYPOINT_MOTION_TYPE.

◆ OnTeleportUnreacheablePlayer()

bool boss_mandokir::boss_mandokirAI::OnTeleportUnreacheablePlayer ( Player *  player)
inlineoverridevirtual

Reimplemented from CreatureAI.

318 {
319 DoCast(player, SPELL_SUMMON_PLAYER, true);
320 return true;
321 }
@ SPELL_SUMMON_PLAYER
Definition boss_mandokir.cpp:51
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:175

References UnitAI::DoCast(), and SPELL_SUMMON_PLAYER.

◆ Reset()

void boss_mandokir::boss_mandokirAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

154 {
156 killCount = 0;
157 if (me->GetPositionZ() > 140.0f)
158 {
159 events.ScheduleEvent(EVENT_CHECK_START, 1s);
161 {
162 if (!speaker->IsAlive())
163 {
164 speaker->Respawn(true);
165 }
166 }
167 }
169 me->SetImmuneToAll(false);
173 _useExecute = false;
174 _chargeTarget.first.Clear();
175 }
@ MODEL_OHGAN_MOUNT
Definition boss_mandokir.cpp:81
@ SPELL_FRENZY
Definition boss_mandokir.cpp:45
@ EVENT_CHECK_START
Definition boss_mandokir.cpp:59
void Reset() override
Definition ScriptedCreature.h:535
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:10303
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4969
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition Unit.h:938
@ NPC_VILEBRANCH_SPEAKER
Definition zulgurub.h:64
@ DATA_OHGAN
Definition zulgurub.h:43

References _chargeTarget, _useExecute, ObjectGuid::Clear(), DATA_OHGAN, EVENT_CHECK_START, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Position::GetPositionZ(), BossAI::instance, killCount, ScriptedAI::me, MODEL_OHGAN_MOUNT, Unit::Mount(), NOT_STARTED, NPC_VILEBRANCH_SPEAKER, Unit::RemoveAurasDueToSpell(), BossAI::Reset(), reviveGUID, InstanceScript::SetBossState(), Unit::SetImmuneToAll(), and SPELL_FRENZY.

◆ SetGUID()

void boss_mandokir::boss_mandokirAI::SetGUID ( ObjectGuid const &  guid,
int32  type 
)
inlineoverridevirtual

Reimplemented from UnitAI.

254 {
255 if (type == ACTION_CHARGE)
256 {
257 if (_chargeTarget.first == guid && _chargeTarget.second > 0.f)
258 {
259 if (Unit* target = ObjectAccessor::GetUnit(*me, _chargeTarget.first))
260 {
262 DoCast(target, SPELL_WATCH_CHARGE, true);
263 }
264 }
265 }
266 else
267 {
268 reviveGUID = guid;
269 }
270 }
@ ACTION_CHARGE
Definition boss_mandokir.cpp:85
@ SPELL_WATCH_CHARGE
Definition boss_mandokir.cpp:47
@ SPELL_WHIRLWIND
Definition boss_mandokir.cpp:43
Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:223

References _chargeTarget, ACTION_CHARGE, UnitAI::DoCast(), ObjectAccessor::GetUnit(), ScriptedAI::me, Unit::RemoveAurasDueToSpell(), reviveGUID, SPELL_WATCH_CHARGE, and SPELL_WHIRLWIND.

◆ UpdateAI()

void boss_mandokir::boss_mandokirAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

356 {
357 events.Update(diff);
358
359 if (!UpdateVictim())
360 {
362 {
363 while (uint32 eventId = events.ExecuteEvent())
364 {
365 switch (eventId)
366 {
369 {
370 me->GetMotionMaster()->MovePoint(0, PosMandokir[1].m_positionX, PosMandokir[1].m_positionY, PosMandokir[1].m_positionZ);
371 events.ScheduleEvent(EVENT_STARTED, 6s);
372 }
373 else
374 {
375 events.ScheduleEvent(EVENT_CHECK_START, 1s);
376 }
377 break;
378 case EVENT_STARTED:
379 me->SetImmuneToAll(false);
381 break;
382 default:
383 break;
384 }
385 }
386 }
387 return;
388 }
389
391 {
393 {
395 }
396
397 return;
398 }
399
400 while (uint32 eventId = events.ExecuteEvent())
401 {
402 switch (eventId)
403 {
404 case EVENT_OVERPOWER:
406 {
407 events.ScheduleEvent(EVENT_OVERPOWER, 6s, 8s);
408 }
409 else
410 {
411 events.ScheduleEvent(EVENT_OVERPOWER, 1s);
412 }
413 break;
416 events.ScheduleEvent(EVENT_MORTAL_STRIKE, 14s, 28s);
417 break;
418 case EVENT_WHIRLWIND:
420 events.ScheduleEvent(EVENT_WHIRLWIND, 22s, 26s);
421 break;
424 {
427 }
428 else
429 {
430 events.ScheduleEvent(EVENT_CHECK_OHGAN, 1s);
431 }
432 break;
434 if (Unit* player = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
435 {
436 DoCast(player, SPELL_WATCH);
437 Talk(SAY_WATCH, player);
438 _chargeTarget = std::make_pair(player->GetGUID(), 0.f);
439 }
440 events.ScheduleEvent(EVENT_WATCH_PLAYER, 12s, 24s);
441 break;
443 if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, [this](Unit const* target)
444 {
445 if (!me || !target)
446 return false;
447 if (!target->IsPlayer() || !me->IsWithinLOSInMap(target))
448 return false;
449 return true;
450 }))
451 {
452 DoCast(target, SPELL_CHARGE);
453 events.DelayEvents(1500ms);
454 if (Unit* mainTarget = SelectTarget(SelectTargetMethod::MaxThreat, 0, 100.0f))
455 {
456 me->GetThreatMgr().ModifyThreatByPercent(mainTarget, -100);
457 }
458 }
459 events.ScheduleEvent(EVENT_CHARGE_PLAYER, 30s, 40s);
460 break;
461 case EVENT_EXECUTE:
463 events.ScheduleEvent(EVENT_EXECUTE, 7s, 14s);
464 break;
465 case EVENT_CLEAVE:
466 {
467 std::list<Unit*> meleeRangeTargets;
468 auto i = me->GetThreatMgr().GetUnsortedThreatList().begin();
469 for (; i != me->GetThreatMgr().GetUnsortedThreatList().end(); ++i)
470 {
471 Unit* target = (*i)->GetVictim();
472 if (me->IsWithinMeleeRange(target))
473 {
474 meleeRangeTargets.push_back(target);
475 }
476 }
477 if (meleeRangeTargets.size() >= 5)
478 {
480 events.ScheduleEvent(EVENT_CLEAVE, 10s, 20s);
481 }
482 else
483 {
484 events.ScheduleEvent(EVENT_CLEAVE, 1s);
485 }
486 break;
487 }
488 default:
489 break;
490 }
491 }
492
494 }
std::uint32_t uint32
Definition Define.h:107
@ SPECIAL
Definition InstanceScript.h:62
@ SPELL_CAST_OK
Definition SharedDefines.h:1126
@ UNIT_STATE_CHARGING
Definition UnitDefines.h:190
@ SAY_WATCH
Definition boss_mandokir.cpp:32
@ SAY_OHGAN_DEAD
Definition boss_mandokir.cpp:34
@ SPELL_EXECUTE
Definition boss_mandokir.cpp:49
@ SPELL_CHARGE
Definition boss_mandokir.cpp:40
@ SPELL_MORTAL_STRIKE
Definition boss_mandokir.cpp:44
@ SPELL_OVERPOWER
Definition boss_mandokir.cpp:41
@ SPELL_MANDOKIR_CLEAVE
Definition boss_mandokir.cpp:50
@ SPELL_WATCH
Definition boss_mandokir.cpp:46
@ EVENT_STARTED
Definition boss_mandokir.cpp:60
bool UpdateVictim()
Definition CreatureAI.cpp:350
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2887
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
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:241
Acore::IteratorPair< ThreatListIterator > GetUnsortedThreatList() const
Definition ThreatManager.cpp:334
void ModifyThreatByPercent(Unit *target, int32 percent)
Definition ThreatManager.h:150
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:274
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:108
MotionMaster * GetMotionMaster()
Definition Unit.h:1774
ThreatManager & GetThreatMgr()
Definition Unit.h:965
int32 GetCurrentSpellCastTime(uint32 spell_id) const
Definition Unit.cpp:4111
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition Object.cpp:1412

References _chargeTarget, DATA_MANDOKIR, DATA_OHGAN, UnitAI::DoCast(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), DONE, EVENT_CHARGE_PLAYER, EVENT_CHECK_OHGAN, EVENT_CHECK_START, EVENT_CLEAVE, EVENT_EXECUTE, EVENT_MORTAL_STRIKE, EVENT_OVERPOWER, EVENT_STARTED, EVENT_WATCH_PLAYER, EVENT_WHIRLWIND, InstanceScript::GetBossState(), Unit::GetCurrentSpellCastTime(), Unit::GetMotionMaster(), Unit::GetThreatMgr(), ThreatManager::GetUnsortedThreatList(), Unit::GetVictim(), Unit::HasUnitState(), BossAI::instance, Object::IsPlayer(), WorldObject::IsWithinLOSInMap(), Unit::IsWithinMeleeRange(), MaxThreat, ScriptedAI::me, MinDistance, ThreatManager::ModifyThreatByPercent(), MotionMaster::MovePoint(), NOT_STARTED, PosMandokir, Random, SAY_OHGAN_DEAD, SAY_WATCH, UnitAI::SelectTarget(), Unit::SetImmuneToAll(), Creature::SetInCombatWithZone(), SPECIAL, SPELL_CAST_OK, SPELL_CHARGE, SPELL_EXECUTE, SPELL_FRENZY, SPELL_MANDOKIR_CLEAVE, SPELL_MORTAL_STRIKE, SPELL_OVERPOWER, SPELL_WATCH, SPELL_WHIRLWIND, UNIT_STATE_CASTING, UNIT_STATE_CHARGING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _chargeTarget

std::pair<ObjectGuid, float> boss_mandokir::boss_mandokirAI::_chargeTarget
private

◆ _useExecute

bool boss_mandokir::boss_mandokirAI::_useExecute
private

Referenced by DamageDealt(), and Reset().

◆ killCount

uint8 boss_mandokir::boss_mandokirAI::killCount
private

Referenced by KilledUnit(), and Reset().

◆ reviveGUID

ObjectGuid boss_mandokir::boss_mandokirAI::reviveGUID
private

Referenced by DoAction(), KilledUnit(), Reset(), and SetGUID().


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