aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/npc/npc_escortAI.cpp13
-rw-r--r--src/bindings/scripts/scripts/npc/npc_escortAI.h7
2 files changed, 16 insertions, 4 deletions
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
index b93fada1931..b74f0858515 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.cpp
@@ -53,6 +53,13 @@ void npc_escortAI::JustRespawned()
Reset();
}
+void npc_escortAI::ReturnToLastPoint()
+{
+ float x, y, z, o;
+ m_creature->GetHomePosition(x, y, z, o);
+ m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, x, y, z);
+}
+
void npc_escortAI::EnterEvadeMode()
{
m_creature->RemoveAllAuras();
@@ -63,10 +70,8 @@ void npc_escortAI::EnterEvadeMode()
if (IsBeingEscorted)
{
Returning = true;
- float x, y, z, o;
- m_creature->GetHomePosition(x, y, z, o);
- m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, x, y, z);
- debug_log("TSCR: EscortAI has left combat and is now returning to last point %f %f %f.", x, y, z);
+ ReturnToLastPoint();
+ debug_log("TSCR: EscortAI has left combat and is now returning to last point");
}
else
m_creature->GetMotionMaster()->MoveTargetedHome();
diff --git a/src/bindings/scripts/scripts/npc/npc_escortAI.h b/src/bindings/scripts/scripts/npc/npc_escortAI.h
index fe352b6e277..fc848665f3b 100644
--- a/src/bindings/scripts/scripts/npc/npc_escortAI.h
+++ b/src/bindings/scripts/scripts/npc/npc_escortAI.h
@@ -44,6 +44,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
void JustRespawned();
+ void ReturnToLastPoint();
+
void EnterEvadeMode();
void UpdateAI(const uint32);
@@ -67,6 +69,11 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI
void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; }
void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; }
bool GetAttack() { return Attack; }//used in EnterEvadeMode override
+ bool GetIsBeingEscorted() { return IsBeingEscorted; }//used in EnterEvadeMode override
+ void SetReturning(bool returning) { Returning = returning; }//used in EnterEvadeMode override
+ void SetCanAttack(bool attack) { Attack = attack; }
+ void SetCanDefend(bool defend) { Defend = defend; }
+ uint64 GetEventStarterGUID() { return PlayerGUID; }
// EscortAI variables
protected: