public static void LastLoc_Command(CommandEventArgs e)
{
PlayerMobile pm = e.Mobile as PlayerMobile;
if (pm != null && pm.Companion)
{
if (pm.CompanionLastLocation != Point3D.Zero)
{
if (pm.Criminal)
{
pm.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
}
else if (SpellHelper.CheckCombat(pm, true))
{
pm.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
}
else if (!SpellHelper.CheckTravel(pm, TravelCheckType.RecallFrom))
{
pm.SendMessage("Companions may not teleport away from this location");
}
else
{
CommandLogging.WriteLine(pm, "{0} {1} teleporting from {2} to {3}", pm.AccessLevel, CommandLogging.Format(pm), new Point3D(pm.Location), pm.CompanionLastLocation);
pm.Location = pm.CompanionLastLocation;
pm.CompanionLastLocation = Point3D.Zero;
}
}
else
{
pm.SendAsciiMessage("You must first teleport to a new player before returning to your last location.");
}
}
}