TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SmartAI Class Reference

#include <SmartAI.h>

Public Member Functions

 ~SmartAI ()
 
 SmartAI (Creature *c)
 
void StartPath (bool run=false, uint32 path=0, bool repeat=false, Unit *invoker=NULL)
 
bool LoadPath (uint32 entry)
 
void PausePath (uint32 delay, bool forced=false)
 
void StopPath (uint32 DespawnTime=0, uint32 quest=0, bool fail=false)
 
void EndPath (bool fail=false)
 
void ResumePath ()
 
WayPointGetNextWayPoint ()
 
bool HasEscortState (uint32 uiEscortState) const
 
void AddEscortState (uint32 uiEscortState)
 
void RemoveEscortState (uint32 uiEscortState)
 
void SetAutoAttack (bool on)
 
void SetCombatMove (bool on)
 
bool CanCombatMove ()
 
void SetFollow (Unit *target, float dist=0.0f, float angle=0.0f, uint32 credit=0, uint32 end=0, uint32 creditType=0)
 
void StopFollow ()
 
void SetScript9 (SmartScriptHolder &e, uint32 entry, Unit *invoker)
 
SmartScriptGetScript ()
 
bool IsEscortInvokerInRange ()
 
void JustRespawned () override
 
void JustReachedHome () override
 
void EnterCombat (Unit *enemy) override
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *killer) override
 
void KilledUnit (Unit *victim) override
 
void JustSummoned (Creature *creature) override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void SpellHit (Unit *unit, const SpellInfo *spellInfo) override
 
void SpellHitTarget (Unit *target, const SpellInfo *spellInfo) override
 
void DamageTaken (Unit *doneBy, uint32 &damage) override
 
void HealReceived (Unit *doneBy, uint32 &addhealth) override
 
void UpdateAI (uint32 diff) override
 
void ReceiveEmote (Player *player, uint32 textEmote) override
 
void MovementInform (uint32 MovementType, uint32 Data) override
 
void IsSummonedBy (Unit *summoner) override
 
void DamageDealt (Unit *doneTo, uint32 &damage, DamageEffectType) override
 
void SummonedCreatureDespawn (Creature *unit) override
 
void CorpseRemoved (uint32 &respawnDelay) override
 == Triggered Actions Requested ================== More...
 
void UpdateAIWhileCharmed (const uint32 diff)
 
void PassengerBoarded (Unit *who, int8 seatId, bool apply) override
 == Fields ======================================= More...
 
void InitializeAI () override
 
void OnCharmed (bool apply) override
 
bool CanAIAttack (const Unit *who) const override
 
void DoAction (int32 param=0) override
 
uint32 GetData (uint32 id=0) const override
 
void SetData (uint32 id, uint32 value) override
 
void SetGUID (ObjectGuid guid, int32 id=0) override
 
ObjectGuid GetGUID (int32 id=0) const override
 
void MovepointReached (uint32 id)
 
void SetRun (bool run=true)
 
void SetFly (bool fly=true)
 
void SetSwim (bool swim=true)
 
void SetInvincibilityHpLevel (uint32 level)
 
void sGossipHello (Player *player) override
 
void sGossipSelect (Player *player, uint32 menuId, uint32 gossipListId) override
 
void sGossipSelectCode (Player *player, uint32 menuId, uint32 gossipListId, const char *code) override
 
void sQuestAccept (Player *player, Quest const *quest) override
 
void sQuestReward (Player *player, Quest const *quest, uint32 opt) override
 
bool sOnDummyEffect (Unit *caster, uint32 spellId, SpellEffIndex effIndex) override
 
void sOnGameEvent (bool start, uint16 eventId) override
 
void SetDespawnTime (uint32 t)
 
void StartDespawn ()
 
void OnSpellClick (Unit *clicker, bool &result) override
 
- 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 SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
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 void Reset ()
 
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 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 sQuestSelect (Player *, Quest const *)
 

Static Public Member Functions

static int Permissible (const Creature *)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 

Public Attributes

uint32 mEscortQuestID
 

Private Member Functions

void ReturnToLastOOCPos ()
 
void UpdatePath (const uint32 diff)
 
uint32 GetWPCount () const
 
bool AssistPlayerInCombat (Unit *who)
 
void UpdateDespawn (const uint32 diff)
 

Private Attributes

uint32 mFollowCreditType
 
uint32 mFollowArrivedTimer
 
uint32 mFollowCredit
 
uint32 mFollowArrivedEntry
 
ObjectGuid mFollowGuid
 
float mFollowDist
 
float mFollowAngle
 
SmartScript mScript
 
WPPathmWayPoints
 
uint32 mEscortState
 
uint32 mCurrentWPID
 
uint32 mLastWPIDReached
 
bool mWPReached
 
uint32 mWPPauseTimer
 
WayPointmLastWP
 
Position mLastOOCPos
 
bool mCanRepeatPath
 
bool mRun
 
bool mCanAutoAttack
 
bool mCanCombatMove
 
bool mForcedPaused
 
uint32 mInvincibilityHpLevel
 
uint32 mDespawnTime
 
uint32 mDespawnState
 
uint32 mEscortInvokerCheckTimer
 
bool mJustReset
 

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 Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- 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

