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

Public Member Functions

 npc_snufflenose_gopherAI (Creature *creature)
 
void Reset () override
 
void MovementInform (uint32 type, uint32 id) override
 
void DoFindNewTubber ()
 
void UpdateAI (uint32 diff) override
 
void DoAction (int32 action) override
 
- Public Member Functions inherited from PetAI
 PetAI (Creature *c)
 
void KilledUnit (Unit *) override
 
void AttackStart (Unit *target) override
 
void OwnerAttackedBy (Unit *attacker) override
 
void OwnerAttacked (Unit *target) override
 
void AttackedBy (Unit *attacker) override
 
void ReceiveEmote (Player *player, uint32 textEmote) override
 
void MoveInLineOfSight (Unit *) override
 
void MoveInLineOfSight_Safe (Unit *)
 
void EnterEvadeMode (EvadeReason) 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 EnterCombat (Unit *)
 
virtual void JustDied (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
 
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 uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
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 DamageTaken (Unit *, uint32 &)
 
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

bool IsMovementActive
 
ObjectGuid TargetTubberGUID
 

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 PetAI
static int Permissible (const Creature *)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- 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

npc_snufflenose_gopher::npc_snufflenose_gopherAI::npc_snufflenose_gopherAI ( Creature creature)
inline
159  : PetAI(creature)
160  {
161  IsMovementActive = false;
162  }
bool IsMovementActive
Definition: razorfen_kraul.cpp:228
PetAI(Creature *c)
Definition: PetAI.cpp:40

Member Function Documentation

void npc_snufflenose_gopher::npc_snufflenose_gopherAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

222  {
223  if (action == ACTION_FIND_NEW_TUBBER)
224  DoFindNewTubber();
225  }
Definition: razorfen_kraul.cpp:143
void DoFindNewTubber()
Definition: razorfen_kraul.cpp:187

+ Here is the call graph for this function:

void npc_snufflenose_gopher::npc_snufflenose_gopherAI::DoFindNewTubber ( )
inline
188  {
189  std::list<GameObject*> tubbersInRange;
190  GetGameObjectListWithEntryInGrid(tubbersInRange, me, GO_BLUELEAF_TUBBER, 40.0f);
191 
192  if (tubbersInRange.empty())
193  return;
194 
195  tubbersInRange.remove_if([](GameObject* go)
196  {
198  });
199 
200  tubbersInRange.sort(Trinity::ObjectDistanceOrderPred(me));
201 
202  GameObject* nearestTubber = tubbersInRange.front();
203  if (!nearestTubber)
204  return;
205 
206  TargetTubberGUID = nearestTubber->GetGUID();
207 
208  // XFurry was wrong...
209  me->GetMotionMaster()->MovePoint(POINT_TUBBER, nearestTubber->GetPositionX(),
210  nearestTubber->GetPositionY(),
211  nearestTubber->GetPositionZ());
212  IsMovementActive = true;
213  }
Definition: SharedDefines.h:2123
Definition: razorfen_kraul.cpp:142
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: Object.h:668
ObjectGuid TargetTubberGUID
Definition: razorfen_kraul.cpp:229
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
float GetPositionY() const
Definition: Position.h:105
float GetPositionZ() const
Definition: Position.h:106
Definition: GameObject.h:880
Definition: razorfen_kraul.cpp:144
Definition: UpdateFields.h:319
bool IsMovementActive
Definition: razorfen_kraul.cpp:228
ObjectGuid const & GetGUID() const
Definition: Object.h:105
bool isSpawned() const
Definition: GameObject.h:951
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:1239
float GetPositionX() const
Definition: Position.h:104
TC_GAME_API void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:626

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_snufflenose_gopher::npc_snufflenose_gopherAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from PetAI.

171  {
172  if (type == POINT_MOTION_TYPE && id == POINT_TUBBER)
173  {
175  {
176  go->SetRespawnTime(5 * MINUTE);
177  go->Refresh();
178  go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
179  }
180 
181  IsMovementActive = false;
182  }
183  else
184  PetAI::MovementInform(type, id);
185  }
Map * GetMap() const
Definition: Object.h:543
Definition: SharedDefines.h:2123
ObjectGuid TargetTubberGUID
Definition: razorfen_kraul.cpp:229
Definition: Common.h:97
Creature *const me
Definition: CreatureAI.h:71
void MovementInform(uint32 moveType, uint32 data) override
Definition: PetAI.cpp:485
Definition: GameObject.h:880
Definition: razorfen_kraul.cpp:144
Definition: UpdateFields.h:319
bool IsMovementActive
Definition: razorfen_kraul.cpp:228
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3545
Definition: MotionMaster.h:46

+ Here is the call graph for this function:

void npc_snufflenose_gopher::npc_snufflenose_gopherAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

165  {
166  IsMovementActive = false;
168  }
ObjectGuid TargetTubberGUID
Definition: razorfen_kraul.cpp:229
bool IsMovementActive
Definition: razorfen_kraul.cpp:228
void Clear()
Definition: ObjectGuid.h:215

+ Here is the call graph for this function:

void npc_snufflenose_gopher::npc_snufflenose_gopherAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from PetAI.

216  {
217  if (!IsMovementActive)
218  PetAI::UpdateAI(diff);
219  }
bool IsMovementActive
Definition: razorfen_kraul.cpp:228
void UpdateAI(uint32) override
Definition: PetAI.cpp:74

+ Here is the call graph for this function:

Member Data Documentation

bool npc_snufflenose_gopher::npc_snufflenose_gopherAI::IsMovementActive
ObjectGuid npc_snufflenose_gopher::npc_snufflenose_gopherAI::TargetTubberGUID

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