Esempio n. 1
0
        public static void SwitchSeamlessMaps(Client client, IMap map, int x, int y)
        {
            if (x > map.MaxX)
            {
                x = map.MaxX;
            }
            if (y > map.MaxY)
            {
                y = map.MaxY;
            }

            ScriptManager.InvokeSub("OnMapLoad", client, client.Player.Map, map, client.Player.LoggedIn);

            IMap oldMap = client.Player.Map;

            Messenger.SendLeaveMap(client, oldMap, false, false);

            client.Player.MapID = map.MapID;
            client.Player.X     = x;
            client.Player.Y     = y;

            // Sets it so we know to process npcs on the map
            map.PlayersOnMap.Add(client.Player.CharID);
            MapManager.AddActiveMap(map);
            MapManager.LoadBorderingMaps(map);

            //client.Player.GettingMap = true;
            Messenger.SendDataTo(client, PMDCP.Sockets.TcpPacket.CreatePacket("seamlessmapchange"));
            Messenger.SendCheckForMap(client);

            //SendInventory(client);// removed
            //SendWornEquipment(client);

            if (map.Tile[x, y].Type == Enums.TileType.Story)
            {
                StoryManager.PlayStory(client, map.Tile[x, y].Data1);
            }
        }