SmartAI::~SmartAI ( )
inline
48 { }
SmartAI::SmartAI ( Creature c)
explicit
29  : CreatureAI(c)
30 {
31  // copy script to local (protection for table reload)
32 
33  mWayPoints = NULL;
35  mCurrentWPID = 0;//first wp id is 1 !!
36  mWPReached = false;
37  mWPPauseTimer = 0;
38  mLastWP = NULL;
39 
40  mCanRepeatPath = false;
41 
42  // spawn in run mode
43  me->SetWalk(false);
44  mRun = false;
45 
47 
48  mCanAutoAttack = true;
49  mCanCombatMove = true;
50 
51  mForcedPaused = false;
52  mLastWPIDReached = 0;
53 
54  mEscortQuestID = 0;
55 
56  mDespawnTime = 0;
57  mDespawnState = 0;
58 
61  mFollowDist = 0;
62  mFollowAngle = 0;
63  mFollowCredit = 0;
68 
69  mJustReset = false;
70 }
uint32 mFollowCredit
Definition: SmartAI.h:200
float mFollowAngle
Definition: SmartAI.h:204
uint32 mInvincibilityHpLevel
Definition: SmartAI.h:223
bool mForcedPaused
Definition: SmartAI.h:222
Definition: SmartAI.h:33
bool mCanRepeatPath
Definition: SmartAI.h:218
uint32 mCurrentWPID
Definition: SmartAI.h:211
uint32 mEscortQuestID
Definition: SmartAI.h:186
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 mDespawnTime
Definition: SmartAI.h:226
uint32 mFollowArrivedTimer
Definition: SmartAI.h:199
bool mCanAutoAttack
Definition: SmartAI.h:220
uint32 mWPPauseTimer
Definition: SmartAI.h:214
ObjectGuid mFollowGuid
Definition: SmartAI.h:202
Creature *const me
Definition: CreatureAI.h:71
uint32 mDespawnState
Definition: SmartAI.h:227
uint32 mFollowArrivedEntry
Definition: SmartAI.h:201
WayPoint * mLastWP
Definition: SmartAI.h:215
Position mLastOOCPos
Definition: SmartAI.h:216
void GetPosition(float &x, float &y) const
Definition: Position.h:109
uint32 mEscortState
Definition: SmartAI.h:210
bool mJustReset
Definition: SmartAI.h:230
uint32 mFollowCreditType
Definition: SmartAI.h:198
float mFollowDist
Definition: SmartAI.h:203
void Clear()
Definition: ObjectGuid.h:215
CreatureAI(Creature *creature)
Definition: CreatureAI.h:95
bool SetWalk(bool enable)
Definition: Unit.cpp:15800
bool mCanCombatMove
Definition: SmartAI.h:221
bool mWPReached
Definition: SmartAI.h:213
WPPath * mWayPoints
Definition: SmartAI.h:209
uint32 mEscortInvokerCheckTimer
Definition: SmartAI.h:229
bool mRun
Definition: SmartAI.h:219
uint32 mLastWPIDReached
Definition: SmartAI.h:212

+ Here is the call graph for this function:

Member Function Documentation

void SmartAI::AddEscortState ( uint32  uiEscortState)
inline
60 { mEscortState |= uiEscortState; }
uint32 mEscortState
Definition: SmartAI.h:210

+ Here is the caller graph for this function:

bool SmartAI::AssistPlayerInCombat ( Unit who)
private
468 {
469  if (!who || !who->GetVictim())
470  return false;
471 
472  //experimental (unknown) flag not present
474  return false;
475 
476  //not a player
478  return false;
479 
480  //never attack friendly
481  if (me->IsFriendlyTo(who))
482  return false;
483 
484  //too far away and no free sight?
486  {
487  //already fighting someone?
488  if (!me->GetVictim())
489  {
490  AttackStart(who);
491  return true;
492  }
493  else
494  {
495  who->SetInCombatWith(me);
496  me->AddThreat(who, 0.0f);
497  return true;
498  }
499  }
500 
501  return false;
502 }
Unit * EnsureVictim() const
Definition: Unit.h:1381
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: Unit.cpp:10691
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Creature *const me
Definition: CreatureAI.h:71
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:558
Definition: SharedDefines.h:3668
Unit * GetVictim() const
Definition: Unit.h:1379
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:7170
Definition: SmartAI.h:42
void AttackStart(Unit *who) override
Definition: SmartAI.cpp:577
void SetInCombatWith(Unit *enemy)
Definition: Unit.cpp:9840
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition: Unit.cpp:7560
uint32 type_flags
Definition: Creature.h:117

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::AttackStart ( Unit who)
overridevirtual

Reimplemented from UnitAI.

578 {
579  if (who && me->Attack(who, me->IsWithinMeleeRange(who)))
580  {
581  if (mCanCombatMove)
582  me->GetMotionMaster()->MoveChase(who);
583  }
584 }
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:7222
void MoveChase(Unit *target, float dist=0.0f, float angle=0.0f)
Definition: MotionMaster.cpp:241
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Creature *const me
Definition: CreatureAI.h:71
bool IsWithinMeleeRange(const Unit *obj, float dist=MELEE_RANGE) const
Definition: Unit.cpp:508
bool mCanCombatMove
Definition: SmartAI.h:221

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SmartAI::CanAIAttack ( const Unit who) const
overridevirtual

Reimplemented from UnitAI.

Reimplemented in npc_frostwing_vrykul::npc_frostwing_vrykulAI.

463 {
464  return !(me->HasReactState(REACT_PASSIVE));
465 }
Definition: Unit.h:1129
bool HasReactState(ReactStates state) const
Definition: Creature.h:504
Creature *const me
Definition: CreatureAI.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SmartAI::CanCombatMove ( )
inline
64 { return mCanCombatMove; }
bool mCanCombatMove
Definition: SmartAI.h:221
void SmartAI::CorpseRemoved ( uint32 )
overridevirtual

== Triggered Actions Requested ==================

== State checks =================================

Reimplemented from CreatureAI.

631 {
633 }
Definition: SmartScriptMgr.h:140
arena_t NULL
Definition: jemalloc_internal.h:624
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::DamageDealt ( Unit doneTo,
uint32 damage,
DamageEffectType   
)
overridevirtual

Reimplemented from UnitAI.

619 {
621 }
Definition: SmartScriptMgr.h:137
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::DamageTaken ( Unit doneBy,
uint32 damage 
)
overridevirtual

Reimplemented from UnitAI.

597 {
598  GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);
600  damage = me->GetHealth() - mInvincibilityHpLevel; // damage should not be nullified, because of player damage req.
601 }
uint32 mInvincibilityHpLevel
Definition: SmartAI.h:223
Creature *const me
Definition: CreatureAI.h:71
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
Definition: SmartScriptMgr.h:136
SmartScript * GetScript()
Definition: SmartAI.h:69
uint32 GetHealth() const
Definition: Unit.h:1426

+ Here is the call graph for this function:

void SmartAI::DoAction ( int32  param = 0)
overridevirtual

Reimplemented from UnitAI.

