AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_grand_champion::boss_grand_championAI Struct Reference
Inheritance diagram for boss_grand_champion::boss_grand_championAI:
npc_escortAI ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_grand_championAI (Creature *pCreature)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void ScheduleAbilitiesEvents ()
 
void AddCreatureAddonAuras ()
 
void DoAction (int32 param) override
 
void SetData (uint32 uiType, uint32 uiData) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
void EnterEvadeMode (EvadeReason) override
 
void WaypointReached (uint32 i) override
 
void MovementInform (uint32 type, uint32 id) override
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void UpdateEscortAI (uint32 diff)
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointReached (uint32 pointId)=0
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
- 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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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 DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=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)
 
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
 
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=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
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. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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)
 Cast the spell on a random unit from the threat list. More...
 
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. More...
 
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. More...
 
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
 

Public Attributes

InstanceScriptpInstance
 
EventMap events
 
uint32 BossOrder
 
bool MountPhase
 
ObjectGuid NewMountGUID
 
ObjectGuid UnitTargetGUID
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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 ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from npc_escortAI
PlayerGetPlayerForEscort ()
 
- 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 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_grand_championAI()

boss_grand_champion::boss_grand_championAI::boss_grand_championAI ( Creature pCreature)
inline
358 : npc_escortAI(pCreature)
359 {
360 pInstance = pCreature->GetInstanceScript();
361 MountPhase = true;
362 SetDespawnAtEnd(false);
364 BossOrder = 0;
367
368 events.Reset();
369 events.ScheduleEvent(EVENT_MOUNT_CHARGE, 2500ms, 4000ms);
370 events.ScheduleEvent(EVENT_SHIELD_BREAKER, 5s, 8s);
371 events.ScheduleEvent(EVENT_THRUST, 3s, 5s);
372
391 }
events
Definition: boss_sartura.cpp:43
@ SPELL_BOSS_DEFEND_PERIODIC
Definition: boss_grand_champions.cpp:35
@ EVENT_THRUST
Definition: boss_grand_champions.cpp:115
@ EVENT_SHIELD_BREAKER
Definition: boss_grand_champions.cpp:114
@ EVENT_MOUNT_CHARGE
Definition: boss_grand_champions.cpp:113
@ MECHANIC_FEAR
Definition: SharedDefines.h:1330
@ MECHANIC_DISORIENTED
Definition: SharedDefines.h:1327
@ MECHANIC_KNOCKOUT
Definition: SharedDefines.h:1339
@ MECHANIC_CHARM
Definition: SharedDefines.h:1326
@ MECHANIC_TURN
Definition: SharedDefines.h:1348
@ MECHANIC_FREEZE
Definition: SharedDefines.h:1338
@ MECHANIC_INTERRUPT
Definition: SharedDefines.h:1351
@ MECHANIC_ROOT
Definition: SharedDefines.h:1332
@ MECHANIC_GRIP
Definition: SharedDefines.h:1331
@ MECHANIC_SLEEP
Definition: SharedDefines.h:1335
@ MECHANIC_POLYMORPH
Definition: SharedDefines.h:1342
@ MECHANIC_BANISH
Definition: SharedDefines.h:1343
@ MECHANIC_DAZE
Definition: SharedDefines.h:1352
@ MECHANIC_SNARE
Definition: SharedDefines.h:1336
@ MECHANIC_SHACKLE
Definition: SharedDefines.h:1345
@ MECHANIC_SAPPED
Definition: SharedDefines.h:1355
@ MECHANIC_DISTRACT
Definition: SharedDefines.h:1329
@ MECHANIC_HORROR
Definition: SharedDefines.h:1349
@ IMMUNITY_MECHANIC
Definition: SharedDefines.h:1399
@ REACT_PASSIVE
Definition: Unit.h:548
Creature * me
Definition: ScriptedCreature.h:280
Definition: ScriptedEscortAI.h:53
void SetDespawnAtEnd(bool despawn)
Definition: ScriptedEscortAI.h:104
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
void Clear()
Definition: ObjectGuid.h:138
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13389
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1167
ObjectGuid NewMountGUID
Definition: boss_grand_champions.cpp:397
bool MountPhase
Definition: boss_grand_champions.cpp:396
uint32 BossOrder
Definition: boss_grand_champions.cpp:395
InstanceScript * pInstance
Definition: boss_grand_champions.cpp:393

