mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
*add new functions to escortAI (does not effect old escort scripts)
--HG-- branch : trunk
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user