TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
generic_vehicleAI_toc5::generic_vehicleAI_toc5AI Struct Reference

Public Member Functions

 generic_vehicleAI_toc5AI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void SetData (uint32 uiType, uint32) override
 
void WaypointReached (uint32 waypointId) override
 
void EnterCombat (Unit *) override
 
void DoCastSpellShield ()
 
void UpdateAI (uint32 uiDiff) override
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI ()
 
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
 
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 resetWaypointsOnFail=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
virtual bool IsEscorted () const override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance () const
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack () const
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID () const
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) 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 OnPossess (bool)
 
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 DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo constSelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.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 void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
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 sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Public Attributes

InstanceScriptinstance
 
uint32 uiChargeTimer
 
uint32 uiShieldBreakerTimer
 
uint32 uiBuffTimer
 
uint32 uiWaypointPath
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason { EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- 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)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::generic_vehicleAI_toc5AI ( Creature creature)
inline
156  : npc_escortAI(creature)
157  {
158  Initialize();
159  SetDespawnAtEnd(false);
160  uiWaypointPath = 0;
161 
162  instance = creature->GetInstanceScript();
163  }
npc_escortAI(Creature *creature)
Definition: ScriptedEscortAI.cpp:37
void SetDespawnAtEnd(bool despawn)
Definition: ScriptedEscortAI.h:102
void Initialize()
Definition: boss_grand_champions.cpp:165
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
InstanceScript * instance
Definition: boss_grand_champions.cpp:172
uint32 uiWaypointPath
Definition: boss_grand_champions.cpp:178

+ Here is the call graph for this function:

Member Function Documentation

void generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::DoCastSpellShield ( )
inline
234  {
235  for (uint8 i = 0; i < 3; ++i)
236  DoCast(me, SPELL_SHIELD, true);
237  }
Definition: boss_grand_champions.cpp:38
Creature *const me
Definition: CreatureAI.h:71
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
uint8_t uint8
Definition: Define.h:152

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

229  {
231  }
void DoCastSpellShield()
Definition: boss_grand_champions.cpp:233

+ Here is the call graph for this function:

void generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::Initialize ( void  )
inline
166  {
167  uiChargeTimer = 5000;
168  uiShieldBreakerTimer = 8000;
169  uiBuffTimer = urand(30000, 60000);
170  }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 uiChargeTimer
Definition: boss_grand_champions.cpp:174
uint32 uiShieldBreakerTimer
Definition: boss_grand_champions.cpp:175
uint32 uiBuffTimer
Definition: boss_grand_champions.cpp:176

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

181  {
182  Initialize();
183  }
void Initialize()
Definition: boss_grand_champions.cpp:165

+ Here is the call graph for this function:

void generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::SetData ( uint32  uiType,
uint32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

186  {
187  switch (uiType)
188  {
189  case 1:
190  AddWaypoint(0, 747.36f, 634.07f, 411.572f);
191  AddWaypoint(1, 780.43f, 607.15f, 411.82f);
192  AddWaypoint(2, 785.99f, 599.41f, 411.92f);
193  AddWaypoint(3, 778.44f, 601.64f, 411.79f);
194  uiWaypointPath = 1;
195  break;
196  case 2:
197  AddWaypoint(0, 747.35f, 634.07f, 411.57f);
198  AddWaypoint(1, 768.72f, 581.01f, 411.92f);
199  AddWaypoint(2, 763.55f, 590.52f, 411.71f);
200  uiWaypointPath = 2;
201  break;
202  case 3:
203  AddWaypoint(0, 747.35f, 634.07f, 411.57f);
204  AddWaypoint(1, 784.02f, 645.33f, 412.39f);
205  AddWaypoint(2, 775.67f, 641.91f, 411.91f);
206  uiWaypointPath = 3;
207  break;
208  }
209 
210  if (uiType <= 3)
211  Start(false, true);
212  }
void Start(bool isActiveAttacker=true, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=NULL, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition: ScriptedEscortAI.cpp:438
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)
Definition: ScriptedEscortAI.cpp:385
uint32 uiWaypointPath
Definition: boss_grand_champions.cpp:178

+ Here is the call graph for this function:

void generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::UpdateAI ( uint32  uiDiff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

240  {
241  npc_escortAI::UpdateAI(uiDiff);
242 
243  if (!UpdateVictim())
244  return;
245 
246  if (uiBuffTimer <= uiDiff)
247  {
248  if (!me->HasAura(SPELL_SHIELD))
250 
251  uiBuffTimer = urand(30000, 45000);
252  }else uiBuffTimer -= uiDiff;
253 
254  if (uiChargeTimer <= uiDiff)
255  {
256  Map::PlayerList const& players = me->GetMap()->GetPlayers();
257  if (!players.isEmpty())
258  {
259  for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
260  {
261  Player* player = itr->GetSource();
262  if (player && !player->IsGameMaster() && me->IsInRange(player, 8.0f, 25.0f, false))
263  {
264  DoResetThreat();
265  me->AddThreat(player, 1.0f);
266  DoCast(player, SPELL_CHARGE);
267  break;
268  }
269  }
270  }
271  uiChargeTimer = 5000;
272  }else uiChargeTimer -= uiDiff;
273 
274  //dosen't work at all
275  if (uiShieldBreakerTimer <= uiDiff)
276  {
277  Vehicle* pVehicle = me->GetVehicleKit();
278  if (!pVehicle)
279  return;
280 
281  if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0))
282  {
283  Map::PlayerList const& players = me->GetMap()->GetPlayers();
284  if (!players.isEmpty())
285  {
286  for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
287  {
288  Player* player = itr->GetSource();
289  if (player && !player->IsGameMaster() && me->IsInRange(player, 10.0f, 30.0f, false))
290  {
291  pPassenger->CastSpell(player, SPELL_SHIELD_BREAKER, true);
292  break;
293  }
294  }
295  }
296  }
297  uiShieldBreakerTimer = 7000;
298  }else uiShieldBreakerTimer -= uiDiff;
299 
301  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: Unit.cpp:10691
Definition: Vehicle.h:32
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Map * GetMap() const
Definition: Object.h:543
Definition: boss_grand_champions.cpp:80
Definition: boss_grand_champions.cpp:37
Definition: boss_grand_champions.cpp:38
iterator begin()
Definition: MapRefManager.h:37
void DoCastSpellShield()
Definition: boss_grand_champions.cpp:233
Creature *const me
Definition: CreatureAI.h:71
Unit * GetPassenger(int8 seatId) const
Gets a passenger on specified seat.
Definition: Vehicle.cpp:287
void UpdateAI(uint32 diff) override
Definition: ScriptedEscortAI.cpp:227
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 uiChargeTimer
Definition: boss_grand_champions.cpp:174
Definition: LinkedList.h:141
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: boss_grand_champions.cpp:36
bool isEmpty() const
Definition: LinkedList.h:102
uint32 uiShieldBreakerTimer
Definition: boss_grand_champions.cpp:175
PlayerList const & GetPlayers() const
Definition: Map.h:433
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
Definition: Object.cpp:1703
void DoResetThreat()
Definition: ScriptedCreature.cpp:248
Definition: MapRefManager.h:26
uint32 uiBuffTimer
Definition: boss_grand_champions.cpp:176
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
Definition: Unit.h:1305
iterator end()
Definition: MapRefManager.h:38
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165

+ Here is the call graph for this function:

void generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::WaypointReached ( uint32  waypointId)
inlineoverridevirtual

Implements npc_escortAI.

215  {
216  switch (waypointId)
217  {
218  case 2:
219  if (uiWaypointPath == 3 || uiWaypointPath == 2)
221  break;
222  case 3:
224  break;
225  }
226  }
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
InstanceScript * instance
Definition: boss_grand_champions.cpp:172
uint32 uiWaypointPath
Definition: boss_grand_champions.cpp:178
Definition: trial_of_the_champion.h:30

+ Here is the call graph for this function:

Member Data Documentation

InstanceScript* generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::instance
uint32 generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::uiBuffTimer
uint32 generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::uiChargeTimer
uint32 generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::uiShieldBreakerTimer
uint32 generic_vehicleAI_toc5::generic_vehicleAI_toc5AI::uiWaypointPath

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