public void Teleport(RealmTime time, int objId)
{
var obj = Owner.GetEntity(objId);
if (obj == null) return;
if (!TPCooledDown())
{
SendError("Too soon to teleport again!");
return;
}
if (obj.HasConditionEffect(ConditionEffects.Invisible))
{
SendError("Cannot teleport to invisible players");
return;
}
SetTPDisabledPeriod();
if (Pet != null)
Pet.Move(X, Y);
Move(obj.X, obj.Y);
fames.Teleport();
SetNewbiePeriod();
UpdateCount++;
Owner.BroadcastPacket(new GotoPacket
{
ObjectId = Id,
Position = new Position
{
X = X,
Y = Y
}
}, null);
Owner.BroadcastPacket(new ShowEffectPacket
{
EffectType = EffectType.Teleport,
TargetId = Id,
PosA = new Position
{
X = X,
Y = Y
},
Color = new ARGB(0xFFFFFFFF)
}, null);
}