예제 #1
0
        public override void click(Character character)
        {
            var player = character as Player;

            if (player == null)
            {
                return;
            }
            if (!Working && DisabledMessage != "")
            {
                Packet.Builder.LegacyModule(player.GetGameSession(), "0|A|STD|" + DisabledMessage);
                return;
            }

            if (player.Group == null)
            {
                //TODO Send message player not in group
                return;
            }

            // If any other group member has the gate
            var groupMemberWithGateInitiated =
                player.Group.Members.FirstOrDefault(x => x.Value.OwnedGates.Any(y => y.Value is LowGate));

            if (groupMemberWithGateInitiated.Value != null)
            {
                var low = groupMemberWithGateInitiated.Value.OwnedGates.FirstOrDefault(x => x.Value is LowGate);
                if (low.Value.VWID != 0 && low.Value.VirtualMap != null)
                {
                    player.Controller.Miscs.Jump(low.Value.Spacemap.Id, Destination, Id, low.Value.VWID);
                    low.Value.PendingPlayers.TryAdd(player.Id, player);
                }
            }
            else
            {
                var low = new LowGate(0, World.StorageManager.Spacemaps[200]);
                low.DefineOwner(player);
                low.InitiateVirtualWorld();
                player.Controller.Miscs.Jump(low.Spacemap.Id, Destination, Id, low.VWID);
                low.PendingPlayers.TryAdd(player.Id, player);
            }
        }
예제 #2
0
        public override void click(Character character)
        {
            var player = character as Player;

            if (player == null)
            {
                return;
            }
            if (player.Group == null)
            {
                //TODO Send message player not in group
                return;
            }

            // If any other group member has the gate
            var groupMemberWithGateInitiated =
                player.Group.Members.FirstOrDefault(x => x.Value.OwnedGates.Any(y => y.Value is LowGate));

            if (groupMemberWithGateInitiated.Value != null)
            {
                var low = groupMemberWithGateInitiated.Value.OwnedGates.FirstOrDefault(x => x.Value is LowGate);
                if (low.Value.VWID != 0 && low.Value.VirtualMap != null)
                {
                    player.Controller.Miscs.Jump(low.Value.Spacemap.Id, Destination, Id, low.Value.VWID);
                    low.Value.PendingPlayers.TryAdd(player.Id, player);
                }
            }
            else
            {
                var low = new LowGate(0, World.StorageManager.Spacemaps[200]);
                player.CreateGalaxyGate(low);
                low.InitiateVirtualWorld();
                player.Controller.Miscs.Jump(low.Spacemap.Id, Destination, Id, low.VWID);
                low.PendingPlayers.TryAdd(player.Id, player);
            }
        }