References Unit::ApplySpellImmune(), BossOrder, Unit::CastSpell(), ObjectGuid::Clear(), EVENT_MOUNT_CHARGE, EVENT_SHIELD_BREAKER, EVENT_THRUST, WorldObject::GetInstanceScript(), IMMUNITY_MECHANIC, ScriptedAI::me, MECHANIC_BANISH, MECHANIC_CHARM, MECHANIC_DAZE, MECHANIC_DISORIENTED, MECHANIC_DISTRACT, MECHANIC_FEAR, MECHANIC_FREEZE, MECHANIC_GRIP, MECHANIC_HORROR, MECHANIC_INTERRUPT, MECHANIC_KNOCKOUT, MECHANIC_POLYMORPH, MECHANIC_ROOT, MECHANIC_SAPPED, MECHANIC_SHACKLE, MECHANIC_SLEEP, MECHANIC_SNARE, MECHANIC_TURN, MountPhase, NewMountGUID, pInstance, REACT_PASSIVE, npc_escortAI::SetDespawnAtEnd(), Creature::SetReactState(), and SPELL_BOSS_DEFEND_PERIODIC.

Member Function Documentation

◆ AddCreatureAddonAuras()

void boss_grand_champion::boss_grand_championAI::AddCreatureAddonAuras ( )
inline
462 {
463 CreatureAddon const* cainfo = me->GetCreatureAddon();
464 if (!cainfo)
465 return;
466
467 if (!cainfo->auras.empty())
468 {
469 for (std::vector<uint32>::const_iterator itr = cainfo->auras.begin(); itr != cainfo->auras.end(); ++itr)
470 {
471 SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
472 if (!AdditionalSpellInfo)
473 continue;
474
475 if (me->HasAura(AdditionalSpellInfo->Id))
476 continue;
477
478 me->AddAura(AdditionalSpellInfo->Id, me);
479 }
480 }
481 }
#define sSpellMgr
Definition: SpellMgr.h:825
CreatureAddon const * GetCreatureAddon() const
Definition: Creature.cpp:2697
Definition: CreatureData.h:440
std::vector< uint32 > auras
Definition: CreatureData.h:446
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18863
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698
Definition: SpellInfo.h:316
uint32 Id
Definition: SpellInfo.h:320

References Unit::AddAura(), CreatureAddon::auras, Creature::GetCreatureAddon(), Unit::HasAura(), SpellInfo::Id, ScriptedAI::me, and sSpellMgr.

Referenced by DamageTaken(), and DoAction().

◆ DamageTaken()

void boss_grand_champion::boss_grand_championAI::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from ScriptedAI.

544 {
545 if (MountPhase)
546 {
548 damage = 0;
549 else if (damage >= me->GetHealth())
550 {
551 events.Reset();
552 damage = me->GetHealth() - 1;
557 me->CombatStop(true);
559 me->StopMoving();
563 me->SetImmuneToAll(true);
565 if (pInstance)
566 {
569 {
570 NewMountGUID = mount->GetGUID();
571 me->GetMotionMaster()->MovePoint(7, *mount);
572 events.RescheduleEvent(EVENT_FIND_NEW_MOUNT, 1s);
573 }
574 }
575 }
576 }
577 else
578 {
579 if (damage >= me->GetHealth())
580 {
581 MountPhase = true;
582 events.Reset();
583 damage = me->GetHealth() - 1;
588 me->CombatStop(true);
592 me->SetImmuneToAll(true);
593 if (pInstance)
595 }
596 }
597 }
@ EVENT_FIND_NEW_MOUNT
Definition: boss_grand_champions.cpp:116
@ DATA_GRAND_CHAMPION_DIED
Definition: trial_of_the_champion.h:41
@ DATA_TEAMID_IN_INSTANCE
Definition: trial_of_the_champion.h:44
@ DATA_MOUNT_DIED
Definition: trial_of_the_champion.h:38
@ VEHICLE_ARGENT_BATTLEWORG
Definition: trial_of_the_champion.h:187
@ VEHICLE_ARGENT_WARHORSE
Definition: trial_of_the_champion.h:186
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ UNIT_FIELD_MOUNTDISPLAYID
Definition: UpdateFields.h:126
@ MOVEMENTFLAG_WALKING
Definition: UnitDefines.h:352
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
void ClearAllThreat()
Definition: ThreatMgr.cpp:417
Definition: Creature.h:43
void SetRegeneratingHealth(bool enable)
Definition: Creature.h:318
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10436
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void StopMoving()
Definition: Unit.cpp:16650
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:734
uint32 GetHealth() const
Definition: Unit.h:1029
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21316
void RemoveAllAuras()
Definition: Unit.cpp:5319
ThreatMgr & GetThreatMgr()
Definition: Unit.h:903
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:874
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213
void Clear(bool reset=true)
Definition: MotionMaster.h:167
void AddCreatureAddonAuras()
Definition: boss_grand_champions.cpp:461

