diff options
author | Rat <none@none> | 2009-08-10 15:27:42 +0200 |
---|---|---|
committer | Rat <none@none> | 2009-08-10 15:27:42 +0200 |
commit | 66d7fa3431498f4ffba6f4775df2b70e69267e8a (patch) | |
tree | fc5c84103716bc6d77fbc5c1d4e1d6cbff3e3a0c /src | |
parent | 7faff34ae5a51b854536ef597b51c19e3754523e (diff) |
*add new functions to escortAI (does not effect old escort scripts)
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/npc/npc_escortAI.cpp | 13 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/npc/npc_escortAI.h | 7 |
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: |