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.
 
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) override
 
bool OnTeleportUnreacheablePlayer (Player *player) override
 
void DoMeleeAttackIfReady (bool ignoreCasting)
 
void UpdateAI (uint32 diff) 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.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
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 IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
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 OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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

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
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
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_mandokirAI()

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

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:180
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
std::pair< ObjectGuid, float > _chargeTarget
Definition: boss_mandokir.cpp:505

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 doneTo,
uint32 damage,
DamageEffectType   
)
inlineoverridevirtual

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
Creature * me
Definition: ScriptedCreature.h:282
Unit * GetVictim() const
Definition: Unit.h:1398
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1459
bool _useExecute
Definition: boss_mandokir.cpp:504

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:818
creatures
Definition: boss_prince_malchezaar.cpp:51
@ ACTION_START_REVIVE
Definition: boss_mandokir.cpp:73
@ ACTION_REVIVE
Definition: boss_mandokir.cpp:74
@ NPC_CHAINED_SPIRIT
Definition: zulgurub.h:65
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
Definition: Creature.h:46
void Clear()
Definition: ObjectGuid.h:140
ObjectGuid reviveGUID
Definition: boss_mandokir.cpp:503

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 if (me->isAttackReady())
339 {
340 // xinef: prevent base and off attack in same time, delay attack at 0.2 sec
341 if (me->haveOffhandWeapon())
344
345 me->AttackerStateUpdate(victim, BASE_ATTACK, false, ignoreCasting);
347 }
348
350 {
351 // xinef: delay main hand attack if both will hit at the same time (players code)
354
355 me->AttackerStateUpdate(victim, OFF_ATTACK, false, ignoreCasting);
357 }
358 }
@ OFF_ATTACK
Definition: Unit.h:397
@ BASE_ATTACK
Definition: Unit.h:396
#define ATTACK_DISPLAY_DELAY
Definition: Unit.h:1250
@ UNIT_STATE_CASTING
Definition: Unit.h:340
bool IsInWorld() const
Definition: Object.h:101
Definition: Unit.h:1302
bool haveOffhandWeapon() const
Definition: Unit.cpp:540
void setAttackTimer(WeaponAttackType type, int32 time)
Definition: Unit.h:1352
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:683
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
Definition: Unit.cpp:2537
int32 getAttackTimer(WeaponAttackType type) const
Definition: Unit.h:1354
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:1355
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition: Unit.cpp:661

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

◆ JustDied()

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

Reimplemented from BossAI.

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

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.

Reimplemented from BossAI.

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:45
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: Object.h:46
@ 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
@ NPC_OHGAN
Definition: zulgurub.h:63
Talk
Definition: boss_fathomlord_karathress.cpp:25
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:94
void _JustEngagedWith()
Definition: ScriptedCreature.cpp:633
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:330
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:2343
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 Dismount()
Definition: Unit.cpp:13518

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