References AddCreatureAddonAuras(), Unit::AddUnitMovementFlag(), BossOrder, MotionMaster::Clear(), ThreatMgr::ClearAllThreat(), Unit::CombatStop(), DATA_GRAND_CHAMPION_DIED, DATA_MOUNT_DIED, DATA_TEAMID_IN_INSTANCE, EVENT_FIND_NEW_MOUNT, WorldObject::FindNearestCreature(), ZoneScript::GetData(), Unit::GetHealth(), Unit::GetMotionMaster(), Unit::GetThreatMgr(), Object::GetUInt32Value(), ScriptedAI::me, MountPhase, MOVEMENTFLAG_WALKING, MotionMaster::MovePoint(), NewMountGUID, pInstance, REACT_PASSIVE, Unit::RemoveAllAuras(), ZoneScript::SetData(), Unit::SetImmuneToAll(), Creature::SetReactState(), Creature::SetRegeneratingHealth(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), Unit::StopMoving(), TEAM_HORDE, UNIT_FIELD_MOUNTDISPLAYID, UNIT_FLAG_NON_ATTACKABLE, VEHICLE_ARGENT_BATTLEWORG, and VEHICLE_ARGENT_WARHORSE.

◆ DoAction()

void boss_grand_champion::boss_grand_championAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

484 {
485 if (param == 1)
486 {
487 MountPhase = false;
492 me->SetSpeed(MOVE_RUN, 1.0f, false);
494 me->SetImmuneToAll(true);
498 events.Reset();
499 }
500 else if (param == 2)
502 }
@ MOVE_RUN
Definition: UnitDefines.h:329
@ UNIT_FLAG_PACIFIED
Definition: UnitDefines.h:246
uint32 GetMaxHealth() const
Definition: Unit.h:1030
void SetHealth(uint32 val)
Definition: Unit.cpp:15478
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14429
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:735
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
void ScheduleAbilitiesEvents()
Definition: boss_grand_champions.cpp:419

References AddCreatureAddonAuras(), ObjectGuid::Clear(), Unit::GetMaxHealth(), ScriptedAI::me, MountPhase, MOVE_RUN, MOVEMENTFLAG_WALKING, NewMountGUID, Unit::RemoveAllAuras(), Unit::RemoveUnitFlag(), Unit::RemoveUnitMovementFlag(), ScheduleAbilitiesEvents(), Unit::SetHealth(), Unit::SetImmuneToAll(), Creature::SetRegeneratingHealth(), Unit::SetSpeed(), Unit::SetUnitFlag(), UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_PACIFIED.

Referenced by Reset().

◆ EnterEvadeMode()

void boss_grand_champion::boss_grand_championAI::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from npc_escortAI.

599{}

◆ JustEngagedWith()

void boss_grand_champion::boss_grand_championAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

414 {
416 me->CallForHelp(100.0f);
417 }
@ DATA_INSTANCE_PROGRESS
Definition: trial_of_the_champion.h:33
@ INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED
Definition: trial_of_the_champion.h:57
void CallForHelp(float fRadius, Unit *target=nullptr)
Definition: Creature.cpp:2469

References Creature::CallForHelp(), DATA_INSTANCE_PROGRESS, ZoneScript::GetData(), INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED, ScriptedAI::me, and pInstance.

◆ MovementInform()

void boss_grand_champion::boss_grand_championAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from npc_escortAI.

611 {
612 if (id < 4)
614
615 if (type == POINT_MOTION_TYPE)
616 {
617 if (id == 5)
618 me->SetFacingTo(3 * M_PI / 2);
619 else if (id == 7) // reached new mount!
620 {
621 if (NewMountGUID)
623 {
624 mount->DespawnOrUnsummon();
625 me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, mount->GetDisplayId());
627 me->SetHealth(50000);
630 events.Reset();
631 events.ScheduleEvent(EVENT_MOUNT_CHARGE, 2500ms, 4000ms);
632 events.ScheduleEvent(EVENT_SHIELD_BREAKER, 5s, 8s);
633 events.ScheduleEvent(EVENT_THRUST, 3s, 5s);
636 me->SetImmuneToAll(false);
637 if (Unit* target = me->SelectNearestTarget(200.0f))
638 AttackStart(target);
641 if (pInstance)
644 }
645 }
646 else if (id == 9)
648 }
649 }
@ SPELL_TRAMPLE_AURA
Definition: boss_grand_champions.cpp:51
@ DATA_REACHED_NEW_MOUNT
Definition: trial_of_the_champion.h:39
@ REACT_AGGRESSIVE
Definition: Unit.h:550
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:48
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:106
void MovementInform(uint32, uint32) override
Definition: ScriptedEscortAI.cpp:326
void AttackStart(Unit *who) override
Definition: ScriptedEscortAI.cpp:52
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
Unit * SelectNearestTarget(float dist=0, bool playerOnly=false) const
Select nearest hostile unit within the given distance (regardless of threat list).
Definition: Creature.cpp:2388
Definition: Unit.h:630
void SetFacingTo(float ori)
Definition: Unit.cpp:20527

