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

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

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

Member Function Documentation

◆ CalculateThreat()

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

Reimplemented from CreatureAI.

285 {
286 if (_chargeTarget.first == hatedUnit->GetGUID())
287 {
288 // Do not count DOTs/HOTs
289 if (!(threatSpell && (threatSpell->HasAura(SPELL_AURA_DAMAGE_SHIELD) || threatSpell->HasAttribute(SPELL_ATTR0_CU_NO_INITIAL_THREAT))))
290 {
291 _chargeTarget.second += threat;
292 }
293 }
294 }
@ 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:504

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.

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

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

◆ DoAction()

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

Reimplemented from UnitAI.

232 {
233 if (action == ACTION_START_REVIVE)
234 {
235 std::list<Creature*> creatures;
237 if (creatures.empty())
238 return;
239
240 for (std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
241 {
242 if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, (*itr)->GetGUID()))
243 {
244 chainedSpirit->AI()->SetGUID(reviveGUID);
245 chainedSpirit->AI()->DoAction(ACTION_REVIVE);
247 }
248 }
249 }
250 }
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:775
creatures
Definition: boss_prince_malchezaar.cpp:49
@ ACTION_START_REVIVE
Definition: boss_mandokir.cpp:72
@ ACTION_REVIVE
Definition: boss_mandokir.cpp:73
@ NPC_CHAINED_SPIRIT
Definition: zulgurub.h:64
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
Definition: Creature.h:46
void Clear()
Definition: ObjectGuid.h:140
ObjectGuid reviveGUID
Definition: boss_mandokir.cpp:502

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
323 {
324 if (!ignoreCasting && me->HasUnitState(UNIT_STATE_CASTING))
325 {
326 return;
327 }
328
329 Unit* victim = me->GetVictim();
330 if (!victim || !victim->IsInWorld())
331 return;
332
333 if (!me->IsWithinMeleeRange(victim))
334 return;
335
336 //Make sure our attack is ready and we aren't currently casting before checking distance
337 if (me->isAttackReady())
338 {
339 // xinef: prevent base and off attack in same time, delay attack at 0.2 sec
340 if (me->haveOffhandWeapon())
343
344 me->AttackerStateUpdate(victim, BASE_ATTACK, false, ignoreCasting);
346 }
347
349 {
350 // xinef: delay main hand attack if both will hit at the same time (players code)
353
354 me->AttackerStateUpdate(victim, OFF_ATTACK, false, ignoreCasting);
356 }
357 }
@ OFF_ATTACK
Definition: Unit.h:397
@ BASE_ATTACK
Definition: Unit.h:396
#define ATTACK_DISPLAY_DELAY
Definition: Unit.h:1238
@ UNIT_STATE_CASTING
Definition: Unit.h:340
bool IsInWorld() const
Definition: Object.h:101
Definition: Unit.h:1290
bool haveOffhandWeapon() const
Definition: Unit.cpp:540
void setAttackTimer(WeaponAttackType type, int32 time)
Definition: Unit.h:1340
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:683
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
Definition: Unit.cpp:2527
int32 getAttackTimer(WeaponAttackType type) const
Definition: Unit.h:1342
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:1343
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.

177 {
178 std::list<Creature*> chainedSpirits;
180 for (Creature* spirit : chainedSpirits)
181 spirit->DespawnOrUnsummon();
182
185 }
@ DONE
Definition: InstanceScript.h:59
InstanceScript *const instance
Definition: ScriptedCreature.h:461
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:317
void SaveToDB()
Definition: InstanceScript.cpp:41

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.

