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
 
- 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)
 
 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
361 : npc_escortAI(pCreature)
362 {
363 pInstance = pCreature->GetInstanceScript();
364 MountPhase = true;
365 SetDespawnAtEnd(false);
367 BossOrder = 0;
370
371 events.Reset();
372 events.ScheduleEvent(EVENT_MOUNT_CHARGE, 2500ms, 4000ms);
373 events.ScheduleEvent(EVENT_SHIELD_BREAKER, 5s, 8s);
374 events.ScheduleEvent(EVENT_THRUST, 3s, 5s);
375
394 }
@ REACT_PASSIVE
Definition: Unit.h:548
@ SPELL_BOSS_DEFEND_PERIODIC
Definition: boss_grand_champions.cpp:33
@ EVENT_THRUST
Definition: boss_grand_champions.cpp:113
@ EVENT_SHIELD_BREAKER
Definition: boss_grand_champions.cpp:112
@ EVENT_MOUNT_CHARGE
Definition: boss_grand_champions.cpp:111
events
Definition: boss_sartura.cpp:43
@ 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
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:97
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
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:13346
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:1168
ObjectGuid NewMountGUID
Definition: boss_grand_champions.cpp:400
bool MountPhase
Definition: boss_grand_champions.cpp:399
uint32 BossOrder
Definition: boss_grand_champions.cpp:398
InstanceScript * pInstance
Definition: boss_grand_champions.cpp:396

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
465 {
466 CreatureAddon const* cainfo = me->GetCreatureAddon();
467 if (!cainfo)
468 return;
469
470 if (!cainfo->auras.empty())
471 {
472 for (std::vector<uint32>::const_iterator itr = cainfo->auras.begin(); itr != cainfo->auras.end(); ++itr)
473 {
474 SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
475 if (!AdditionalSpellInfo)
476 continue;
477
478 if (me->HasAura(AdditionalSpellInfo->Id))
479 continue;
480
481 me->AddAura(AdditionalSpellInfo->Id, me);
482 }
483 }
484 }
#define sSpellMgr
Definition: SpellMgr.h:825
CreatureAddon const * GetCreatureAddon() const
Definition: Creature.cpp:2692
Definition: CreatureData.h:443
std::vector< uint32 > auras
Definition: CreatureData.h:449
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18819
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669
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.

547 {
548 if (MountPhase)
549 {
551 damage = 0;
552 else if (damage >= me->GetHealth())
553 {
554 events.Reset();
555 damage = me->GetHealth() - 1;
560 me->CombatStop(true);
562 me->StopMoving();
566 me->SetImmuneToAll(true);
568 if (pInstance)
569 {
572 {
573 NewMountGUID = mount->GetGUID();
574 me->GetMotionMaster()->MovePoint(7, *mount);
575 events.RescheduleEvent(EVENT_FIND_NEW_MOUNT, 1s);
576 }
577 }
578 }
579 }
580 else
581 {
582 if (damage >= me->GetHealth())
583 {
584 MountPhase = true;
585 events.Reset();
586 damage = me->GetHealth() - 1;
591 me->CombatStop(true);
595 me->SetImmuneToAll(true);
596 if (pInstance)
598 }
599 }
600 }
@ MOVEMENTFLAG_WALKING
Definition: UnitDefines.h:352
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ UNIT_FIELD_MOUNTDISPLAYID
Definition: UpdateFields.h:126
@ 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
@ EVENT_FIND_NEW_MOUNT
Definition: boss_grand_champions.cpp:114
@ TEAM_HORDE
Definition: SharedDefines.h:761
void ClearAllThreat()
Definition: ThreatMgr.cpp:417
Definition: Creature.h:46
void SetRegeneratingHealth(bool enable)
Definition: Creature.h:319
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10398
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
void StopMoving()
Definition: Unit.cpp:16606
void AddUnitMovementFlag(uint32 f)
Definition: Unit.h:1611
uint32 GetHealth() const
Definition: Unit.h:869
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21256
void RemoveAllAuras()
Definition: Unit.cpp:5290
ThreatMgr & GetThreatMgr()
Definition: Unit.h:839
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:810
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
void Clear(bool reset=true)
Definition: MotionMaster.h:165
void AddCreatureAddonAuras()
Definition: boss_grand_champions.cpp:464

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.

