Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
ScriptedFollowerAI.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SC_FOLLOWERAI_H
7#define SC_FOLLOWERAI_H
8
9#include "ScriptSystem.h"
10
12{
14 STATE_FOLLOW_INPROGRESS = 0x001, //must always have this state for any follow
15 STATE_FOLLOW_RETURNING = 0x002, //when returning to combat start after being in combat
16 STATE_FOLLOW_PAUSED = 0x004, //disables following
17 STATE_FOLLOW_COMPLETE = 0x008, //follow is completed and may end
18 STATE_FOLLOW_PREEVENT = 0x010, //not implemented (allow pre event to run, before follow is initiated)
19 STATE_FOLLOW_POSTEVENT = 0x020 //can be set at complete and allow post event to run
20};
21
22class FollowerAI : public ScriptedAI
23{
24public:
25 explicit FollowerAI(Creature* creature);
27
28 //virtual void WaypointReached(uint32 uiPointId) = 0;
29
30 void MovementInform(uint32 motionType, uint32 pointId) OVERRIDE;
31
33
35
37
38 void JustDied(Unit*) OVERRIDE;
39
41
42 void UpdateAI(uint32) OVERRIDE; //the "internal" update, calls UpdateFollowerAI()
43 virtual void UpdateFollowerAI(uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
44
45 void StartFollow(Player* player, uint32 factionForFollower = 0, const Quest* quest = NULL);
46
47 void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow
48 void SetFollowComplete(bool bWithEndEvent = false);
49
50 bool HasFollowState(uint32 uiFollowState) const { return (m_uiFollowState & uiFollowState); }
51
52protected:
54
55private:
56 void AddFollowState(uint32 uiFollowState) { m_uiFollowState |= uiFollowState; }
57 void RemoveFollowState(uint32 uiFollowState) { m_uiFollowState &= ~uiFollowState; }
58
59 bool AssistPlayerInCombat(Unit* who);
60
64
65 const Quest* m_pQuestForFollow; //normally we have a quest
66};
67
68#endif
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
@ STATE_FOLLOW_PREEVENT
@ STATE_FOLLOW_COMPLETE
@ STATE_FOLLOW_POSTEVENT
@ STATE_FOLLOW_NONE
@ STATE_FOLLOW_INPROGRESS
@ STATE_FOLLOW_PAUSED
@ STATE_FOLLOW_RETURNING
void SetFollowPaused(bool bPaused)
uint32 m_uiUpdateFollowTimer
void MovementInform(uint32 motionType, uint32 pointId) OVERRIDE
void JustDied(Unit *) OVERRIDE
void JustRespawned() OVERRIDE
const Quest * m_pQuestForFollow
void MoveInLineOfSight(Unit *) OVERRIDE
virtual void UpdateFollowerAI(uint32)
void EnterEvadeMode() OVERRIDE
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void RemoveFollowState(uint32 uiFollowState)
void AttackStart(Unit *) OVERRIDE
Player * GetLeaderForFollower()
void SetFollowComplete(bool bWithEndEvent=false)
bool AssistPlayerInCombat(Unit *who)
FollowerAI(Creature *creature)
void StartFollow(Player *player, uint32 factionForFollower=0, const Quest *quest=NULL)
bool HasFollowState(uint32 uiFollowState) const
void AddFollowState(uint32 uiFollowState)
Definition Unit.h:1367
ScriptedAI(Creature *creature)