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

Public Member Functions

 npc_scarlet_minerAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void IsSummonedBy (Unit *summoner) override
 
void InitWaypoint ()
 
void SetGUID (ObjectGuid guid, int32) override
 
void WaypointReached (uint32 waypointId) override
 
void UpdateAI (uint32 diff) 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 EnterCombat (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 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 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 SetData (uint32, uint32)
 
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

uint32 IntroTimer
 
uint32 IntroPhase
 
ObjectGuid carGUID
 
- 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

npc_scarlet_miner::npc_scarlet_minerAI::npc_scarlet_minerAI ( Creature creature)
inline
1101  : npc_escortAI(creature)
1102  {
1103  Initialize();
1105  }
npc_escortAI(Creature *creature)
Definition: ScriptedEscortAI.cpp:37
Definition: Unit.h:1129
Creature *const me
Definition: CreatureAI.h:71
void Initialize()
Definition: chapter1.cpp:1107
void SetReactState(ReactStates st)
Definition: Creature.h:502

+ Here is the call graph for this function:

Member Function Documentation

void npc_scarlet_miner::npc_scarlet_minerAI::Initialize ( void  )
inline
1108  {
1109  carGUID.Clear();
1110  IntroTimer = 0;
1111  IntroPhase = 0;
1112  }
ObjectGuid carGUID
Definition: chapter1.cpp:1116
uint32 IntroTimer
Definition: chapter1.cpp:1114
void Clear()
Definition: ObjectGuid.h:215
uint32 IntroPhase
Definition: chapter1.cpp:1115

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_scarlet_miner::npc_scarlet_minerAI::InitWaypoint ( )
inline
1129  {
1130  AddWaypoint(1, 2389.03f, -5902.74f, 109.014f, 5000);
1131  AddWaypoint(2, 2341.812012f, -5900.484863f, 102.619743f);
1132  AddWaypoint(3, 2306.561279f, -5901.738281f, 91.792419f);
1133  AddWaypoint(4, 2300.098389f, -5912.618652f, 86.014885f);
1134  AddWaypoint(5, 2294.142090f, -5927.274414f, 75.316849f);
1135  AddWaypoint(6, 2286.984375f, -5944.955566f, 63.714966f);
1136  AddWaypoint(7, 2280.001709f, -5961.186035f, 54.228283f);
1137  AddWaypoint(8, 2259.389648f, -5974.197754f, 42.359348f);
1138  AddWaypoint(9, 2242.882812f, -5984.642578f, 32.827850f);
1139  AddWaypoint(10, 2217.265625f, -6028.959473f, 7.675705f);
1140  AddWaypoint(11, 2202.595947f, -6061.325684f, 5.882018f);
1141  AddWaypoint(12, 2188.974609f, -6080.866699f, 3.370027f);
1142 
1143  if (urand(0, 1))
1144  {
1145  AddWaypoint(13, 2176.483887f, -6110.407227f, 1.855181f);
1146  AddWaypoint(14, 2172.516602f, -6146.752441f, 1.074235f);
1147  AddWaypoint(15, 2138.918457f, -6158.920898f, 1.342926f);
1148  AddWaypoint(16, 2129.866699f, -6174.107910f, 4.380779f);
1149  AddWaypoint(17, 2117.709473f, -6193.830078f, 13.3542f, 10000);
1150  }
1151  else
1152  {
1153  AddWaypoint(13, 2184.190186f, -6166.447266f, 0.968877f);
1154  AddWaypoint(14, 2234.265625f, -6163.741211f, 0.916021f);
1155  AddWaypoint(15, 2268.071777f, -6158.750977f, 1.822252f);
1156  AddWaypoint(16, 2270.028320f, -6176.505859f, 6.340538f);
1157  AddWaypoint(17, 2271.739014f, -6195.401855f, 13.3542f, 10000);
1158  }
1159  }
void AddWaypoint(uint32 id, float x, float y, float z, uint32 waitTime=0)
Definition: ScriptedEscortAI.cpp:385
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void npc_scarlet_miner::npc_scarlet_minerAI::IsSummonedBy ( Unit summoner)
inlineoverridevirtual

Reimplemented from CreatureAI.

1124  {
1125  carGUID = summoner->GetGUID();
1126  }
ObjectGuid carGUID
Definition: chapter1.cpp:1116
ObjectGuid const & GetGUID() const
Definition: Object.h:105

+ Here is the call graph for this function:

void npc_scarlet_miner::npc_scarlet_minerAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

1119  {
1120  Initialize();
1121  }
void Initialize()
Definition: chapter1.cpp:1107

+ Here is the call graph for this function:

void npc_scarlet_miner::npc_scarlet_minerAI::SetGUID ( ObjectGuid  guid,
int32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

1162  {
1163  InitWaypoint();
1164  Start(false, false, guid);
1165  SetDespawnAtFar(false);
1166  }
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 InitWaypoint()
Definition: chapter1.cpp:1128
void SetDespawnAtFar(bool despawn)
Definition: ScriptedEscortAI.h:103

+ Here is the call graph for this function:

void npc_scarlet_miner::npc_scarlet_minerAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from npc_escortAI.

1196  {
1197  if (IntroPhase)
1198  {
1199  if (IntroTimer <= diff)
1200  {
1201  if (IntroPhase == 1)
1202  {
1204  DoCast(car, SPELL_CART_DRAG);
1205  IntroTimer = 800;
1206  IntroPhase = 2;
1207  }
1208  else
1209  {
1211  car->AI()->DoAction(0);
1212  IntroPhase = 0;
1213  }
1214  }
1215  else
1216  IntroTimer -= diff;
1217  }
1218  npc_escortAI::UpdateAI(diff);
1219  }
Definition: Creature.h:467
ObjectGuid carGUID
Definition: chapter1.cpp:1116
Creature *const me
Definition: CreatureAI.h:71
void UpdateAI(uint32 diff) override
Definition: ScriptedEscortAI.cpp:227
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
uint32 IntroTimer
Definition: chapter1.cpp:1114
uint32 IntroPhase
Definition: chapter1.cpp:1115
Definition: chapter1.cpp:1011

+ Here is the call graph for this function:

void npc_scarlet_miner::npc_scarlet_minerAI::WaypointReached ( uint32  waypointId)
inlineoverridevirtual

Implements npc_escortAI.

1169  {
1170  switch (waypointId)
1171  {
1172  case 1:
1174  me->SetFacingToObject(car);
1176  SetRun(true);
1177  IntroTimer = 4000;
1178  IntroPhase = 1;
1179  break;
1180  case 17:
1182  {
1183  me->SetFacingToObject(car);
1184  car->Relocate(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ() + 1);
1185  car->StopMoving();
1186  car->RemoveAura(SPELL_CART_DRAG);
1187  }
1189  break;
1190  default:
1191  break;
1192  }
1193  }
Definition: chapter1.cpp:1091
ObjectGuid carGUID
Definition: chapter1.cpp:1116
Creature *const me
Definition: CreatureAI.h:71
void SetFacingToObject(WorldObject const *object)
Definition: Unit.cpp:15787
float GetPositionZ() const
Definition: Position.h:106
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void SetRun(bool on=true)
Definition: ScriptedEscortAI.cpp:417
uint32 IntroTimer
Definition: chapter1.cpp:1114
uint32 IntroPhase
Definition: chapter1.cpp:1115
Definition: chapter1.cpp:1090
Definition: Unit.h:1305
Definition: chapter1.cpp:1011

+ Here is the call graph for this function:

Member Data Documentation

ObjectGuid npc_scarlet_miner::npc_scarlet_minerAI::carGUID
uint32 npc_scarlet_miner::npc_scarlet_minerAI::IntroPhase
uint32 npc_scarlet_miner::npc_scarlet_minerAI::IntroTimer

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