487 {
488 if (param == 1)
489 {
490 MountPhase = false;
495 me->SetSpeed(MOVE_RUN, 1.0f, false);
497 me->SetImmuneToAll(true);
501 events.Reset();
502 }
503 else if (param == 2)
505 }
@ MOVE_RUN
Definition: UnitDefines.h:329
@ UNIT_FLAG_PACIFIED
Definition: UnitDefines.h:246
uint32 GetMaxHealth() const
Definition: Unit.h:870
void SetHealth(uint32 val)
Definition: Unit.cpp:15433
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14383
void RemoveUnitMovementFlag(uint32 f)
Definition: Unit.h:1612
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684
void ScheduleAbilitiesEvents()
Definition: boss_grand_champions.cpp:422

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.

602{}

◆ JustEngagedWith()

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

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

417 {
419 me->CallForHelp(100.0f);
420 }
@ 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:2464

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.

614 {
615 if (id < 4)
617
618 if (type == POINT_MOTION_TYPE)
619 {
620 if (id == 5)
621 me->SetFacingTo(3 * M_PI / 2);
622 else if (id == 7) // reached new mount!
623 {
624 if (NewMountGUID)
626 {
627 mount->DespawnOrUnsummon();
628 me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, mount->GetDisplayId());
630 me->SetHealth(50000);
633 events.Reset();
634 events.ScheduleEvent(EVENT_MOUNT_CHARGE, 2500ms, 4000ms);
635 events.ScheduleEvent(EVENT_SHIELD_BREAKER, 5s, 8s);
636 events.ScheduleEvent(EVENT_THRUST, 3s, 5s);
639 me->SetImmuneToAll(false);
640 if (Unit* target = me->SelectNearestTarget(200.0f))
641 AttackStart(target);
644 if (pInstance)
647 }
648 }
649 else if (id == 9)
651 }
652 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ REACT_AGGRESSIVE
Definition: Unit.h:550
@ DATA_REACHED_NEW_MOUNT
Definition: trial_of_the_champion.h:39
@ SPELL_TRAMPLE_AURA
Definition: boss_grand_champions.cpp:49
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95
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:2173
Unit * SelectNearestTarget(float dist=0, bool playerOnly=false) const
Select nearest hostile unit within the given distance (regardless of threat list).
Definition: Creature.cpp:2383
Definition: Unit.h:630
void SetFacingTo(float ori)
Definition: Unit.cpp:20483

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
423 {
425 events.Reset();
426 switch (me->GetEntry())
427 {
428 case NPC_AMBROSE: // Ambrose Boltspark
429 case NPC_ERESSEA: // Eressea Dawnsinger
430 events.RescheduleEvent(EVEMT_MAGE_SPELL_FIREBALL, 5s);
431 events.RescheduleEvent(EVEMT_MAGE_SPELL_BLAST_WAVE, 12s);
432 events.RescheduleEvent(EVEMT_MAGE_SPELL_HASTE, 22s);
433 events.RescheduleEvent(EVEMT_MAGE_SPELL_POLYMORPH, 8s);
434 break;
435 case NPC_COLOSOS: // Colosos
436 case NPC_RUNOK: // Runok Wildmane
437 events.RescheduleEvent(EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING, 16s);
438 events.RescheduleEvent(EVENT_SHAMAN_SPELL_EARTH_SHIELD, 30s, 35s);
439 events.RescheduleEvent(EVENT_SHAMAN_SPELL_HEALING_WAVE, 12s);
440 events.RescheduleEvent(EVENT_SHAMAN_SPELL_HEX_OF_MENDING, 20s, 25s);
441 break;
442 case NPC_JAELYNE: // Jaelyne Evensong
443 case NPC_ZULTORE: // Zul'tore
444 events.RescheduleEvent(EVENT_HUNTER_SPELL_LIGHTNING_ARROWS, 7s);
445 events.RescheduleEvent(EVENT_HUNTER_SPELL_MULTI_SHOT, 12s);
446 break;
447 case NPC_LANA: // Lana Stouthammer
448 case NPC_VISCERI: // Deathstalker Visceri
449 events.RescheduleEvent(EVENT_ROGUE_SPELL_EVISCERATE, 8s);
450 events.RescheduleEvent(EVENT_ROGUE_SPELL_FAN_OF_KNIVES, 14s);
451 events.RescheduleEvent(EVENT_ROGUE_SPELL_POISON_BOTTLE, 19s);
452 break;
453 case NPC_JACOB: // Marshal Jacob Alerius
454 case NPC_MOKRA: // Mokra the Skullcrusher
455 events.RescheduleEvent(EVENT_WARRIOR_SPELL_MORTAL_STRIKE, 8s, 12s);
456 events.RescheduleEvent(EVENT_WARRIOR_SPELL_BLADESTORM, 15s, 20s);
457 events.RescheduleEvent(EVENT_WARRIOR_SPELL_INTERCEPT, 7s);
458 break;
459 default:
460 break;
461 }
462 }
@ 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
@ EVENT_SHAMAN_SPELL_EARTH_SHIELD
Definition: boss_grand_champions.cpp:125
@ EVENT_WARRIOR_SPELL_MORTAL_STRIKE
Definition: boss_grand_champions.cpp:138
@ EVENT_HUNTER_SPELL_MULTI_SHOT
Definition: boss_grand_champions.cpp:131
@ EVENT_WARRIOR_SPELL_BLADESTORM
Definition: boss_grand_champions.cpp:139
@ EVEMT_MAGE_SPELL_BLAST_WAVE
Definition: boss_grand_champions.cpp:120
@ EVEMT_MAGE_SPELL_FIREBALL
Definition: boss_grand_champions.cpp:119
@ EVEMT_MAGE_SPELL_HASTE
Definition: boss_grand_champions.cpp:121
@ EVENT_HUNTER_SPELL_LIGHTNING_ARROWS
Definition: boss_grand_champions.cpp:130
@ EVEMT_MAGE_SPELL_POLYMORPH
Definition: boss_grand_champions.cpp:122
@ EVENT_ROGUE_SPELL_POISON_BOTTLE
Definition: boss_grand_champions.cpp:136
@ EVENT_SHAMAN_SPELL_HEX_OF_MENDING
Definition: boss_grand_champions.cpp:127
@ EVENT_SHAMAN_SPELL_HEALING_WAVE
Definition: boss_grand_champions.cpp:126
@ EVENT_ROGUE_SPELL_FAN_OF_KNIVES
Definition: boss_grand_champions.cpp:135
@ EVENT_WARRIOR_SPELL_INTERCEPT
Definition: boss_grand_champions.cpp:140
@ EVENT_ROGUE_SPELL_EVISCERATE
Definition: boss_grand_champions.cpp:134
@ EVENT_SHAMAN_SPELL_CHAIN_LIGHTNING
Definition: boss_grand_champions.cpp:124
uint32 GetEntry() const
Definition: Object.h:112
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY]
Definition: Unit.h:1794

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.