659 {
661 }
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:176
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::EndPath ( bool  fail = false)
191 {
193 
195  mWayPoints = NULL;
196  mCurrentWPID = 0;
197  mWPPauseTimer = 0;
198  mLastWP = NULL;
199 
200  if (mCanRepeatPath)
201  StartPath(mRun, GetScript()->GetPathId(), true);
202  else
203  GetScript()->SetPathId(0);
204 
206  if (targets && mEscortQuestID)
207  {
208  if (targets->size() == 1 && GetScript()->IsPlayer((*targets->begin())))
209  {
210  Player* player = (*targets->begin())->ToPlayer();
211  if (!fail && player->IsAtGroupRewardDistance(me) && !player->HasCorpse())
212  player->GroupEventHappens(mEscortQuestID, me);
213 
214  if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
215  player->FailQuest(mEscortQuestID);
216 
217  if (Group* group = player->GetGroup())
218  {
219  for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
220  {
221  Player* groupGuy = groupRef->GetSource();
222 
223  if (!fail && groupGuy->IsAtGroupRewardDistance(me) && !groupGuy->HasCorpse())
224  groupGuy->AreaExploredOrEventHappens(mEscortQuestID);
225  if (fail && groupGuy->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
226  groupGuy->FailQuest(mEscortQuestID);
227  }
228  }
229  }else
230  {
231  for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter)
232  {
233  if (GetScript()->IsPlayer((*iter)))
234  {
235  Player* player = (*iter)->ToPlayer();
236  if (!fail && player->IsAtGroupRewardDistance(me) && !player->HasCorpse())
237  player->AreaExploredOrEventHappens(mEscortQuestID);
238  if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
239  player->FailQuest(mEscortQuestID);
240  }
241  }
242  }
243  }
244  if (mDespawnState == 1)
245  StartDespawn();
246 }
void RemoveEscortState(uint32 uiEscortState)
Definition: SmartAI.h:61
Definition: SmartAI.h:35
Definition: SmartScriptMgr.h:54
bool mCanRepeatPath
Definition: SmartAI.h:218
uint32 mCurrentWPID
Definition: SmartAI.h:211
uint32 mEscortQuestID
Definition: SmartAI.h:186
arena_t NULL
Definition: jemalloc_internal.h:624
void StartPath(bool run=false, uint32 path=0, bool repeat=false, Unit *invoker=NULL)
Definition: SmartAI.cpp:109
void StartDespawn()
Definition: SmartAI.h:193
uint32 mWPPauseTimer
Definition: SmartAI.h:214
bool IsPlayer(WorldObject *obj)
Definition: SmartScript.h:71
uint32 id
Definition: SmartScriptMgr.h:41
Creature *const me
Definition: CreatureAI.h:71
std::list< WorldObject * > ObjectList
Definition: SmartScriptMgr.h:1391
uint32 mDespawnState
Definition: SmartAI.h:227
WayPoint * mLastWP
Definition: SmartAI.h:215
Definition: SmartAI.h:36
Definition: SmartScriptMgr.h:162
void SetPathId(uint32 id)
Definition: SmartScript.h:54
Definition: SmartAI.h:34
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
Definition: QuestDef.h:113
SmartScript * GetScript()
Definition: SmartAI.h:69
WPPath * mWayPoints
Definition: SmartAI.h:209
Definition: Group.h:191
bool mRun
Definition: SmartAI.h:219
Definition: GroupReference.h:27
ObjectList * GetTargetList(uint32 id)
Definition: SmartScript.h:140

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::EnterCombat ( Unit enemy)
overridevirtual

Reimplemented from CreatureAI.

547 {
548  me->InterruptNonMeleeSpells(false); // must be before ProcessEvents
551  SetRun(mRun);
554 }
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: SmartScriptMgr.h:108
Definition: MotionMaster.h:61
Creature *const me
Definition: CreatureAI.h:71
Position mLastOOCPos
Definition: SmartAI.h:216
void GetPosition(float &x, float &y) const
Definition: Position.h:109
MovementGeneratorType GetMotionSlotType(int slot) const
Definition: MotionMaster.cpp:671
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
SmartScript * GetScript()
Definition: SmartAI.h:69
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:151
Definition: MotionMaster.h:46
bool mRun
Definition: SmartAI.h:219

+ Here is the call graph for this function:

void SmartAI::EnterEvadeMode ( EvadeReason  why = EVADE_REASON_OTHER)
overridevirtual

Reimplemented from CreatureAI.

412 {
413  if (!me->IsAlive() || me->IsInEvadeMode())
414  return;
415 
417 
419  me->DeleteThreatList();
420  me->CombatStop(true);
425 
426  GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);//must be after aura clear so we can cast spells from db
427 
428  SetRun(mRun);
430  {
433  }
434  else if (!mFollowGuid.IsEmpty())
435  {
436  if (Unit* target = ObjectAccessor::GetUnit(*me, mFollowGuid))
438 
439  // evade is not cleared in MoveFollow, so we can't keep it
441  }
442  else
444 
445  if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
446  SetRun(mRun);
447 }
void ResetPlayerDamageReq()
Definition: Creature.h:696
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
float mFollowAngle
Definition: SmartAI.h:204
void RemoveAllAurasExceptType(AuraType type)
Definition: Unit.cpp:3997
Definition: SmartAI.h:35
void AddUnitState(uint32 f)
Definition: Unit.h:1394
Definition: SpellAuraDefines.h:307
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
void MoveTargetedHome()
Definition: MotionMaster.cpp:201
arena_t NULL
Definition: jemalloc_internal.h:624
bool IsInEvadeMode() const
Definition: Creature.h:520
Definition: SmartScriptMgr.h:111
void ReturnToLastOOCPos()
Definition: SmartAI.cpp:256
void SetLootRecipient(Unit *unit)
Definition: Creature.cpp:993
ObjectGuid mFollowGuid
Definition: SmartAI.h:202
void ClearUnitState(uint32 f)
Definition: Unit.h:1396
Creature *const me
Definition: CreatureAI.h:71
Definition: SpellAuraDefines.h:296
bool IsAlive() const
Definition: Unit.h:1692
void SetLastDamagedTime(time_t val)
Definition: Unit.h:2217
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
Definition: Unit.h:571
float mFollowDist
Definition: SmartAI.h:203
Definition: SmartAI.h:34
void DeleteThreatList()
Definition: Unit.cpp:10700
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
bool LoadCreaturesAddon()
Definition: Creature.cpp:2214
SmartScript * GetScript()
Definition: SmartAI.h:69
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:7371
Definition: Unit.h:1305
bool IsEmpty() const
Definition: ObjectGuid.h:242
void AddEscortState(uint32 uiEscortState)
Definition: SmartAI.h:60
bool mRun
Definition: SmartAI.h:219
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
Definition: MotionMaster.cpp:265

+ Here is the call graph for this function:

uint32 SmartAI::GetData ( uint32  id = 0) const
overridevirtual

Reimplemented from UnitAI.

664 {
665  return 0;
666 }
ObjectGuid SmartAI::GetGUID ( int32  id = 0) const
overridevirtual

Reimplemented from UnitAI.

