*add new functions to escortAI (does not effect old escort scripts)

--HG--
branch : trunk
This commit is contained in:
Rat
2009-08-10 15:27:42 +02:00
parent 7faff34ae5
commit 66d7fa3431
2 changed files with 16 additions and 4 deletions

View File

@@ -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();

View File

@@ -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: