Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
11
enum
eFollowState
12
{
13
STATE_FOLLOW_NONE
= 0x000,
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
22
class
FollowerAI
:
public
ScriptedAI
23
{
24
public
:
25
explicit
FollowerAI
(
Creature
* creature);
26
~FollowerAI
() { }
27
28
//virtual void WaypointReached(uint32 uiPointId) = 0;
29
30
void
MovementInform
(
uint32
motionType,
uint32
pointId)
OVERRIDE
;
31
32
void
AttackStart
(
Unit
*)
OVERRIDE
;
33
34
void
MoveInLineOfSight
(
Unit
*)
OVERRIDE
;
35
36
void
EnterEvadeMode
()
OVERRIDE
;
37
38
void
JustDied
(
Unit
*)
OVERRIDE
;
39
40
void
JustRespawned
()
OVERRIDE
;
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
52
protected
:
53
Player
*
GetLeaderForFollower
();
54
55
private
:
56
void
AddFollowState
(
uint32
uiFollowState) {
m_uiFollowState
|= uiFollowState; }
57
void
RemoveFollowState
(
uint32
uiFollowState) {
m_uiFollowState
&= ~uiFollowState; }
58
59
bool
AssistPlayerInCombat
(
Unit
* who);
60
61
uint64
m_uiLeaderGUID
;
62
uint32
m_uiUpdateFollowTimer
;
63
uint32
m_uiFollowState
;
64
65
const
Quest
*
m_pQuestForFollow
;
//normally we have a quest
66
};
67
68
#endif
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
uint64
std::uint64_t uint64
Definition
Define.h:76
ScriptSystem.h
eFollowState
eFollowState
Definition
ScriptedFollowerAI.h:12
STATE_FOLLOW_PREEVENT
@ STATE_FOLLOW_PREEVENT
Definition
ScriptedFollowerAI.h:18
STATE_FOLLOW_COMPLETE
@ STATE_FOLLOW_COMPLETE
Definition
ScriptedFollowerAI.h:17
STATE_FOLLOW_POSTEVENT
@ STATE_FOLLOW_POSTEVENT
Definition
ScriptedFollowerAI.h:19
STATE_FOLLOW_NONE
@ STATE_FOLLOW_NONE
Definition
ScriptedFollowerAI.h:13
STATE_FOLLOW_INPROGRESS
@ STATE_FOLLOW_INPROGRESS
Definition
ScriptedFollowerAI.h:14
STATE_FOLLOW_PAUSED
@ STATE_FOLLOW_PAUSED
Definition
ScriptedFollowerAI.h:16
STATE_FOLLOW_RETURNING
@ STATE_FOLLOW_RETURNING
Definition
ScriptedFollowerAI.h:15
Creature
Definition
Creature.h:427
FollowerAI::SetFollowPaused
void SetFollowPaused(bool bPaused)
Definition
ScriptedFollowerAI.cpp:364
FollowerAI::m_uiUpdateFollowTimer
uint32 m_uiUpdateFollowTimer
Definition
ScriptedFollowerAI.h:62
FollowerAI::MovementInform
void MovementInform(uint32 motionType, uint32 pointId) OVERRIDE
Definition
ScriptedFollowerAI.cpp:258
FollowerAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
ScriptedFollowerAI.cpp:121
FollowerAI::JustRespawned
void JustRespawned() OVERRIDE
Definition
ScriptedFollowerAI.cpp:148
FollowerAI::m_pQuestForFollow
const Quest * m_pQuestForFollow
Definition
ScriptedFollowerAI.h:65
FollowerAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *) OVERRIDE
Definition
ScriptedFollowerAI.cpp:91
FollowerAI::m_uiLeaderGUID
uint64 m_uiLeaderGUID
Definition
ScriptedFollowerAI.h:61
FollowerAI::UpdateFollowerAI
virtual void UpdateFollowerAI(uint32)
Definition
ScriptedFollowerAI.cpp:250
FollowerAI::EnterEvadeMode
void EnterEvadeMode() OVERRIDE
Definition
ScriptedFollowerAI.cpp:161
FollowerAI::UpdateAI
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
Definition
ScriptedFollowerAI.cpp:188
FollowerAI::m_uiFollowState
uint32 m_uiFollowState
Definition
ScriptedFollowerAI.h:63
FollowerAI::RemoveFollowState
void RemoveFollowState(uint32 uiFollowState)
Definition
ScriptedFollowerAI.h:57
FollowerAI::AttackStart
void AttackStart(Unit *) OVERRIDE
Definition
ScriptedFollowerAI.cpp:32
FollowerAI::GetLeaderForFollower
Player * GetLeaderForFollower()
Definition
ScriptedFollowerAI.cpp:313
FollowerAI::SetFollowComplete
void SetFollowComplete(bool bWithEndEvent=false)
Definition
ScriptedFollowerAI.cpp:342
FollowerAI::~FollowerAI
~FollowerAI()
Definition
ScriptedFollowerAI.h:26
FollowerAI::AssistPlayerInCombat
bool AssistPlayerInCombat(Unit *who)
Definition
ScriptedFollowerAI.cpp:54
FollowerAI::FollowerAI
FollowerAI(Creature *creature)
Definition
ScriptedFollowerAI.cpp:25
FollowerAI::StartFollow
void StartFollow(Player *player, uint32 factionForFollower=0, const Quest *quest=NULL)
Definition
ScriptedFollowerAI.cpp:275
FollowerAI::HasFollowState
bool HasFollowState(uint32 uiFollowState) const
Definition
ScriptedFollowerAI.h:50
FollowerAI::AddFollowState
void AddFollowState(uint32 uiFollowState)
Definition
ScriptedFollowerAI.h:56
Player
Definition
Player.h:1289
Quest
Definition
QuestDef.h:255
Unit
Definition
Unit.h:1367
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
src
server
game
AI
ScriptedAI
ScriptedFollowerAI.h
Generated on
for Project SkyFire Core by
1.17.0