676 {
677  return ObjectGuid::Empty;
678 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
WayPoint * SmartAI::GetNextWayPoint ( )
91 {
92  if (!mWayPoints || mWayPoints->empty())
93  return NULL;
94 
95  mCurrentWPID++;
96  WPPath::const_iterator itr = mWayPoints->find(mCurrentWPID);
97  if (itr != mWayPoints->end())
98  {
99  mLastWP = (*itr).second;
100  if (mLastWP->id != mCurrentWPID)
101  {
102  TC_LOG_ERROR("misc", "SmartAI::GetNextWayPoint: Got not expected waypoint id %u, expected %u", mLastWP->id, mCurrentWPID);
103  }
104  return (*itr).second;
105  }
106  return NULL;
107 }
uint32 mCurrentWPID
Definition: SmartAI.h:211
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 id
Definition: SmartScriptMgr.h:41
WayPoint * mLastWP
Definition: SmartAI.h:215
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
WPPath * mWayPoints
Definition: SmartAI.h:209

+ Here is the caller graph for this function:

SmartScript* SmartAI::GetScript ( )
inline
69 { return &mScript; }
SmartScript mScript
Definition: SmartAI.h:208

+ Here is the caller graph for this function:

uint32 SmartAI::GetWPCount ( ) const
inlineprivate
217 { return mWayPoints ? uint32(mWayPoints->size()) : 0; }
uint32_t uint32
Definition: g3dmath.h:168
WPPath * mWayPoints
Definition: SmartAI.h:209

+ Here is the caller graph for this function:

bool SmartAI::HasEscortState ( uint32  uiEscortState) const
inline
59 { return (mEscortState & uiEscortState) != 0; }
uint32 mEscortState
Definition: SmartAI.h:210

+ Here is the caller graph for this function:

void SmartAI::HealReceived ( Unit doneBy,
uint32 addhealth 
)
overridevirtual

Reimplemented from UnitAI.

604 {
605  GetScript()->ProcessEventsFor(SMART_EVENT_RECEIVE_HEAL, doneBy, addhealth);
606 }
Definition: SmartScriptMgr.h:157
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::InitializeAI ( )
overridevirtual

Reimplemented from UnitAI.

641 {
643  if (!me->isDead())
644  mJustReset = true;
645  JustReachedHome();
647 }
Definition: SmartScriptMgr.h:115
Creature *const me
Definition: CreatureAI.h:71
void OnInitialize(WorldObject *obj, AreaTriggerEntry const *at=NULL)
Definition: SmartScript.cpp:3555
bool mJustReset
Definition: SmartAI.h:230
bool isDead() const
Definition: Unit.h:1694
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
void JustReachedHome() override
Definition: SmartAI.cpp:531
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

bool SmartAI::IsEscortInvokerInRange ( )
356 {
358  if (targets)
359  {
360  if (targets->size() == 1 && GetScript()->IsPlayer((*targets->begin())))
361  {
362  Player* player = (*targets->begin())->ToPlayer();
364  return true;
365 
366  if (Group* group = player->GetGroup())
367  {
368  for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
369  {
370  Player* groupGuy = groupRef->GetSource();
371 
372  if (me->GetDistance(groupGuy) <= SMART_ESCORT_MAX_PLAYER_DIST)
373  return true;
374  }
375  }
376  }else
377  {
378  for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter)
379  {
380  if (GetScript()->IsPlayer((*iter)))
381  {
382  if (me->GetDistance((*iter)->ToPlayer()) <= SMART_ESCORT_MAX_PLAYER_DIST)
383  return true;
384  }
385  }
386  }
387  }
388  return true;//escort targets were not set, ignore range check
389 }
Definition: SmartScriptMgr.h:54
Definition: SmartAI.h:41
arena_t NULL
Definition: jemalloc_internal.h:624
bool IsPlayer(WorldObject *obj)
Definition: SmartScript.h:71
Creature *const me
Definition: CreatureAI.h:71
std::list< WorldObject * > ObjectList
Definition: SmartScriptMgr.h:1391
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1594
SmartScript * GetScript()
Definition: SmartAI.h:69
Definition: Group.h:191
Definition: GroupReference.h:27
ObjectList * GetTargetList(uint32 id)
Definition: SmartScript.h:140

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::IsSummonedBy ( Unit summoner)
overridevirtual

Reimplemented from CreatureAI.

614 {
616 }
Definition: SmartScriptMgr.h:158
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::JustDied ( Unit killer)
overridevirtual

Reimplemented from CreatureAI.

557 {
560  {
561  EndPath(true);
562  me->StopMoving();//force stop
564  }
565 }
void MoveIdle()
Definition: MotionMaster.cpp:185
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Creature *const me
Definition: CreatureAI.h:71
Definition: SmartScriptMgr.h:110
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
Definition: SmartAI.h:34
void EndPath(bool fail=false)
Definition: SmartAI.cpp:190
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743

+ Here is the call graph for this function:

void SmartAI::JustReachedHome ( )
overridevirtual

Reimplemented from CreatureAI.

532 {
533  GetScript()->OnReset();
534 
535  if (!mJustReset)
536  {
538 
541  }
542 
543  mJustReset = false;
544 }
Definition: SmartScriptMgr.h:125
Definition: MotionMaster.h:37
bool UpdateVictim()
Definition: CreatureAI.cpp:233
uint32 GetWaypointPath() const
Definition: Creature.h:680
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
void OnReset()
Definition: SmartScript.cpp:66
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition: MotionMaster.cpp:663
Creature *const me
Definition: CreatureAI.h:71
bool mJustReset
Definition: SmartAI.h:230
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
void MovePath(uint32 path_id, bool repeatable)
Definition: MotionMaster.cpp:618
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::JustRespawned ( )
overridevirtual

Reimplemented from CreatureAI.

505 {
506  mDespawnTime = 0;
507  mDespawnState = 0;
509  me->SetVisible(true);
511  me->RestoreFaction();
512  mJustReset = true;
513  JustReachedHome();
515  mFollowGuid.Clear();//do not reset follower on Reset(), we need it after combat evade
516  mFollowDist = 0;
517  mFollowAngle = 0;
518  mFollowCredit = 0;
519  mFollowArrivedTimer = 1000;
521  mFollowCreditType = 0;
522 }
uint32 mFollowCredit
Definition: SmartAI.h:200
float mFollowAngle
Definition: SmartAI.h:204
uint32 getFaction() const
Definition: Unit.h:1466
Definition: SmartScriptMgr.h:115
Definition: SmartAI.h:33
uint32 mDespawnTime
Definition: SmartAI.h:226
uint32 mFollowArrivedTimer
Definition: SmartAI.h:199
uint32 faction
Definition: Creature.h:97
ObjectGuid mFollowGuid
Definition: SmartAI.h:202
Creature *const me
Definition: CreatureAI.h:71
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:558
uint32 mDespawnState
Definition: SmartAI.h:227
uint32 mFollowArrivedEntry
Definition: SmartAI.h:201
void RestoreFaction()
Definition: Unit.cpp:14277
void SetVisible(bool x)
Definition: Unit.cpp:10368
uint32 mEscortState
Definition: SmartAI.h:210
bool mJustReset
Definition: SmartAI.h:230
uint32 mFollowCreditType
Definition: SmartAI.h:198
float mFollowDist
Definition: SmartAI.h:203
void Clear()
Definition: ObjectGuid.h:215
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
void JustReachedHome() override
Definition: SmartAI.cpp:531
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::JustSummoned ( Creature creature)
overridevirtual

