public static CharaMakeTypeStruct Read(byte[] buffer) { int offset = 0; CharaMakeTypeStruct cmt = new CharaMakeTypeStruct(); cmt.Looks = new CharaMakeTypeLooksStruct[28]; for (int i = 0; i < 28; i++) cmt.Looks[i] = CharaMakeTypeLooksStruct.Read(buffer, ref offset); cmt.Voice = CharaMakeTypeVoiceStruct.Read(buffer, ref offset); cmt.FaceOption = new CharaMakeTypeFaceOptionStruct[8]; for (int i = 0; i < 8; i++) cmt.FaceOption[i] = CharaMakeTypeFaceOptionStruct.Read(buffer, ref offset); offset += 4; cmt.Equip = new CharaMakeTypeEquipStruct[3]; for (int i = 0; i < 3; i++) cmt.Equip[i] = CharaMakeTypeEquipStruct.Read(buffer, ref offset); cmt.Race = OrderedBitConverter.ToInt32(buffer, offset, true); offset += 4; cmt.Tribe = OrderedBitConverter.ToInt32(buffer, offset, true); offset += 4; cmt.Gender = (sbyte)buffer[offset]; return cmt; }
public static CharaMakeTypeStruct[] LoadCharaMakeType(ARealmReversed realm) { string sheetFile = "exd/charamaketype_0_en.exd"; byte[] fileData = realm.Packs.GetFile(sheetFile).GetData(); uint rows = MiniExdReader.GetNumRows(fileData); CharaMakeTypeStruct[] sheet = new CharaMakeTypeStruct[rows]; for (int i = 0; i < rows; i++) { byte[] row = MiniExdReader.GetRow(fileData, i); sheet[i] = CharaMakeTypeStruct.Read(row); } return sheet; }