508 {
509 BossOrder = uiType;
510 if (uiData > 1)
511 return;
512 switch (BossOrder)
513 {
514 case 0:
515 if (uiData == 0) // 1 == short version
516 {
517 AddWaypoint(0, 747.36f, 634.07f, 411.572f);
518 AddWaypoint(1, 780.43f, 607.15f, 411.82f);
519 }
520 AddWaypoint(2, 785.99f, 599.41f, 411.92f);
521 AddWaypoint(3, 778.44f, 601.64f, 411.79f);
522 break;
523 case 1:
524 if (uiData == 0) // 1 == short version
525 {
526 AddWaypoint(0, 747.35f, 634.07f, 411.57f);
527 AddWaypoint(1, 768.72f, 581.01f, 411.92f);
528 }
529 AddWaypoint(2, 763.55f, 590.52f, 411.71f);
530 break;
531 case 2:
532 if (uiData == 0) // 1 == short version
533 {
534 AddWaypoint(0, 747.35f, 634.07f, 411.57f);
535 AddWaypoint(1, 784.02f, 645.33f, 412.39f);
536 }
537 AddWaypoint(2, 775.67f, 641.91f, 411.91f);
538 break;
539 default:
540 return;
541 }
542
543 Start(false, true);
544 }
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.

655 {
656 if (spell->Id == SPELL_TRAMPLE_STUN)
658 }
@ SPELL_TRAMPLE_STUN
Definition: boss_grand_champions.cpp:51
@ SAY_TRAMPLED
Definition: boss_grand_champions.cpp:96
Talk
Definition: hyjal.cpp:82

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.

