Hello thank you for your answer. This is my first TCD editor and i dont have any experience with coding. So i make some mistakes.
ok....So i repair FSBinaryReader.cs like this:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Reflection.Metadata.Ecma335;
namespace WinFormsApp1
{
class FourStoryBinaryReader : BinaryReader
{
public FourStoryBinaryReader(Stream input) : base(input)
{
}
public override string ReadString()
{
Byte[] StringB = new byte[base.ReadUInt16()];
for (int i = 0; i < StringB.Length; i++)
{
StringB[i] = base.ReadByte();
}
return System.Text.Encoding.Default.GetString(StringB);
}
}
}
In second part... do you mean this code?:
Code:
private void safe(Stream s)
{
FourStoryBinaryWriter bw = new FourStoryBinaryWriter(s);
bw.Write(Convert.ToUInt16(l.Count));
for (int i = 0; i < l.Count; i++)
{
bw.Write(l[i].ItemID);
bw.Write("String");
}
}
bcs i trully forgot complete this side of code, so next thank you xD
And the third part what do you mean? this?:
Code:
private void load(Stream s)
{
FourStoryBinaryReader br = new FourStoryBinaryReader(s);
UInt16 count = br.ReadUInt16();
for (int i = 0; i < count; i++)
{
l.Add(new Item());
l[i].ItemID = br.ReadUInt16();
l[i].Type = br.ReadByte();
l[i].Kind = br.ReadByte();
l[i].AttrID = br.ReadUInt16();
l[i].Name = br.ReadString();
l[i].UseValue = br.ReadUInt16();
l[i].SlotID = br.ReadUInt32();
l[i].ClassID = br.ReadUInt32();
l[i].PrmSlotID = br.ReadByte();
l[i].SubSlotID = br.ReadByte();
l[i].Level = br.ReadByte();
l[i].CanRepair = br.ReadByte();
l[i].DuraMax = br.ReadUInt32();
l[i].RefineMax = br.ReadByte();
l[i].PriceRate = br.ReadSingle();
l[i].Price = br.ReadUInt32();
l[i].MinRange = br.ReadByte();
l[i].MaxRange = br.ReadByte();
l[i].Stack = br.ReadByte();
l[i].SlotCount = br.ReadByte();
l[i].CanGamble = br.ReadByte();
l[i].GambleProb = br.ReadByte();
l[i].DestroyProb = br.ReadByte();
l[i].CanGrade = br.ReadByte();
l[i].CanMagic = br.ReadByte();
l[i].CanRare = br.ReadByte();
l[i].DelayGroupID = br.ReadUInt16();
l[i].Delay = br.ReadUInt32();
l[i].CanTrade = br.ReadByte();
l[i].IsSpecial = br.ReadByte();
l[i].UseTime = br.ReadUInt16();
l[i].UseType = br.ReadByte();
l[i].WeaponID = br.ReadByte();
l[i].ShotSpeed = br.ReadSingle();
l[i].Gravity = br.ReadSingle();
l[i].InfoID = br.ReadUInt32();
l[i].SkillItemType = br.ReadByte();
l[i].Visual0 = br.ReadUInt16();
l[i].Visual1 = br.ReadUInt16();
l[i].Visual2 = br.ReadUInt16();
l[i].Visual3 = br.ReadUInt16();
l[i].Visual4 = br.ReadUInt16();
l[i].GradeSFX = br.ReadUInt16();
l[i].OptionSFX0 = br.ReadUInt16();
l[i].OptionSFX1 = br.ReadUInt16();
l[i].OptionSFX2 = br.ReadUInt16();
l[i].CanWrap = br.ReadByte();
l[i].AuctionCode = br.ReadUInt32();
l[i].CanColor = br.ReadByte();
l[i].UseBP = br.ReadUInt16();
br.ReadString();
}
bcs here i have ReadSingle().
Thank you for help. Edited files:
You must be registered to see links