References npc_escortAI::AttackStart(), Unit::CastSpell(), ObjectGuid::Clear(), DATA_REACHED_NEW_MOUNT, Creature::DespawnOrUnsummon(), CreatureAI::DoZoneInCombat(), EVENT_MOUNT_CHARGE, EVENT_SHIELD_BREAKER, EVENT_THRUST, ObjectAccessor::GetCreature(), ScriptedAI::me, MOVEMENTFLAG_WALKING, npc_escortAI::MovementInform(), NewMountGUID, pInstance, POINT_MOTION_TYPE, REACT_AGGRESSIVE, Unit::RemoveUnitFlag(), Unit::RemoveUnitMovementFlag(), Creature::SelectNearestTarget(), ZoneScript::SetData(), Unit::SetFacingTo(), Unit::SetHealth(), Unit::SetImmuneToAll(), Creature::SetReactState(), Creature::SetRegeneratingHealth(), Unit::SetUInt32Value(), SPELL_BOSS_DEFEND_PERIODIC, SPELL_TRAMPLE_AURA, UNIT_FIELD_MOUNTDISPLAYID, and UNIT_FLAG_NON_ATTACKABLE.

◆ Reset()

◆ ScheduleAbilitiesEvents()

void boss_grand_champion::boss_grand_championAI::ScheduleAbilitiesEvents ( )
inline
420 {
422 events.Reset();
423 switch (me->GetEntry())
424 {
425 case NPC_AMBROSE: // Ambrose Boltspark
426 case NPC_ERESSEA: // Eressea Dawnsinger
427 events.RescheduleEvent(EVEMT_MAGE_SPELL_FIREBALL, 5s);
428 events.RescheduleEvent(EVEMT_MAGE_SPELL_BLAST_WAVE, 12s);
429 events.RescheduleEvent(EVEMT_MAGE_SPELL_HASTE, 22s);
430 events.RescheduleEvent(EVEMT_MAGE_SPELL_POLYMORPH, 8s);
431 break;
432 case NPC_COLOSOS: // Colosos
433 case NPC_RUNOK: // Runok Wildmane
434 events.RescheduleEvent(EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING, 16s);
435 events.RescheduleEvent(EVENT_SHAMAN_SPELL_EARTH_SHIELD, 30s, 35s);
436 events.RescheduleEvent(EVENT_SHAMAN_SPELL_HEALING_WAVE, 12s);
437 events.RescheduleEvent(EVENT_SHAMAN_SPELL_HEX_OF_MENDING, 20s, 25s);
438 break;
439 case NPC_JAELYNE: // Jaelyne Evensong
440 case NPC_ZULTORE: // Zul'tore
441 events.RescheduleEvent(EVENT_HUNTER_SPELL_LIGHTNING_ARROWS, 7s);
442 events.RescheduleEvent(EVENT_HUNTER_SPELL_MULTI_SHOT, 12s);
443 break;
444 case NPC_LANA: // Lana Stouthammer
445 case NPC_VISCERI: // Deathstalker Visceri
446 events.RescheduleEvent(EVENT_ROGUE_SPELL_EVISCERATE, 8s);
447 events.RescheduleEvent(EVENT_ROGUE_SPELL_FAN_OF_KNIVES, 14s);
448 events.RescheduleEvent(EVENT_ROGUE_SPELL_POISON_BOTTLE, 19s);
449 break;
450 case NPC_JACOB: // Marshal Jacob Alerius
451 case NPC_MOKRA: // Mokra the Skullcrusher
452 events.RescheduleEvent(EVENT_WARRIOR_SPELL_MORTAL_STRIKE, 8s, 12s);
453 events.RescheduleEvent(EVENT_WARRIOR_SPELL_BLADESTORM, 15s, 20s);
454 events.RescheduleEvent(EVENT_WARRIOR_SPELL_INTERCEPT, 7s);
455 break;
456 default:
457 break;
458 }
459 }
@ EVENT_SHAMAN_SPELL_EARTH_SHIELD
Definition: boss_grand_champions.cpp:127
@ EVENT_WARRIOR_SPELL_MORTAL_STRIKE
Definition: boss_grand_champions.cpp:140
@ EVENT_HUNTER_SPELL_MULTI_SHOT
Definition: boss_grand_champions.cpp:133
@ EVENT_WARRIOR_SPELL_BLADESTORM
Definition: boss_grand_champions.cpp:141
@ EVEMT_MAGE_SPELL_BLAST_WAVE
Definition: boss_grand_champions.cpp:122
@ EVEMT_MAGE_SPELL_FIREBALL
Definition: boss_grand_champions.cpp:121
@ EVEMT_MAGE_SPELL_HASTE
Definition: boss_grand_champions.cpp:123
@ EVENT_HUNTER_SPELL_LIGHTNING_ARROWS
Definition: boss_grand_champions.cpp:132
@ EVEMT_MAGE_SPELL_POLYMORPH
Definition: boss_grand_champions.cpp:124
@ EVENT_ROGUE_SPELL_POISON_BOTTLE
Definition: boss_grand_champions.cpp:138
@ EVENT_SHAMAN_SPELL_HEX_OF_MENDING
Definition: boss_grand_champions.cpp:129
@ EVENT_SHAMAN_SPELL_HEALING_WAVE
Definition: boss_grand_champions.cpp:128
@ EVENT_ROGUE_SPELL_FAN_OF_KNIVES
Definition: boss_grand_champions.cpp:137
@ EVENT_WARRIOR_SPELL_INTERCEPT
Definition: boss_grand_champions.cpp:142
@ EVENT_ROGUE_SPELL_EVISCERATE
Definition: boss_grand_champions.cpp:136
@ EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING
Definition: boss_grand_champions.cpp:126
@ NPC_JAELYNE
Definition: trial_of_the_champion.h:117
@ NPC_LANA
Definition: trial_of_the_champion.h:118
@ NPC_ERESSEA
Definition: trial_of_the_champion.h:108
@ NPC_RUNOK
Definition: trial_of_the_champion.h:109
@ NPC_ZULTORE
Definition: trial_of_the_champion.h:110
@ NPC_COLOSOS
Definition: trial_of_the_champion.h:116
@ NPC_MOKRA
Definition: trial_of_the_champion.h:107
@ NPC_AMBROSE
Definition: trial_of_the_champion.h:115
@ NPC_VISCERI
Definition: trial_of_the_champion.h:111
@ NPC_JACOB
Definition: trial_of_the_champion.h:114
uint32 GetEntry() const
Definition: Object.h:115
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY]
Definition: Unit.h:1955

References EVEMT_MAGE_SPELL_BLAST_WAVE, EVEMT_MAGE_SPELL_FIREBALL, EVEMT_MAGE_SPELL_HASTE, EVEMT_MAGE_SPELL_POLYMORPH, EVENT_HUNTER_SPELL_LIGHTNING_ARROWS, EVENT_HUNTER_SPELL_MULTI_SHOT, EVENT_ROGUE_SPELL_EVISCERATE, EVENT_ROGUE_SPELL_FAN_OF_KNIVES, EVENT_ROGUE_SPELL_POISON_BOTTLE, EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING, EVENT_SHAMAN_SPELL_EARTH_SHIELD, EVENT_SHAMAN_SPELL_HEALING_WAVE, EVENT_SHAMAN_SPELL_HEX_OF_MENDING, EVENT_WARRIOR_SPELL_BLADESTORM, EVENT_WARRIOR_SPELL_INTERCEPT, EVENT_WARRIOR_SPELL_MORTAL_STRIKE, Object::GetEntry(), IMMUNITY_MECHANIC, Unit::m_spellImmune, ScriptedAI::me, NPC_AMBROSE, NPC_COLOSOS, NPC_ERESSEA, NPC_JACOB, NPC_JAELYNE, NPC_LANA, NPC_MOKRA, NPC_RUNOK, NPC_VISCERI, and NPC_ZULTORE.

Referenced by DoAction().

◆ SetData()

void boss_grand_champion::boss_grand_championAI::SetData ( uint32  uiType,
uint32  uiData 
)
inlineoverridevirtual

Reimplemented from UnitAI.

505 {
506 BossOrder = uiType;
507 if (uiData > 1)
508 return;
509 switch (BossOrder)
510 {
511 case 0:
512 if (uiData == 0) // 1 == short version
513 {
514 AddWaypoint(0, 747.36f, 634.07f, 411.572f);
515 AddWaypoint(1, 780.43f, 607.15f, 411.82f);
516 }
517 AddWaypoint(2, 785.99f, 599.41f, 411.92f);
518 AddWaypoint(3, 778.44f, 601.64f, 411.79f);
519 break;
520 case 1:
521 if (uiData == 0) // 1 == short version
522 {
523 AddWaypoint(0, 747.35f, 634.07f, 411.57f);
524 AddWaypoint(1, 768.72f, 581.01f, 411.92f);
525 }
526 AddWaypoint(2, 763.55f, 590.52f, 411.71f);
527 break;
528 case 2:
529 if (uiData == 0) // 1 == short version
530 {
531 AddWaypoint(0, 747.35f, 634.07f, 411.57f);
532 AddWaypoint(1, 784.02f, 645.33f, 412.39f);
533 }
534 AddWaypoint(2, 775.67f, 641.91f, 411.91f);
535 break;
536 default:
537 return;
538 }
539
540 Start(false, true);
541 }
void Start(bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition: ScriptedEscortAI.cpp:449
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)
Definition: ScriptedEscortAI.cpp:396

References npc_escortAI::AddWaypoint(), BossOrder, and npc_escortAI::Start().

◆ SpellHit()

