コード例 #1
0
        private static void OnRegionChange(Player player, uint newRX, uint newRY)
        {
            Region r = Regions[newRX + (player.RegionX - newRX) * 1][newRY + (player.RegionY - newRY) * 1];

            if (r != null)
            {
                for (int i = 0; i < r.Npcs.Count; i++)
                {
                    ClientPacketHandler.send_EntityAck(GObjectManager.Npcs[r.Npcs[i]]);
                    ClientPacketHandler.send_EntityState(player, GObjectManager.Npcs[r.Npcs[i]].Handle, 0x0);
                    ClientPacketHandler.send_Packet516(player, GObjectManager.Npcs[r.Npcs[i]].Handle);
                }
            }

            player.RegionX = newRX;
            player.RegionY = newRY;

            ClientPacketHandler.send_RegionAck(player, newRX, newRY);
        }