Reimplemented from CreatureAI.

573 {
575 }
Definition: SmartScriptMgr.h:121
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::KilledUnit ( Unit victim)
overridevirtual

Reimplemented from CreatureAI.

568 {
570 }
Definition: SmartScriptMgr.h:109
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

bool SmartAI::LoadPath ( uint32  entry)
138 {
140  return false;
141  mWayPoints = sSmartWaypointMgr->GetPath(entry);
142  if (!mWayPoints)
143  {
144  GetScript()->SetPathId(0);
145  return false;
146  }
147  GetScript()->SetPathId(entry);
148  return true;
149 }
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
void SetPathId(uint32 id)
Definition: SmartScript.h:54
#define sSmartWaypointMgr
Definition: SmartScriptMgr.h:1670
Definition: SmartAI.h:34
SmartScript * GetScript()
Definition: SmartAI.h:69
WPPath * mWayPoints
Definition: SmartAI.h:209

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::MoveInLineOfSight ( Unit who)
overridevirtual

Reimplemented from CreatureAI.

450 {
451  if (!who)
452  return;
453 
455 
456  if (AssistPlayerInCombat(who))
457  return;
458 
460 }
bool AssistPlayerInCombat(Unit *who)
Definition: SmartAI.cpp:467
void OnMoveInLineOfSight(Unit *who)
Definition: SmartScript.cpp:3597
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:128
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::MovementInform ( uint32  MovementType,
uint32  Data 
)
overridevirtual

Reimplemented from CreatureAI.

401 {
402  if ((MovementType == POINT_MOTION_TYPE && Data == SMART_ESCORT_LAST_OOC_POINT) || MovementType == FOLLOW_MOTION_TYPE)
404 
407  return;
409 }
void MovepointReached(uint32 id)
Definition: SmartAI.cpp:391
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:138
void ClearUnitState(uint32 f)
Definition: Unit.h:1396
Creature *const me
Definition: CreatureAI.h:71
Definition: SmartScriptMgr.h:52
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
Definition: Unit.h:571
Definition: SmartAI.h:34
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
Definition: MotionMaster.h:46
Data
Definition: molten_core.h:69
Definition: MotionMaster.h:52

+ Here is the call graph for this function:

void SmartAI::MovepointReached ( uint32  id)
392 {
395 
396  mLastWPIDReached = id;
397  mWPReached = true;
398 }
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:52
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
bool mWPReached
Definition: SmartAI.h:213
Definition: SmartScriptMgr.h:144
uint32 mLastWPIDReached
Definition: SmartAI.h:212

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::OnCharmed ( bool  apply)
overridevirtual

Reimplemented from CreatureAI.

650 {
652 
653  if (!apply && !me->IsInEvadeMode() && !me->GetCharmerGUID().IsEmpty())
654  if (Unit* charmer = ObjectAccessor::GetUnit(*me, me->GetCharmerGUID()))
655  AttackStart(charmer);
656 }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
arena_t NULL
Definition: jemalloc_internal.h:624
bool IsInEvadeMode() const
Definition: Creature.h:520
ObjectGuid GetCharmerGUID() const
Definition: Unit.h:1704
void apply(T *val)
Definition: ByteConverter.h:41
Creature *const me
Definition: CreatureAI.h:71
void AttackStart(Unit *who) override
Definition: SmartAI.cpp:577
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
Definition: SmartScriptMgr.h:133
Definition: Unit.h:1305
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void SmartAI::OnSpellClick ( Unit clicker,
bool result 
)
overridevirtual

Reimplemented from CreatureAI.

808 {
809  if (!result)
810  return;
811 
813 }
Definition: SmartScriptMgr.h:177
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::PassengerBoarded ( Unit ,
int8  ,
bool   
)
overridevirtual

== Fields =======================================

Reimplemented from CreatureAI.

636 {
638 }
Definition: SmartScriptMgr.h:131
void apply(T *val)
Definition: ByteConverter.h:41
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
Definition: SmartScriptMgr.h:132
SmartScript * GetScript()
Definition: SmartAI.h:69
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

void SmartAI::PausePath ( uint32  delay,
bool  forced = false 
)
152 {
154  return;
156  {
157  TC_LOG_ERROR("misc", "SmartAI::StartPath: Creature entry %u wanted to pause waypoint movement while already paused, ignoring.", me->GetEntry());
158  return;
159  }
160  mForcedPaused = forced;
163  mWPPauseTimer = delay;
164  if (forced)
165  {
166  SetRun(mRun);
167  me->StopMoving();//force stop
168  me->GetMotionMaster()->MoveIdle();//force stop
169  }
171 }
void MoveIdle()
Definition: MotionMaster.cpp:185
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
bool mForcedPaused
Definition: SmartAI.h:222
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 mWPPauseTimer
Definition: SmartAI.h:214
uint32 id
Definition: SmartScriptMgr.h:41
Creature *const me
Definition: CreatureAI.h:71
WayPoint * mLastWP
Definition: SmartAI.h:215
Definition: SmartAI.h:36
Position mLastOOCPos
Definition: SmartAI.h:216
void GetPosition(float &x, float &y) const
Definition: Position.h:109
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
Definition: SmartAI.h:34
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: SmartScriptMgr.h:159
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743
void AddEscortState(uint32 uiEscortState)
Definition: SmartAI.h:60
bool mRun
Definition: SmartAI.h:219

+ Here is the call graph for this function:

int SmartAI::Permissible ( const Creature creature)
static
525 {
526  if (creature->GetAIName() == "SmartAI")
527  return PERMIT_BASE_SPECIAL;
528  return PERMIT_BASE_NO;
529 }
Definition: CreatureAI.h:207
Definition: CreatureAI.h:212
std::string GetAIName() const
Definition: Creature.cpp:2417

+ Here is the call graph for this function:

void SmartAI::ReceiveEmote ( Player player,
uint32  textEmote 
)
overridevirtual

Reimplemented from CreatureAI.

609 {
611 }
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
Definition: SmartScriptMgr.h:126

+ Here is the call graph for this function:

void SmartAI::RemoveEscortState ( uint32  uiEscortState)
inline
61 { mEscortState &= ~uiEscortState; }
uint32 mEscortState
Definition: SmartAI.h:210

+ Here is the caller graph for this function:

void SmartAI::ResumePath ( )
249 {
250  //mWPReached = false;
251  SetRun(mRun);
252  if (mLastWP)
254 }
float x
Definition: SmartScriptMgr.h:42
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
float z
Definition: SmartScriptMgr.h:44
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 id
Definition: SmartScriptMgr.h:41
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
WayPoint * mLastWP
Definition: SmartAI.h:215
float y
Definition: SmartScriptMgr.h:43
bool mRun
Definition: SmartAI.h:219

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::ReturnToLastOOCPos ( )
private
257 {
258  SetRun(mRun);
260 }
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: SmartScriptMgr.h:52
Position mLastOOCPos
Definition: SmartAI.h:216
bool mRun
Definition: SmartAI.h:219

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::SetAutoAttack ( bool  on)
inline
62 { mCanAutoAttack = on; }
bool mCanAutoAttack
Definition: SmartAI.h:220
void SmartAI::SetCombatMove ( bool  on)
725 {
726  if (mCanCombatMove == on)
727  return;
728  mCanCombatMove = on;
730  {
731  if (on && me->GetVictim())
732  {
734  {
735  SetRun(mRun);
737  me->CastStop();
738  }
739  }
740  else
741  {
743  return;
744 
746  me->GetMotionMaster()->Clear(true);
747  me->StopMoving();
749  }
750  }
751 }
Definition: MotionMaster.h:37
void MoveIdle()
Definition: MotionMaster.cpp:185
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
void Clear(bool reset=true)
Definition: MotionMaster.h:138
void MoveChase(Unit *target, float dist=0.0f, float angle=0.0f)
Definition: MotionMaster.cpp:241
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition: MotionMaster.cpp:663
Definition: Unit.h:574
void CastStop(uint32 except_spellid=0)
Definition: Unit.cpp:862
Creature *const me
Definition: CreatureAI.h:71
Definition: Unit.h:573
Unit * GetVictim() const
Definition: Unit.h:1379
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
Definition: SmartAI.h:34
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
bool mCanCombatMove
Definition: SmartAI.h:221
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:151
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743
bool mRun
Definition: SmartAI.h:219

+ Here is the call graph for this function:

void SmartAI::SetData ( uint32  id,
uint32  value 
)
overridevirtual

Reimplemented from UnitAI.

669 {
671 }
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:142
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

void SmartAI::SetDespawnTime ( uint32  t)
inline
189  {
190  mDespawnTime = t;
191  mDespawnState = t ? 1 : 0;
192  }
uint32 mDespawnTime
Definition: SmartAI.h:226
uint32 mDespawnState
Definition: SmartAI.h:227

+ Here is the caller graph for this function:

void SmartAI::SetFly ( bool  fly = true)
687 {
688  me->SetDisableGravity(fly);
689 }
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
Creature *const me
Definition: CreatureAI.h:71

+ Here is the call graph for this function:

void SmartAI::SetFollow ( Unit target,
float  dist = 0.0f,
float  angle = 0.0f,
uint32  credit = 0,
uint32  end = 0,
uint32  creditType = 0 
)
754 {
755  if (!target)
756  {
757  StopFollow();
758  return;
759  }
760 
761  SetRun(mRun);
762  mFollowGuid = target->GetGUID();
763  mFollowDist = dist >= 0.0f ? dist : PET_FOLLOW_DIST;
764  mFollowAngle = angle >= 0.0f ? angle : me->GetFollowAngle();
765  mFollowArrivedTimer = 1000;
766  mFollowCredit = credit;
767  mFollowArrivedEntry = end;
769  mFollowCreditType = creditType;
770 }
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
uint32 mFollowCredit
Definition: SmartAI.h:200
float mFollowAngle
Definition: SmartAI.h:204
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 mFollowArrivedTimer
Definition: SmartAI.h:199
ObjectGuid mFollowGuid
Definition: SmartAI.h:202
Creature *const me
Definition: CreatureAI.h:71
uint32 mFollowArrivedEntry
Definition: SmartAI.h:201
uint32 mFollowCreditType
Definition: SmartAI.h:198
float mFollowDist
Definition: SmartAI.h:203
ObjectGuid const & GetGUID() const
Definition: Object.h:105
void StopFollow()
Definition: SmartAI.cpp:772
#define PET_FOLLOW_DIST
Definition: PetDefines.h:77
bool mRun
Definition: SmartAI.h:219
virtual float GetFollowAngle() const
Definition: Unit.h:2194
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
Definition: MotionMaster.cpp:265

+ Here is the call graph for this function:

void SmartAI::SetGUID ( ObjectGuid  guid,
int32  id = 0 
)
overridevirtual

Reimplemented from UnitAI.

673 { }
void SmartAI::SetInvincibilityHpLevel ( uint32  level)
inline
175 { mInvincibilityHpLevel = level; }
uint32 mInvincibilityHpLevel
Definition: SmartAI.h:223

+ Here is the caller graph for this function:

void SmartAI::SetRun ( bool  run = true)
681 {
682  me->SetWalk(!run);
683  mRun = run;
684 }
Creature *const me
Definition: CreatureAI.h:71
bool SetWalk(bool enable)
Definition: Unit.cpp:15800
bool mRun
Definition: SmartAI.h:219

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::SetScript9 ( SmartScriptHolder e,
uint32  entry,
Unit invoker 
)
796 {
797  if (invoker)
798  GetScript()->mLastInvoker = invoker->GetGUID();
799  GetScript()->SetScript9(e, entry);
800 }
ObjectGuid mLastInvoker
Definition: SmartScript.h:236
ObjectGuid const & GetGUID() const
Definition: Object.h:105
void SetScript9(SmartScriptHolder &e, uint32 entry)
Definition: SmartScript.cpp:3702
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::SetSwim ( bool  swim = true)
692 {
693  me->SetSwim(swim);
694 }
bool SetSwim(bool enable)
Definition: Unit.cpp:15880
Creature *const me
Definition: CreatureAI.h:71

+ Here is the call graph for this function:

void SmartAI::sGossipHello ( Player player)
overridevirtual

Reimplemented from UnitAI.

697 {
699 }
Definition: SmartScriptMgr.h:168
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::sGossipSelect ( Player player,
uint32  menuId,
uint32  gossipListId 
)
overridevirtual

Reimplemented from UnitAI.

702 {
703  GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, menuId, gossipListId);
704 }
Definition: SmartScriptMgr.h:166
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::sGossipSelectCode ( Player player,
uint32  menuId,
uint32  gossipListId,
const char *  code 
)
overridevirtual

Reimplemented from UnitAI.

