Core/Movement: waypoint movement

Port From (https://github.com/TrinityCore/TrinityCore/commit/97585597f0b1aff93873fe4d757556731bc0c1b2)
This commit is contained in:
hondacrx
2020-08-24 17:02:02 -04:00
parent c9e535bb3a
commit 3d3fd0f55f
31 changed files with 960 additions and 950 deletions
+42
View File
@@ -105,6 +105,21 @@ namespace Game.Entities
ForcedDespawn(0);
}
public override void PauseMovement(uint timer = 0, MovementSlot slot = 0)
{
base.PauseMovement(timer, slot);
SetHomePosition(GetPosition());
}
public bool IsReturningHome()
{
if (GetMotionMaster().GetMotionSlotType(MovementSlot.Active) == MovementGeneratorType.Home)
return true;
return false;
}
public void SearchFormation()
{
if (IsSummon())
@@ -119,6 +134,33 @@ namespace Game.Entities
FormationMgr.AddCreatureToGroup(frmdata.leaderGUID, this);
}
public bool IsFormationLeader()
{
if (m_formation == null)
return false;
return m_formation.IsLeader(this);
}
public void SignalFormationMovement(Position destination, uint id = 0, WaypointMoveType moveType = 0, bool orientation = false)
{
if (m_formation == null)
return;
if (!m_formation.IsLeader(this))
return;
m_formation.LeaderMoveTo(destination, id, moveType, orientation);
}
public bool IsFormationLeaderMoveAllowed()
{
if (m_formation == null)
return false;
return m_formation.CanLeaderStartMoving();
}
public void RemoveCorpse(bool setSpawnTime = true, bool destroyForNearbyPlayers = true)
{
if (GetDeathState() != DeathState.Corpse)