void boss_grand_champion::boss_grand_championAI::SpellHit ( Unit ,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

652 {
653 if (spell->Id == SPELL_TRAMPLE_STUN)
655 }
Talk
Definition: hyjal.cpp:82
@ SPELL_TRAMPLE_STUN
Definition: boss_grand_champions.cpp:53
@ SAY_TRAMPLED
Definition: boss_grand_champions.cpp:98

References SpellInfo::Id, ScriptedAI::me, SAY_TRAMPLED, and SPELL_TRAMPLE_STUN.

◆ UpdateAI()

void boss_grand_champion::boss_grand_championAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from npc_escortAI.

658 {
660
661 if (!UpdateVictim() && !NewMountGUID )
662 return;
663
664 events.Update(diff);
665
667 return;
668
669 switch (events.ExecuteEvent())
670 {
671 case 0:
672 break;
674 {
676 {
677 events.Repeat(200ms);
678 break;
679 }
680
681 // hackfix, trample won't hit grand champions because of UNIT_FLAG_NON_ATTACKABLE
682 if (pInstance)
683 {
684 bool trample = false;
685 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
686 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
687 if (Player* plr = itr->GetSource())
688 if (me->GetExactDist(plr) <= 5.0f )
689 if (Vehicle* v = plr->GetVehicle())
690 if (Unit* c = v->GetBase())
691 if (c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE))
692 {
695 me->StopMoving();
697 trample = true;
698 break;
699 }
700
701 if (trample)
702 {
703 events.Repeat(15s);
704 break;
705 }
706 }
707
709 if (mount->IsAlive())
710 {
712 me->GetMotionMaster()->MovePoint(7, *mount);
713 events.Repeat(200ms);
714 break;
715 }
716
718 {
720 NewMountGUID = mount->GetGUID();
722 me->SetImmuneToAll(true);
723 me->GetMotionMaster()->MovePoint(7, *mount);
724 events.Repeat(200ms);
725 break;
726 }
727 }
728 break;
730 {
731 GuidVector LIST;
732 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
733 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
734 if (Player* plr = itr->GetSource())
735 {
736 if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
737 continue;
738 if (!plr->GetVehicle())
739 LIST.push_back(plr->GetGUID());
740 else if (Vehicle* v = plr->GetVehicle())
741 {
742 if (Unit* mount = v->GetBase())
743 LIST.push_back(mount->GetGUID());
744 }
745 }
746 if (!LIST.empty())
747 {
748 uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
749 if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
750 {
752 me->AddThreat(target, 10000.0f);
753 AttackStart(target);
754 me->CastSpell(target, SPELL_MINIONS_CHARGE, false);
755 }
756 }
757 events.Repeat(4500ms, 6000ms);
758 }
759 break;
761 {
762 GuidVector LIST;
763 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
764 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
765 if (Player* plr = itr->GetSource())
766 {
767 if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
768 continue;
769 if (Vehicle* v = plr->GetVehicle())
770 if (Unit* mount = v->GetBase())
771 LIST.push_back(mount->GetGUID());
772 }
773 if (!LIST.empty())
774 {
775 uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
776 if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
777 me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
778 }
779 events.Repeat(6s, 8s);
780 }
781 break;
782 case EVENT_THRUST:
783 if (Unit* victim = me->GetVictim())
784 if (me->GetExactDist(victim) <= 6.0f )
786 events.Repeat(3s, 5s);
787 break;
788
789 /******************* MAGE *******************/
791 if (me->GetVictim())
793 events.Repeat(5s);
794 break;
796 me->CastSpell((Unit*)nullptr, SPELL_BLAST_WAVE, false);
797 events.Repeat(13s);
798 break;
800 me->CastSpell(me, SPELL_HASTE, false);
801 events.Repeat(22s);
802 break;
804 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
805 me->CastSpell(target, SPELL_POLYMORPH, false);
806 events.Repeat(8s);
807 break;
808 /***************** MAGE END *****************/
809
810 /****************** SHAMAN ******************/
812 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
813 me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
814 events.Repeat(16s);
815 break;
818 events.Repeat(30s, 35s);
819 break;
821 {
822 Unit* target = nullptr;
823 if (urand(0, 1))
824 {
825 target = DoSelectLowestHpFriendly(40.0f);
826 if (!target)
827 target = me;
828 }
829 else
830 target = me;
831 me->CastSpell(target, SPELL_HEALING_WAVE, false);
832 events.Repeat(22s);
833 }
834 break;
836 if (me->GetVictim())
838 events.Repeat(20s, 25s);
839 break;
840 /**************** SHAMAN END ****************/
841
842 /****************** HUNTER ******************/
844
845 break;
847 me->CastSpell((Unit*)nullptr, SPELL_LIGHTNING_ARROWS, false);
848 events.Repeat(20s, 25s);
849 break;
851 {
852 if (!UnitTargetGUID)
853 {
854 if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true))
855 {
856 me->CastSpell(target, SPELL_SHOOT, false);
857 UnitTargetGUID = target->GetGUID();
858 }
859 events.Repeat(2s);
860 break;
861 }
862 else
863 {
865 if (target && me->IsInRange(target, 5.0f, 30.0f, false))
866 me->CastSpell(target, SPELL_MULTI_SHOT, false);
867 else
868 {
869 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
870 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
871 {
872 Player* player = itr->GetSource();
873 if (player && me->IsInRange(player, 5.0f, 30.0f, false))
874 {
875 me->CastSpell(player, SPELL_MULTI_SHOT, false);
876 break;
877 }
878 }
879 }
881 }
882 events.Repeat(15s, 20s);
883 }
884 break;
885 /**************** HUNTER END ****************/
886
887 /****************** ROGUE *******************/
889 if (me->GetVictim())
891 events.Repeat(8s);
892 break;
894 me->CastSpell((Unit*)nullptr, SPELL_FAN_OF_KNIVES, false);
895 events.Repeat(14s);
896 break;
898 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
899 me->CastSpell(target, SPELL_POISON_BOTTLE, false);
900 events.Repeat(19s);
901 break;
902 /**************** ROGUE END *****************/
903
904 /***************** WARRIOR ******************/
906 if (me->GetVictim())
908 events.Repeat(8s, 12s);
909 break;
911 if (me->GetVictim())
913 events.Repeat(15s, 20s);
914 break;
916 {
917 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
918 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
919 {
920 Player* player = itr->GetSource();
921 if (player && me->IsInRange(player, 8.0f, 25.0f, false))
922 {
924 me->AddThreat(player, 5.0f);
925 me->CastSpell(player, SPELL_INTERCEPT, false);
926 break;
927 }
928 }
929 events.Repeat(7s);
930 }
931 break;
933
934 break;
935 /*************** WARRIOR END ****************/
936 }
937
939 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::uint8_t uint8
Definition: Define.h:109
#define SPELL_EVISCERATE
Definition: boss_grand_champions.cpp:107
#define SPELL_POLYMORPH
Definition: boss_grand_champions.cpp:103
#define SPELL_CHAIN_LIGHTNING
Definition: boss_grand_champions.cpp:104
#define SPELL_HEALING_WAVE
Definition: boss_grand_champions.cpp:105
@ EVENT_HUNTER_SPELL_DISENGAGE
Definition: boss_grand_champions.cpp:131
@ EVENT_WARRIOR_SPELL_ROLLING_THROW
Definition: boss_grand_champions.cpp:143
#define SPELL_SHOOT
Definition: boss_grand_champions.cpp:106
@ SPELL_NPC_SHIELD_BREAKER
Definition: boss_grand_champions.cpp:42
@ SPELL_MINIONS_CHARGE
Definition: boss_grand_champions.cpp:46
@ SPELL_PLAYER_VEHICLE_THRUST
Definition: boss_grand_champions.cpp:49
#define SPELL_MORTAL_STRIKE
Definition: boss_grand_champions.cpp:108
@ SPELL_HASTE
Definition: boss_grand_champions.cpp:63
@ SPELL_FAN_OF_KNIVES
Definition: boss_grand_champions.cpp:85
@ SPELL_EARTH_SHIELD
Definition: boss_grand_champions.cpp:70
@ SPELL_INTERCEPT
Definition: boss_grand_champions.cpp:92
@ SPELL_POISON_BOTTLE
Definition: boss_grand_champions.cpp:86
@ SPELL_BLADESTORM
Definition: boss_grand_champions.cpp:91
@ SPELL_LIGHTNING_ARROWS
Definition: boss_grand_champions.cpp:77
@ SPELL_MULTI_SHOT
Definition: boss_grand_champions.cpp:78
@ SPELL_HEX_OF_MENDING
Definition: boss_grand_champions.cpp:73
#define SPELL_BLAST_WAVE
Definition: boss_grand_champions.cpp:102
#define SPELL_FIREBALL
Definition: boss_grand_champions.cpp:101
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:256
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:199
Definition: LinkedList.h:139
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
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:280
void DoResetThreatList()
Definition: ScriptedCreature.cpp:445
Unit * DoSelectLowestHpFriendly(float range, uint32 minHPDiff=1)
Definition: ScriptedCreature.cpp:489
void UpdateAI(uint32 diff) override
Use to start attacking a target. Called just before JustEngagedWith()
Definition: ScriptedEscortAI.cpp:240
void ResetAllThreat()
Definition: ThreatMgr.cpp:651
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
Map * GetMap() const
Definition: Object.h:536
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
Definition: Object.cpp:1415
float GetExactDist(float x, float y, float z) const
Definition: Position.h:177
Definition: Player.h:1081
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14653
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
Definition: Vehicle.h:28
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition: MotionMaster.cpp:913
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:180
void MoveIdle()
Definition: MotionMaster.cpp:232
ObjectGuid UnitTargetGUID
Definition: boss_grand_champions.cpp:398