706 { }
bool SmartAI::sOnDummyEffect ( Unit caster,
uint32  spellId,
SpellEffIndex  effIndex 
)
overridevirtual

Reimplemented from UnitAI.

719 {
720  GetScript()->ProcessEventsFor(SMART_EVENT_DUMMY_EFFECT, caster, spellId, (uint32)effIndex);
721  return true;
722 }
Definition: SmartScriptMgr.h:170
uint32_t uint32
Definition: Define.h:150
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::sOnGameEvent ( bool  start,
uint16  eventId 
)
overridevirtual

Reimplemented from UnitAI.

803 {
805 }
Definition: SmartScriptMgr.h:173
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SmartScriptMgr.h:172
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::SpellHit ( Unit unit,
const SpellInfo spellInfo 
)
overridevirtual

Reimplemented from CreatureAI.

587 {
588  GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT, unit, 0, 0, false, spellInfo);
589 }
Definition: SmartScriptMgr.h:112
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::SpellHitTarget ( Unit target,
const SpellInfo spellInfo 
)
overridevirtual

Reimplemented from CreatureAI.

592 {
593  GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT_TARGET, target, 0, 0, false, spellInfo);
594 }
Definition: SmartScriptMgr.h:135
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::sQuestAccept ( Player player,
Quest const quest 
)
overridevirtual

Reimplemented from UnitAI.

709 {
710  GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId());
711 }
Definition: SmartScriptMgr.h:123
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::sQuestReward ( Player player,
Quest const quest,
uint32  opt 
)
overridevirtual

Reimplemented from UnitAI.

714 {
715  GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt);
716 }
Definition: SmartScriptMgr.h:124
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::StartDespawn ( )
inline
193 { mDespawnState = 2; }
uint32 mDespawnState
Definition: SmartAI.h:227

+ Here is the caller graph for this function:

