wServer.realm.entities.player.Player.Teleport C# (CSharp) Method

Teleport() public method

public Teleport ( RealmTime time, int objId ) : void
time RealmTime
objId int
return void
        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);
        }

Same methods

Player::Teleport ( RealmTime time, wServer.cliPackets.TeleportPacket pkt ) : void