661 {
663
664 if (!UpdateVictim() && !NewMountGUID )
665 return;
666
667 events.Update(diff);
668
670 return;
671
672 switch (events.ExecuteEvent())
673 {
674 case 0:
675 break;
677 {
679 {
680 events.Repeat(200ms);
681 break;
682 }
683
684 // hackfix, trample won't hit grand champions because of UNIT_FLAG_NON_ATTACKABLE
685 if (pInstance)
686 {
687 bool trample = false;
688 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
689 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
690 if (Player* plr = itr->GetSource())
691 if (me->GetExactDist(plr) <= 5.0f )
692 if (Vehicle* v = plr->GetVehicle())
693 if (Unit* c = v->GetBase())
694 if (c->IsCreature() && c->ToCreature()->GetEntry() == (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? VEHICLE_ARGENT_BATTLEWORG : VEHICLE_ARGENT_WARHORSE))
695 {
698 me->StopMoving();
700 trample = true;
701 break;
702 }
703
704 if (trample)
705 {
706 events.Repeat(15s);
707 break;
708 }
709 }
710
712 if (mount->IsAlive())
713 {
715 me->GetMotionMaster()->MovePoint(7, *mount);
716 events.Repeat(200ms);
717 break;
718 }
719
721 {
723 NewMountGUID = mount->GetGUID();
725 me->SetImmuneToAll(true);
726 me->GetMotionMaster()->MovePoint(7, *mount);
727 events.Repeat(200ms);
728 break;
729 }
730 }
731 break;
733 {
734 GuidVector LIST;
735 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
736 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
737 if (Player* plr = itr->GetSource())
738 {
739 if (me->GetExactDist(plr) < 8.0f || me->GetExactDist(plr) > 25.0f || plr->isDead())
740 continue;
741 if (!plr->GetVehicle())
742 LIST.push_back(plr->GetGUID());
743 else if (Vehicle* v = plr->GetVehicle())
744 {
745 if (Unit* mount = v->GetBase())
746 LIST.push_back(mount->GetGUID());
747 }
748 }
749 if (!LIST.empty())
750 {
751 uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
752 if (Unit* target = ObjectAccessor::GetUnit(*me, LIST.at(rnd)))
753 {
755 me->AddThreat(target, 10000.0f);
756 AttackStart(target);
757 me->CastSpell(target, SPELL_MINIONS_CHARGE, false);
758 }
759 }
760 events.Repeat(4500ms, 6000ms);
761 }
762 break;
764 {
765 GuidVector LIST;
766 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
767 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
768 if (Player* plr = itr->GetSource())
769 {
770 if (me->GetExactDist(plr) < 10.0f || me->GetExactDist(plr) > 30.0f )
771 continue;
772 if (Vehicle* v = plr->GetVehicle())
773 if (Unit* mount = v->GetBase())
774 LIST.push_back(mount->GetGUID());
775 }
776 if (!LIST.empty())
777 {
778 uint8 rnd = LIST.size() > 1 ? urand(0, LIST.size() - 1) : 0;
779 if (Unit* target = ObjectAccessor::GetCreature(*me, LIST.at(rnd)))
780 me->CastSpell(target, SPELL_NPC_SHIELD_BREAKER, false);
781 }
782 events.Repeat(6s, 8s);
783 }
784 break;
785 case EVENT_THRUST:
786 if (Unit* victim = me->GetVictim())
787 if (me->GetExactDist(victim) <= 6.0f )
789 events.Repeat(3s, 5s);
790 break;
791
792 /******************* MAGE *******************/
794 if (me->GetVictim())
796 events.Repeat(5s);
797 break;
799 me->CastSpell((Unit*)nullptr, SPELL_BLAST_WAVE, false);
800 events.Repeat(13s);
801 break;
803 me->CastSpell(me, SPELL_HASTE, false);
804 events.Repeat(22s);
805 break;
807 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
808 me->CastSpell(target, SPELL_POLYMORPH, false);
809 events.Repeat(8s);
810 break;
811 /***************** MAGE END *****************/
812
813 /****************** SHAMAN ******************/
815 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
816 me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
817 events.Repeat(16s);
818 break;
821 events.Repeat(30s, 35s);
822 break;
824 {
825 Unit* target = nullptr;
826 if (urand(0, 1))
827 {
828 target = DoSelectLowestHpFriendly(40.0f);
829 if (!target)
830 target = me;
831 }
832 else
833 target = me;
834 me->CastSpell(target, SPELL_HEALING_WAVE, false);
835 events.Repeat(22s);
836 }
837 break;
839 if (me->GetVictim())
841 events.Repeat(20s, 25s);
842 break;
843 /**************** SHAMAN END ****************/
844
845 /****************** HUNTER ******************/
847
848 break;
850 me->CastSpell((Unit*)nullptr, SPELL_LIGHTNING_ARROWS, false);
851 events.Repeat(20s, 25s);
852 break;
854 {
855 if (!UnitTargetGUID)
856 {
857 if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0, 30.0f, true))
858 {
859 me->CastSpell(target, SPELL_SHOOT, false);
860 UnitTargetGUID = target->GetGUID();
861 }
862 events.Repeat(2s);
863 break;
864 }
865 else
866 {
868 if (target && me->IsInRange(target, 5.0f, 30.0f, false))
869 me->CastSpell(target, SPELL_MULTI_SHOT, false);
870 else
871 {
872 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
873 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
874 {
875 Player* player = itr->GetSource();
876 if (player && me->IsInRange(player, 5.0f, 30.0f, false))
877 {
878 me->CastSpell(player, SPELL_MULTI_SHOT, false);
879 break;
880 }
881 }
882 }
884 }
885 events.Repeat(15s, 20s);
886 }
887 break;
888 /**************** HUNTER END ****************/
889
890 /****************** ROGUE *******************/
892 if (me->GetVictim())
894 events.Repeat(8s);
895 break;
897 me->CastSpell((Unit*)nullptr, SPELL_FAN_OF_KNIVES, false);
898 events.Repeat(14s);
899 break;
901 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 30.0f, true))
902 me->CastSpell(target, SPELL_POISON_BOTTLE, false);
903 events.Repeat(19s);
904 break;
905 /**************** ROGUE END *****************/
906
907 /***************** WARRIOR ******************/
909 if (me->GetVictim())
911 events.Repeat(8s, 12s);
912 break;
914 if (me->GetVictim())
916 events.Repeat(15s, 20s);
917 break;
919 {
920 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
921 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
922 {
923 Player* player = itr->GetSource();
924 if (player && me->IsInRange(player, 8.0f, 25.0f, false))
925 {
927 me->AddThreat(player, 5.0f);
928 me->CastSpell(player, SPELL_INTERCEPT, false);
929 break;
930 }
931 }
932 events.Repeat(7s);
933 }
934 break;
936
937 break;
938 /*************** WARRIOR END ****************/
939 }
940
942 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::uint8_t uint8
Definition: Define.h:109
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:256
#define SPELL_EVISCERATE
Definition: boss_grand_champions.cpp:105
#define SPELL_POLYMORPH
Definition: boss_grand_champions.cpp:101
#define SPELL_CHAIN_LIGHTNING
Definition: boss_grand_champions.cpp:102
#define SPELL_HEALING_WAVE
Definition: boss_grand_champions.cpp:103
@ EVENT_HUNTER_SPELL_DISENGAGE
Definition: boss_grand_champions.cpp:129
@ EVENT_WARRIOR_SPELL_ROLLING_THROW
Definition: boss_grand_champions.cpp:141
#define SPELL_SHOOT
Definition: boss_grand_champions.cpp:104
@ SPELL_NPC_SHIELD_BREAKER
Definition: boss_grand_champions.cpp:40
@ SPELL_MINIONS_CHARGE
Definition: boss_grand_champions.cpp:44
@ SPELL_PLAYER_VEHICLE_THRUST
Definition: boss_grand_champions.cpp:47
#define SPELL_MORTAL_STRIKE
Definition: boss_grand_champions.cpp:106
@ SPELL_HASTE
Definition: boss_grand_champions.cpp:61
@ SPELL_FAN_OF_KNIVES
Definition: boss_grand_champions.cpp:83
@ SPELL_EARTH_SHIELD
Definition: boss_grand_champions.cpp:68
@ SPELL_INTERCEPT
Definition: boss_grand_champions.cpp:90
@ SPELL_POISON_BOTTLE
Definition: boss_grand_champions.cpp:84
@ SPELL_BLADESTORM
Definition: boss_grand_champions.cpp:89
@ SPELL_LIGHTNING_ARROWS
Definition: boss_grand_champions.cpp:75
@ SPELL_MULTI_SHOT
Definition: boss_grand_champions.cpp:76
@ SPELL_HEX_OF_MENDING
Definition: boss_grand_champions.cpp:71
#define SPELL_BLAST_WAVE
Definition: boss_grand_champions.cpp:100
#define SPELL_FIREBALL
Definition: boss_grand_champions.cpp:99
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
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:269
void DoResetThreatList()
Definition: ScriptedCreature.cpp:436
Unit * DoSelectLowestHpFriendly(float range, uint32 minHPDiff=1)
Definition: ScriptedCreature.cpp:480
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:109
Map * GetMap() const
Definition: Object.h:531
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
Definition: Object.cpp:1404
float GetExactDist(float x, float y, float z) const
Definition: Position.h:178
Definition: Player.h:1064
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14608
Unit * GetVictim() const
Definition: Unit.h:789
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
Definition: Vehicle.h:28
PlayerList const & GetPlayers() const
Definition: Map.h:486
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition: MotionMaster.cpp:910
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:178
void MoveIdle()
Definition: MotionMaster.cpp:232
ObjectGuid UnitTargetGUID
Definition: boss_grand_champions.cpp:401

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.

605 {
606 if (!pInstance)
607 return;
608
609 if ((i == 2 && (BossOrder == 1 || BossOrder == 2)) || (i == 3 && BossOrder == 0))
611 }
@ 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().