188 {
190 events.ScheduleEvent(EVENT_OVERPOWER, 1s);
191 events.ScheduleEvent(EVENT_MORTAL_STRIKE, 14s, 28s);
192 events.ScheduleEvent(EVENT_WHIRLWIND, 24s, 30s);
193 events.ScheduleEvent(EVENT_CHECK_OHGAN, 1s);
194 events.ScheduleEvent(EVENT_WATCH_PLAYER, 12s, 24s);
195 events.ScheduleEvent(EVENT_CHARGE_PLAYER, 30s, 40s);
196 events.ScheduleEvent(EVENT_CLEAVE, 1s);
199 me->Dismount();
200 // Summon Ohgan (Spell missing) TEMP HACK
202 for (int i = 0; i < CHAINED_SPIRIT_COUNT; ++i)
203 {
205 }
207 }
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: Object.h:45
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: Object.h:46
@ SAY_AGGRO
Definition: boss_mandokir.cpp:29
@ CHAINED_SPIRIT_COUNT
Definition: boss_mandokir.cpp:83
Position const PosSummonChainedSpirits[CHAINED_SPIRIT_COUNT]
Definition: boss_mandokir.cpp:87
@ EVENT_OVERPOWER
Definition: boss_mandokir.cpp:60
@ EVENT_WHIRLWIND
Definition: boss_mandokir.cpp:62
@ EVENT_WATCH_PLAYER
Definition: boss_mandokir.cpp:64
@ EVENT_CHARGE_PLAYER
Definition: boss_mandokir.cpp:65
@ EVENT_CLEAVE
Definition: boss_mandokir.cpp:67
@ EVENT_MORTAL_STRIKE
Definition: boss_mandokir.cpp:61
@ EVENT_CHECK_OHGAN
Definition: boss_mandokir.cpp:63
@ NPC_OHGAN
Definition: zulgurub.h:62
Talk
Definition: boss_fathomlord_karathress.cpp:23
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95
void _JustEngagedWith()
Definition: ScriptedCreature.cpp:598
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:328
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
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:13435

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.