211 {
212 if (victim->GetTypeId() != TYPEID_PLAYER)
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 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ 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
@ DATA_JINDO
Definition: zulgurub.h:38
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:379
TypeID GetTypeId() const
Definition: Object.h:121
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
uint8 killCount
Definition: boss_mandokir.cpp:502

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

◆ MovementInform()

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

Reimplemented from ScriptedAI.

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:57
@ WAYPOINT_MOTION_TYPE
Definition: MotionMaster.h:39
Position const PosMandokir[2]
Definition: boss_mandokir.cpp:112
@ POINT_MANDOKIR_END
Definition: boss_mandokir.cpp:83
bool SetWalk(bool enable) override
Definition: Creature.cpp:3098

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:177

References UnitAI::DoCast(), and SPELL_SUMMON_PLAYER.

◆ Reset()

void boss_mandokir::boss_mandokirAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

154 {
156 killCount = 0;
157 if (me->GetPositionZ() > 140.0f)
158 {
159 events.ScheduleEvent(EVENT_CHECK_START, 1000);
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
@ NPC_VILEBRANCH_SPEAKER
Definition: zulgurub.h:64
@ DATA_OHGAN
Definition: zulgurub.h:43
void Reset() override
Definition: ScriptedCreature.h:496
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition: Unit.cpp:13459
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4855
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:1692

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:202

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  diff)
inlineoverridevirtual

Reimplemented from BossAI.

361 {
362 events.Update(diff);
363
364 if (!UpdateVictim())
365 {
367 {
368 while (uint32 eventId = events.ExecuteEvent())
369 {
370 switch (eventId)
371 {
374 {
375 me->GetMotionMaster()->MovePoint(0, PosMandokir[1].m_positionX, PosMandokir[1].m_positionY, PosMandokir[1].m_positionZ);
376 events.ScheduleEvent(EVENT_STARTED, 6s);
377 }
378 else
379 {
380 events.ScheduleEvent(EVENT_CHECK_START, 1s);
381 }
382 break;
383 case EVENT_STARTED:
384 me->SetImmuneToAll(false);
386 break;
387 default:
388 break;
389 }
390 }
391 }
392 return;
393 }
394
396 {
398 {
400 }
401
402 return;
403 }
404
405 while (uint32 eventId = events.ExecuteEvent())
406 {
407 switch (eventId)
408 {
409 case EVENT_OVERPOWER:
411 {
412 events.ScheduleEvent(EVENT_OVERPOWER, 6s, 8s);
413 }
414 else
415 {
416 events.ScheduleEvent(EVENT_OVERPOWER, 1s);
417 }
418 break;
421 events.ScheduleEvent(EVENT_MORTAL_STRIKE, 14s, 28s);
422 break;
423 case EVENT_WHIRLWIND:
425 events.ScheduleEvent(EVENT_WHIRLWIND, 22s, 26s);
426 break;
429 {
432 }
433 else
434 {
435 events.ScheduleEvent(EVENT_CHECK_OHGAN, 1s);
436 }
437 break;
439 if (Unit* player = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
440 {
441 DoCast(player, SPELL_WATCH);
442 Talk(SAY_WATCH, player);
443 _chargeTarget = std::make_pair(player->GetGUID(), 0.f);
444 }
445 events.ScheduleEvent(EVENT_WATCH_PLAYER, 12s, 24s);
446 break;
448 if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, [this](Unit const* target)
449 {
450 if (!me || !target)
451 return false;
452 if (target->GetTypeId() != TYPEID_PLAYER || !me->IsWithinLOSInMap(target))
453 return false;
454 return true;
455 }))
456 {
457 DoCast(target, SPELL_CHARGE);
458 events.DelayEvents(1500ms);
459 if (Unit* mainTarget = SelectTarget(SelectTargetMethod::MaxThreat, 0, 100.0f))
460 {
461 me->GetThreatMgr().ModifyThreatByPercent(mainTarget, -100);
462 }
463 }
464 events.ScheduleEvent(EVENT_CHARGE_PLAYER, 30s, 40s);
465 break;
466 case EVENT_EXECUTE:
468 events.ScheduleEvent(EVENT_EXECUTE, 7s, 14s);
469 break;
470 case EVENT_CLEAVE:
471 {
472 std::list<Unit*> meleeRangeTargets;
473 auto i = me->GetThreatMgr().GetThreatList().begin();
474 for (; i != me->GetThreatMgr().GetThreatList().end(); ++i)
475 {
476 Unit* target = (*i)->getTarget();
477 if (me->IsWithinMeleeRange(target))
478 {
479 meleeRangeTargets.push_back(target);
480 }
481 }
482 if (meleeRangeTargets.size() >= 5)
483 {
485 events.ScheduleEvent(EVENT_CLEAVE, 10s, 20s);
486 }
487 else
488 {
489 events.ScheduleEvent(EVENT_CLEAVE, 1s);
490 }
491 break;
492 }
493 default:
494 break;
495 }
496 }
497
499 }
std::uint32_t uint32
Definition: Define.h:108
@ UNIT_STATE_CHARGING
Definition: Unit.h:342
@ SPECIAL
Definition: InstanceScript.h:61
@ 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
@ SPELL_CAST_OK
Definition: SharedDefines.h:1138
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition: ThreatMgr.cpp:508
ThreatContainer::StorageType const & GetThreatList() const
Definition: ThreatMgr.h:274
void SetInCombatWithZone()
Definition: Creature.cpp:2732
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:1347
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2159
int32 GetCurrentSpellCastTime(uint32 spell_id) const
Definition: Unit.cpp:4104
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:231
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211

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(), ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), Object::GetTypeId(), Unit::HasUnitState(), BossAI::instance, WorldObject::IsWithinLOSInMap(), Unit::IsWithinMeleeRange(), ScriptedAI::me, ThreatMgr::ModifyThreatByPercent(), MotionMaster::MovePoint(), NOT_STARTED, PosMandokir, 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, TYPEID_PLAYER, 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().