Example #1
0
        /// <summary>
        /// Reads the block data from the underlying stream.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public override void Read(BinaryReader reader)
        {
            base.Read(reader);

            AI = reader.ReadInt32();
            ConversationFile = reader.ReadByteString();
        }
Example #2
0
        /// <summary>
        /// Reads the block data from the underlying stream.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public override void Read(BinaryReader reader)
        {
            base.Read(reader);

            FilePath = reader.ReadByteString();
            Range = reader.ReadInt32();
            Interval = reader.ReadInt32();
        }
Example #3
0
        /// <summary>
        /// Loads the file from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        public override void Load(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream, Encoding.GetEncoding("EUC-KR"));

            int blockCount = reader.ReadInt32();

            for (int i = 0; i < blockCount; i++) {
                ZoneBlock type = (ZoneBlock)reader.ReadInt32();
                int offset = reader.ReadInt32();

                long nextBlock = stream.Position;
                stream.Seek(offset, SeekOrigin.Begin);

                switch (type) {
                    case ZoneBlock.Info:
                        Type = (ZoneType)reader.ReadInt32();
                        Width = reader.ReadInt32();
                        Height = reader.ReadInt32();
                        GridCount = reader.ReadInt32();
                        GridSize = reader.ReadSingle();
                        StartPosition = new IntVector2(reader.ReadInt32(), reader.ReadInt32());

                        for (int w = 0; w < Width; w++) {
                            for (int h = 0; h < Height; h++) {
                                Positions[w, h].IsUsed = reader.ReadBoolean();
                                Positions[w, h].Position = reader.ReadVector2();
                            }
                        }
                        break;
                    case ZoneBlock.SpawnPoints:
                        int spawnCount = reader.ReadInt32();

                        for (int j = 0; j < spawnCount; j++) {
                            SpawnPoint spawnPoint = new SpawnPoint();
                            spawnPoint.Position = reader.ReadVector3();
                            spawnPoint.Name = reader.ReadByteString();

                            SpawnPoints.Add(spawnPoint);
                        }
                        break;
                    case ZoneBlock.Textures:
                        int textureCount = reader.ReadInt32();

                        for (int j = 0; j < textureCount; j++) {
                            Textures.Add(reader.ReadByteString());
                        }
                        break;
                    case ZoneBlock.Tiles:
                        int tileCount = reader.ReadInt32();

                        for (int j = 0; j < tileCount; j++) {
                            ZoneTile tile = new ZoneTile();
                            tile.Layer1 = reader.ReadInt32();
                            tile.Layer2 = reader.ReadInt32();
                            tile.Offset1 = reader.ReadInt32();
                            tile.Offset2 = reader.ReadInt32();
                            tile.BlendingEnabled = reader.ReadInt32() != 0;
                            tile.Rotation = (TileRotation)reader.ReadInt32();
                            tile.TileType = reader.ReadInt32();

                            Tiles.Add(tile);
                        }
                        break;
                    case ZoneBlock.Economy:
                        Name = reader.ReadByteString();
                        IsUnderground = reader.ReadInt32() != 0;
                        BackgroundMusicFilePath = reader.ReadByteString();
                        SkyFilePath = reader.ReadByteString();
                        EconomyCheckRate = reader.ReadInt32();
                        PopulationBase = reader.ReadInt32();
                        PopulationGrowthRate = reader.ReadInt32();
                        MetalConsumption = reader.ReadInt32();
                        StoneConsumption = reader.ReadInt32();
                        WoodConsumption = reader.ReadInt32();
                        LeatherConsumption = reader.ReadInt32();
                        ClothConsumption = reader.ReadInt32();
                        AlchemyConsumption = reader.ReadInt32();
                        ChemicalConsumption = reader.ReadInt32();
                        IndustrialConsumption = reader.ReadInt32();
                        MedicineConsumption = reader.ReadInt32();
                        FoodConsumption = reader.ReadInt32();
                        break;
                }

                if (i < blockCount - 1) {
                    stream.Seek(nextBlock, SeekOrigin.Begin);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Reads the block data from the underlying stream.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public override void Read(BinaryReader reader)
        {
            base.Read(reader);

            SpawnName = reader.ReadByteString();
            int normalCount = reader.ReadInt32();

            for (int i = 0; i < normalCount; i++) {
                MonsterSpawnPoint spawn = new MonsterSpawnPoint();
                spawn.Name = reader.ReadByteString();
                spawn.Monster = reader.ReadInt32();
                spawn.Count = reader.ReadInt32();

                NormalSpawnPoints.Add(spawn);
            }

            int tacticalCount = reader.ReadInt32();

            for (int i = 0; i < tacticalCount; i++) {
                MonsterSpawnPoint spawn = new MonsterSpawnPoint();
                spawn.Name = reader.ReadByteString();
                spawn.Monster = reader.ReadInt32();
                spawn.Count = reader.ReadInt32();

                TacticalSpawnPoints.Add(spawn);
            }

            Interval = reader.ReadInt32();
            Limit = reader.ReadInt32();
            Range = reader.ReadInt32();
            TacticalVariable = reader.ReadInt32();
        }
Example #5
0
 /// <summary>
 /// Reads the block data from the underlying stream.
 /// </summary>
 /// <param name="reader">The reader.</param>
 public virtual void Read(BinaryReader reader)
 {
     Name = reader.ReadByteString();
     WarpID = reader.ReadInt16();
     EventID = reader.ReadInt16();
     ObjectType = reader.ReadInt32();
     ObjectID = reader.ReadInt32();
     MapPosition = new IntVector2(reader.ReadInt32(), reader.ReadInt32());
     Rotation = reader.ReadQuaternion();
     Position = reader.ReadVector3();
     Scale = reader.ReadVector3();
 }
Example #6
0
        /// <summary>
        /// Reads the block data from the underlying stream.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public override void Read(BinaryReader reader)
        {
            base.Read(reader);

            FilePath = reader.ReadByteString();
        }