210 {
211 if (victim->GetTypeId() != TYPEID_PLAYER)
212 return;
213
214 reviveGUID = victim->GetGUID();
215 RevivePlayer(victim, reviveGUID);
216 if (++killCount == 3)
217 {
220 {
221 if (jindo->IsAlive())
222 {
223 jindo->AI()->Talk(SAY_GRATS_JINDO);
224 }
225 }
227 killCount = 0;
228 }
229 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ SAY_GRATS_JINDO
Definition: boss_mandokir.cpp:34
@ SAY_DING_KILL
Definition: boss_mandokir.cpp:30
void RevivePlayer(Unit *victim, ObjectGuid &reviveGUID)
Definition: boss_mandokir.cpp:117
@ SPELL_LEVEL_UP
Definition: boss_mandokir.cpp:47
@ DATA_JINDO
Definition: zulgurub.h:38
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:369
TypeID GetTypeId() const
Definition: Object.h:121
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
uint8 killCount
Definition: boss_mandokir.cpp:501

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.

272 {
273 if (type == WAYPOINT_MOTION_TYPE)
274 {
275 me->SetWalk(false);
276 if (id == POINT_MANDOKIR_END)
277 {
280 }
281 }
282 }
@ NOT_STARTED
Definition: InstanceScript.h:56
@ WAYPOINT_MOTION_TYPE
Definition: MotionMaster.h:39
Position const PosMandokir[2]
Definition: boss_mandokir.cpp:111
@ POINT_MANDOKIR_END
Definition: boss_mandokir.cpp:82
bool SetWalk(bool enable) override
Definition: Creature.cpp:3081

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.

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

References UnitAI::DoCast(), and SPELL_SUMMON_PLAYER.

◆ Reset()

void boss_mandokir::boss_mandokirAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

153 {
155 killCount = 0;
156 if (me->GetPositionZ() > 140.0f)
157 {
158 events.ScheduleEvent(EVENT_CHECK_START, 1000);
160 {
161 if (!speaker->IsAlive())
162 {
163 speaker->Respawn(true);
164 }
165 }
166 }
168 me->SetImmuneToAll(false);
172 _useExecute = false;
173 _chargeTarget.first.Clear();
174 }
@ MODEL_OHGAN_MOUNT
Definition: boss_mandokir.cpp:80
@ SPELL_FRENZY
Definition: boss_mandokir.cpp:44
@ EVENT_CHECK_START
Definition: boss_mandokir.cpp:58
@ NPC_VILEBRANCH_SPEAKER
Definition: zulgurub.h:63
@ DATA_OHGAN
Definition: zulgurub.h:43
void Reset() override
Definition: ScriptedCreature.h:482
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition: Unit.cpp:13376
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4835
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:1678

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.

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

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.

360 {
361 events.Update(diff);
362
363 if (!UpdateVictim())
364 {
366 {
367 while (uint32 eventId = events.ExecuteEvent())
368 {
369 switch (eventId)
370 {
373 {
374 me->GetMotionMaster()->MovePoint(0, PosMandokir[1].m_positionX, PosMandokir[1].m_positionY, PosMandokir[1].m_positionZ);
375 events.ScheduleEvent(EVENT_STARTED, 6s);
376 }
377 else
378 {
379 events.ScheduleEvent(EVENT_CHECK_START, 1s);
380 }
381 break;
382 case EVENT_STARTED:
383 me->SetImmuneToAll(false);
385 break;
386 default:
387 break;
388 }
389 }
390 }
391 return;
392 }
393
395 {
397 {
399 }
400
401 return;
402 }
403
404 while (uint32 eventId = events.ExecuteEvent())
405 {
406 switch (eventId)
407 {
408 case EVENT_OVERPOWER:
410 {
411 events.ScheduleEvent(EVENT_OVERPOWER, 6s, 8s);
412 }
413 else
414 {
415 events.ScheduleEvent(EVENT_OVERPOWER, 1s);
416 }
417 break;
420 events.ScheduleEvent(EVENT_MORTAL_STRIKE, 14s, 28s);
421 break;
422 case EVENT_WHIRLWIND:
424 events.ScheduleEvent(EVENT_WHIRLWIND, 22s, 26s);
425 break;
428 {
431 }
432 else
433 {
434 events.ScheduleEvent(EVENT_CHECK_OHGAN, 1s);
435 }
436 break;
438 if (Unit* player = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
439 {
440 DoCast(player, SPELL_WATCH);
441 Talk(SAY_WATCH, player);
442 _chargeTarget = std::make_pair(player->GetGUID(), 0.f);
443 }
444 events.ScheduleEvent(EVENT_WATCH_PLAYER, 12s, 24s);
445 break;
447 if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, [this](Unit const* target)
448 {
449 if (!me || !target)
450 return false;
451 if (target->GetTypeId() != TYPEID_PLAYER || !me->IsWithinLOSInMap(target))
452 return false;
453 return true;
454 }))
455 {
456 DoCast(target, SPELL_CHARGE);
457 events.DelayEvents(1500ms);
458 if (Unit* mainTarget = SelectTarget(SelectTargetMethod::MaxThreat, 0, 100.0f))
459 {
460 me->GetThreatMgr().ModifyThreatByPercent(mainTarget, -100);
461 }
462 }
463 events.ScheduleEvent(EVENT_CHARGE_PLAYER, 30s, 40s);
464 break;
465 case EVENT_EXECUTE:
467 events.ScheduleEvent(EVENT_EXECUTE, 7s, 14s);
468 break;
469 case EVENT_CLEAVE:
470 {
471 std::list<Unit*> meleeRangeTargets;
472 auto i = me->GetThreatMgr().GetThreatList().begin();
473 for (; i != me->GetThreatMgr().GetThreatList().end(); ++i)
474 {
475 Unit* target = (*i)->getTarget();
476 if (me->IsWithinMeleeRange(target))
477 {
478 meleeRangeTargets.push_back(target);
479 }
480 }
481 if (meleeRangeTargets.size() >= 5)
482 {
484 events.ScheduleEvent(EVENT_CLEAVE, 10s, 20s);
485 }
486 else
487 {
488 events.ScheduleEvent(EVENT_CLEAVE, 1s);
489 }
490 break;
491 }
492 default:
493 break;
494 }
495 }
496
498 }
std::uint32_t uint32
Definition: Define.h:108
@ UNIT_STATE_CHARGING
Definition: Unit.h:342
@ SPECIAL
Definition: InstanceScript.h:60
@ SAY_WATCH
Definition: boss_mandokir.cpp:31
@ SAY_OHGAN_DEAD
Definition: boss_mandokir.cpp:33
@ SPELL_EXECUTE
Definition: boss_mandokir.cpp:48
@ SPELL_CHARGE
Definition: boss_mandokir.cpp:39
@ SPELL_MORTAL_STRIKE
Definition: boss_mandokir.cpp:43
@ SPELL_OVERPOWER
Definition: boss_mandokir.cpp:40
@ SPELL_MANDOKIR_CLEAVE
Definition: boss_mandokir.cpp:49
@ SPELL_WATCH
Definition: boss_mandokir.cpp:45
@ EVENT_STARTED
Definition: boss_mandokir.cpp:59
@ SPELL_CAST_OK
Definition: SharedDefines.h:1110
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:241
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition: ThreatMgr.cpp:509
ThreatContainer::StorageType const & GetThreatList() const
Definition: ThreatMgr.h:274
void SetInCombatWithZone()
Definition: Creature.cpp:2723
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:2262
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2145
int32 GetCurrentSpellCastTime(uint32 spell_id) const
Definition: Unit.cpp:4092
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:230
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210

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