Teleport() публичный Метод

public Teleport ( RealmTime time, TeleportPacket pkt ) : void
time RealmTime
pkt TeleportPacket
Результат void
Пример #1
0
        private static void Handle(Player player, RealmTime time, int objId)
        {
            if (player?.Owner == null)
            {
                return;
            }

            player.Teleport(time, objId);
        }
Пример #2
0
        protected override bool Process(Player player, RealmTime time, string args)
        {
            if (player.Name.EqualsIgnoreCase(args))
            {
                player.SendInfo("You are already at yourself, and always will be!");
                return false;
            }

            foreach (var i in player.Owner.Players)
            {
                if (i.Value.Name.EqualsIgnoreCase(args))
                {
                    player.Teleport(time, i.Value.Id);
                    return true;
                }
            }
            player.SendInfo(string.Format("Unable to find player: {0}", args));
            return false;
        }
Пример #3
0
        protected override bool Process(Player player, RealmTime time, string args)
        {
            if (player.Name.EqualsIgnoreCase(args))
            {
                player.SendInfo("You are already at yourself, and always will be!");
                return false;
            }
            if (player.Owner.AllowTeleport == false)
            {
                player.SendError("You are not allowed to teleport in this area!");
                return false;
            }

            foreach (var i in player.Owner.Players)
            {
                if (i.Value.Name.EqualsIgnoreCase(args))
                {
                    if (i.Value.isNotVisible)
                    {
                        player.SendInfo(string.Format("Unable to find player: {0}", args));
                        return false;
                    }
                    if (i.Value.HasConditionEffect(ConditionEffects.Invisible))
                    {
                        player.SendError("You can't teleport to invisible players");
                        return false;
                    }
                    player.Teleport(time, i.Value.Id);
                    return true;
                }
            }
            player.SendInfo(string.Format("Unable to find player: {0}", args));
            return false;
        }