References Unit::AddThreat(), Unit::AddUnitMovementFlag(), npc_escortAI::AttackStart(), MapRefMgr::begin(), Unit::CastSpell(), ObjectGuid::Clear(), DATA_TEAMID_IN_INSTANCE, UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoResetThreatList(), ScriptedAI::DoSelectLowestHpFriendly(), MapRefMgr::end(), EVEMT_MAGE_SPELL_BLAST_WAVE, EVEMT_MAGE_SPELL_FIREBALL, EVEMT_MAGE_SPELL_HASTE, EVEMT_MAGE_SPELL_POLYMORPH, EVENT_FIND_NEW_MOUNT, EVENT_HUNTER_SPELL_DISENGAGE, EVENT_HUNTER_SPELL_LIGHTNING_ARROWS, EVENT_HUNTER_SPELL_MULTI_SHOT, EVENT_MOUNT_CHARGE, EVENT_ROGUE_SPELL_EVISCERATE, EVENT_ROGUE_SPELL_FAN_OF_KNIVES, EVENT_ROGUE_SPELL_POISON_BOTTLE, EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING, EVENT_SHAMAN_SPELL_EARTH_SHIELD, EVENT_SHAMAN_SPELL_HEALING_WAVE, EVENT_SHAMAN_SPELL_HEX_OF_MENDING, EVENT_SHIELD_BREAKER, EVENT_THRUST, EVENT_WARRIOR_SPELL_BLADESTORM, EVENT_WARRIOR_SPELL_INTERCEPT, EVENT_WARRIOR_SPELL_MORTAL_STRIKE, EVENT_WARRIOR_SPELL_ROLLING_THROW, WorldObject::FindNearestCreature(), ObjectAccessor::GetCreature(), MotionMaster::GetCurrentMovementGeneratorType(), ZoneScript::GetData(), Object::GetEntry(), Position::GetExactDist(), WorldObject::GetMap(), Unit::GetMotionMaster(), Map::GetPlayers(), Unit::GetThreatMgr(), ObjectAccessor::GetUnit(), Unit::GetVictim(), Unit::HasAura(), Unit::HasUnitState(), WorldObject::IsInRange(), ScriptedAI::me, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), MOVEMENTFLAG_WALKING, MotionMaster::MovePoint(), NewMountGUID, NPC_JACOB, NPC_MOKRA, pInstance, POINT_MOTION_TYPE, ThreatMgr::ResetAllThreat(), UnitAI::SelectTarget(), Unit::SetImmuneToAll(), Unit::SetUnitFlag(), SPELL_BLADESTORM, SPELL_BLAST_WAVE, SPELL_CHAIN_LIGHTNING, SPELL_EARTH_SHIELD, SPELL_EVISCERATE, SPELL_FAN_OF_KNIVES, SPELL_FIREBALL, SPELL_HASTE, SPELL_HEALING_WAVE, SPELL_HEX_OF_MENDING, SPELL_INTERCEPT, SPELL_LIGHTNING_ARROWS, SPELL_MINIONS_CHARGE, SPELL_MORTAL_STRIKE, SPELL_MULTI_SHOT, SPELL_NPC_SHIELD_BREAKER, SPELL_PLAYER_VEHICLE_THRUST, SPELL_POISON_BOTTLE, SPELL_POLYMORPH, SPELL_SHOOT, SPELL_TRAMPLE_STUN, Unit::StopMoving(), TEAM_HORDE, UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, UnitTargetGUID, npc_escortAI::UpdateAI(), CreatureAI::UpdateVictim(), urand(), VEHICLE_ARGENT_BATTLEWORG, and VEHICLE_ARGENT_WARHORSE.

◆ WaypointReached()

void boss_grand_champion::boss_grand_championAI::WaypointReached ( uint32  i)
inlineoverridevirtual

Implements npc_escortAI.

602 {
603 if (!pInstance)
604 return;
605
606 if ((i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0))
608 }
@ DATA_GRAND_CHAMPION_REACHED_DEST
Definition: trial_of_the_champion.h:37

References BossOrder, DATA_GRAND_CHAMPION_REACHED_DEST, pInstance, and ZoneScript::SetData().

Member Data Documentation

◆ BossOrder

uint32 boss_grand_champion::boss_grand_championAI::BossOrder

◆ events

EventMap boss_grand_champion::boss_grand_championAI::events

◆ MountPhase

bool boss_grand_champion::boss_grand_championAI::MountPhase

◆ NewMountGUID

ObjectGuid boss_grand_champion::boss_grand_championAI::NewMountGUID

◆ pInstance

InstanceScript* boss_grand_champion::boss_grand_championAI::pInstance

◆ UnitTargetGUID

ObjectGuid boss_grand_champion::boss_grand_championAI::UnitTargetGUID

Referenced by UpdateAI().