void SmartAI::StartPath ( bool  run = false,
uint32  path = 0,
bool  repeat = false,
Unit invoker = NULL 
)
110 {
111  if (me->IsInCombat())// no wp movement in combat
112  {
113  TC_LOG_ERROR("misc", "SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
114  return;
115  }
117  StopPath();
118  if (path)
119  if (!LoadPath(path))
120  return;
121  if (!mWayPoints || mWayPoints->empty())
122  return;
123 
125  mCanRepeatPath = repeat;
126 
127  SetRun(run);
128 
129  if (WayPoint* wp = GetNextWayPoint())
130  {
132  me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
134  }
135 }
void StopPath(uint32 DespawnTime=0, uint32 quest=0, bool fail=false)
Definition: SmartAI.cpp:173
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
Definition: SmartScriptMgr.h:143
bool mCanRepeatPath
Definition: SmartAI.h:218
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
bool IsInCombat() const
Definition: Unit.h:1584
arena_t NULL
Definition: jemalloc_internal.h:624
WayPoint * GetNextWayPoint()
Definition: SmartAI.cpp:90
Definition: SmartScriptMgr.h:31
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Position mLastOOCPos
Definition: SmartAI.h:216
void GetPosition(float &x, float &y) const
Definition: Position.h:109
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
Definition: SmartAI.h:34
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
uint32 GetEntry() const
Definition: Object.h:107
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
WPPath * mWayPoints
Definition: SmartAI.h:209
bool LoadPath(uint32 entry)
Definition: SmartAI.cpp:137
void AddEscortState(uint32 uiEscortState)
Definition: SmartAI.h:60

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::StopFollow ( )
773 {
775  {
776  if (!mFollowCreditType)
777  player->RewardPlayerAndGroupAtEvent(mFollowCredit, me);
778  else
779  player->GroupEventHappens(mFollowCredit, me);
780  }
781 
782  mFollowGuid.Clear();
783  mFollowDist = 0;
784  mFollowAngle = 0;
785  mFollowCredit = 0;
786  mFollowArrivedTimer = 1000;
788  mFollowCreditType = 0;
789  SetDespawnTime(5000);
790  me->StopMoving();
792  StartDespawn();
794 }
void MoveIdle()
Definition: MotionMaster.cpp:185
uint32 mFollowCredit
Definition: SmartAI.h:200
float mFollowAngle
Definition: SmartAI.h:204
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 mFollowArrivedTimer
Definition: SmartAI.h:199
void StartDespawn()
Definition: SmartAI.h:193
Definition: SmartScriptMgr.h:169
ObjectGuid mFollowGuid
Definition: SmartAI.h:202
Creature *const me
Definition: CreatureAI.h:71
uint32 mFollowArrivedEntry
Definition: SmartAI.h:201
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
void SetDespawnTime(uint32 t)
Definition: SmartAI.h:188
uint32 mFollowCreditType
Definition: SmartAI.h:198
float mFollowDist
Definition: SmartAI.h:203
void Clear()
Definition: ObjectGuid.h:215
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::StopPath ( uint32  DespawnTime = 0,
uint32  quest = 0,
bool  fail = false 
)
174 {
176  return;
177 
178  if (quest)
179  mEscortQuestID = quest;
180  SetDespawnTime(DespawnTime);
181  //mDespawnTime = DespawnTime;
182 
184  me->StopMoving();//force stop
187  EndPath(fail);
188 }
Definition: SmartScriptMgr.h:161
void MoveIdle()
Definition: MotionMaster.cpp:185
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 mEscortQuestID
Definition: SmartAI.h:186
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 id
Definition: SmartScriptMgr.h:41
Creature *const me
Definition: CreatureAI.h:71
WayPoint * mLastWP
Definition: SmartAI.h:215
Position mLastOOCPos
Definition: SmartAI.h:216
void GetPosition(float &x, float &y) const
Definition: Position.h:109
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
void SetDespawnTime(uint32 t)
Definition: SmartAI.h:188
Definition: SmartAI.h:34
void EndPath(bool fail=false)
Definition: SmartAI.cpp:190
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::SummonedCreatureDespawn ( Creature unit)
overridevirtual

Reimplemented from CreatureAI.

624 {
626 }
Definition: SmartScriptMgr.h:139
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
SmartScript * GetScript()
Definition: SmartAI.h:69

+ Here is the call graph for this function:

void SmartAI::UpdateAI ( uint32  diff)
overridevirtual
Todo:
move to void

Implements UnitAI.

326 {
327  GetScript()->OnUpdate(diff);
328  UpdatePath(diff);
329  UpdateDespawn(diff);
330 
332  if (!mFollowGuid.IsEmpty())
333  {
334  if (mFollowArrivedTimer < diff)
335  {
337  {
338  StopFollow();
339  return;
340  }
341 
342  mFollowArrivedTimer = 1000;
343  }
344  else
345  mFollowArrivedTimer -= diff;
346  }
347 
348  if (!UpdateVictim())
349  return;
350 
351  if (mCanAutoAttack)
353 }
#define INTERACTION_DISTANCE
Definition: Object.h:34
void OnUpdate(const uint32 diff)
Definition: SmartScript.cpp:3441
bool UpdateVictim()
Definition: CreatureAI.cpp:233
uint32 mFollowArrivedTimer
Definition: SmartAI.h:199
bool mCanAutoAttack
Definition: SmartAI.h:220
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2443
ObjectGuid mFollowGuid
Definition: SmartAI.h:202
Creature *const me
Definition: CreatureAI.h:71
uint32 mFollowArrivedEntry
Definition: SmartAI.h:201
void UpdateDespawn(const uint32 diff)
Definition: SmartAI.cpp:72
void StopFollow()
Definition: SmartAI.cpp:772
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
SmartScript * GetScript()
Definition: SmartAI.h:69
void UpdatePath(const uint32 diff)
Definition: SmartAI.cpp:262
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void SmartAI::UpdateAIWhileCharmed ( const uint32  diff)
628 { }
void SmartAI::UpdateDespawn ( const uint32  diff)
private
73 {
74  if (mDespawnState <= 1 || mDespawnState > 3)
75  return;
76 
77  if (mDespawnTime < diff)
78  {
79  if (mDespawnState == 2)
80  {
81  me->SetVisible(false);
82  mDespawnTime = 5000;
83  mDespawnState++;
84  }
85  else
87  } else mDespawnTime -= diff;
88 }
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
Definition: Creature.cpp:1774
uint32 mDespawnTime
Definition: SmartAI.h:226
Creature *const me
Definition: CreatureAI.h:71
uint32 mDespawnState
Definition: SmartAI.h:227
void SetVisible(bool x)
Definition: Unit.cpp:10368

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SmartAI::UpdatePath ( const uint32  diff)
private
263 {
265  return;
266  if (mEscortInvokerCheckTimer < diff)
267  {
268  if (!IsEscortInvokerInRange())
269  {
271  }
273  } else mEscortInvokerCheckTimer -= diff;
274  // handle pause
276  {
277  if (mWPPauseTimer < diff)
278  {
280  {
283  if (mForcedPaused)// if paused between 2 wps resend movement
284  {
285  ResumePath();
286  mWPReached = false;
287  mForcedPaused = false;
288  }
290  mWPReached = true;
291  }
292  mWPPauseTimer = 0;
293  } else {
294  mWPPauseTimer -= diff;
295  }
296  }
298  {
299  if (mWPReached)//reached OOC WP
300  {
303  ResumePath();
304  mWPReached = false;
305  }
306  }
308  return;
309  // handle next wp
310  if (mWPReached)//reached WP
311  {
312  mWPReached = false;
313  if (mCurrentWPID == GetWPCount())
314  {
315  EndPath();
316  }
317  else if (WayPoint* wp = GetNextWayPoint())
318  {
319  SetRun(mRun);
320  me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
321  }
322  }
323 }
void StopPath(uint32 DespawnTime=0, uint32 quest=0, bool fail=false)
Definition: SmartAI.cpp:173
void RemoveEscortState(uint32 uiEscortState)
Definition: SmartAI.h:61
void SetRun(bool run=true)
Definition: SmartAI.cpp:680
Definition: SmartAI.h:35
Definition: Unit.h:1129
bool mForcedPaused
Definition: SmartAI.h:222
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
bool IsInCombat() const
Definition: Unit.h:1584
bool IsEscortInvokerInRange()
Definition: SmartAI.cpp:355
uint32 mCurrentWPID
Definition: SmartAI.h:211
uint32 mEscortQuestID
Definition: SmartAI.h:186
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 mDespawnTime
Definition: SmartAI.h:226
bool HasReactState(ReactStates state) const
Definition: Creature.h:504
WayPoint * GetNextWayPoint()
Definition: SmartAI.cpp:90
Definition: SmartScriptMgr.h:160
uint32 mWPPauseTimer
Definition: SmartAI.h:214
Definition: SmartScriptMgr.h:31
uint32 id
Definition: SmartScriptMgr.h:41
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
WayPoint * mLastWP
Definition: SmartAI.h:215
Definition: SmartAI.h:36
Definition: SmartScriptMgr.h:52
bool HasEscortState(uint32 uiEscortState) const
Definition: SmartAI.h:59
Definition: SmartAI.h:34
void EndPath(bool fail=false)
Definition: SmartAI.cpp:190
void ProcessEventsFor(SMART_EVENT e, Unit *unit=NULL, uint32 var0=0, uint32 var1=0, bool bvar=false, const SpellInfo *spell=NULL, GameObject *gob=NULL)
Definition: SmartScript.cpp:83
uint32 GetWPCount() const
Definition: SmartAI.h:217
void ResumePath()
Definition: SmartAI.cpp:248
SmartScript * GetScript()
Definition: SmartAI.h:69
bool mWPReached
Definition: SmartAI.h:213
uint32 mEscortInvokerCheckTimer
Definition: SmartAI.h:229
bool mRun
Definition: SmartAI.h:219
uint32 mLastWPIDReached
Definition: SmartAI.h:212

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool SmartAI::mCanAutoAttack
private
bool SmartAI::mCanCombatMove
private
bool SmartAI::mCanRepeatPath
private
uint32 SmartAI::mCurrentWPID
private
uint32 SmartAI::mDespawnState
private
uint32 SmartAI::mDespawnTime
private
uint32 SmartAI::mEscortInvokerCheckTimer
private
uint32 SmartAI::mEscortQuestID
uint32 SmartAI::mEscortState
private
float SmartAI::mFollowAngle
private
uint32 SmartAI::mFollowArrivedEntry
private
uint32 SmartAI::mFollowArrivedTimer
private
uint32 SmartAI::mFollowCredit
private
uint32 SmartAI::mFollowCreditType
private
float SmartAI::mFollowDist
private
ObjectGuid SmartAI::mFollowGuid
private
bool SmartAI::mForcedPaused
private
uint32 SmartAI::mInvincibilityHpLevel
private
bool SmartAI::mJustReset
private
Position SmartAI::mLastOOCPos
private
WayPoint* SmartAI::mLastWP
private
uint32 SmartAI::mLastWPIDReached
private
bool SmartAI::mRun
private
SmartScript SmartAI::mScript
private
WPPath* SmartAI::mWayPoints
private
uint32 SmartAI::mWPPauseTimer
private
bool SmartAI::mWPReached
private

The documentation for this class was generated from the following files: