private bool LoadFile(Stream stream, EndianUtils.Endianness endian, BitUtils.Bitness bits) { string magic = stream.ReadAscii(8); if (magic != "T8BTTA ") { throw new Exception("Invalid magic."); } uint strategySetCount = stream.ReadUInt32().FromEndian(endian); uint strategyOptionCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); StrategySetList = new List <StrategySet>((int)strategySetCount); for (uint i = 0; i < strategySetCount; ++i) { StrategySet ss = new StrategySet(stream, refStringStart, endian, bits); StrategySetList.Add(ss); } StrategyOptionList = new List <StrategyOption>((int)strategyOptionCount); for (uint i = 0; i < strategyOptionCount; ++i) { StrategyOption so = new StrategyOption(stream, refStringStart, endian, bits); StrategyOptionList.Add(so); } StrategyOptionDict = new Dictionary <uint, StrategyOption>(StrategyOptionList.Count); foreach (var option in StrategyOptionList) { StrategyOptionDict.Add(option.InGameID, option); } return(true); }
public VoiceTableEntry(Stream s, EndianUtils.Endianness e) { ulong magic = s.ReadUInt48(EndianUtils.Endianness.BigEndian); if (magic != 0x766f69636500) { throw new Exception("unexpected format"); } ushort entrysize = s.ReadUInt16(e); Index = s.ReadUInt16(e); Name = s.ReadAscii(entrysize - 0x11); Unknown0 = s.ReadUInt8(); Unknown1 = s.ReadUInt64(e); Unknown2 = s.ReadUInt16(e); Unknown3 = s.ReadUInt32(e); if (Unknown0 != 0 || Unknown1 != 0 || Unknown2 != 1 || Unknown3 != 0x42c80000) { throw new Exception("unexpected format"); } return; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint strategySetCount = stream.ReadUInt32().SwapEndian(); uint strategyOptionCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); StrategySetList = new List<StrategySet>( (int)strategySetCount ); for ( uint i = 0; i < strategySetCount; ++i ) { StrategySet ss = new StrategySet( stream, refStringStart ); StrategySetList.Add( ss ); } StrategyOptionList = new List<StrategyOption>( (int)strategyOptionCount ); for ( uint i = 0; i < strategyOptionCount; ++i ) { StrategyOption so = new StrategyOption( stream, refStringStart ); StrategyOptionList.Add( so ); } StrategyOptionDict = new Dictionary<uint, StrategyOption>( StrategyOptionList.Count ); foreach ( var option in StrategyOptionList ) { StrategyOptionDict.Add( option.InGameID, option ); } return true; }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian, BitUtils.Bitness bits) { string magic = stream.ReadAscii(8); if (magic != "T8BTSK ") { throw new Exception("Invalid magic."); } uint skillCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); SkillList = new List <Skill>((int)skillCount); for (uint i = 0; i < skillCount; ++i) { Skill s = new Skill(stream, refStringStart, endian, bits); SkillList.Add(s); } SkillIdDict = new Dictionary <uint, Skill>(SkillList.Count); foreach (Skill s in SkillList) { SkillIdDict.Add(s.InGameID, s); } return(true); }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 4 ); switch ( magic ) { case "G1TG": Endian = Util.Endianness.BigEndian; break; case "GT1G": Endian = Util.Endianness.LittleEndian; break; default: throw new Exception( "Not a g1t file!" ); } uint version = stream.ReadUInt32().FromEndian( Endian ); switch ( version ) { case 0x30303530: break; case 0x30303630: break; default: throw new Exception( "Unsupported g1t version!" ); } uint fileSize = stream.ReadUInt32().FromEndian( Endian ); uint headerSize = stream.ReadUInt32().FromEndian( Endian ); uint numberTextures = stream.ReadUInt32().FromEndian( Endian ); uint unknown = stream.ReadUInt32().FromEndian( Endian ); stream.Position = headerSize; uint bytesUnknownData = stream.ReadUInt32().FromEndian( Endian ); stream.Position = headerSize + bytesUnknownData; Textures = new List<g1tTexture>( (int)numberTextures ); for ( uint i = 0; i < numberTextures; ++i ) { var g = new g1tTexture( stream, Endian ); Textures.Add( g ); } return true; }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian) { string magic = stream.ReadAscii(8); if (magic != "T8BTXTMM") { throw new Exception("Invalid magic."); } uint unknown1 = stream.ReadUInt32().FromEndian(endian); uint bytesToEnd = stream.ReadUInt32().FromEndian(endian); uint unknown2 = stream.ReadUInt32().FromEndian(endian); uint unknown3 = stream.ReadUInt32().FromEndian(endian); HorizontalTiles = stream.ReadUInt32().FromEndian(endian); VerticalTiles = stream.ReadUInt32().FromEndian(endian); uint tileCount = stream.ReadUInt32().FromEndian(endian); TileList = new List <MapTile>((int)tileCount); for (uint i = 0; i < tileCount; ++i) { MapTile mt = new MapTile(stream, endian); TileList.Add(mt); } return(true); }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian, BitUtils.Bitness bits) { string magic = stream.ReadAscii(8); if (magic != "TOVNPCT\0") { throw new Exception("Invalid magic."); } uint fileSize = stream.ReadUInt32().FromEndian(endian); uint unknownDataStart = stream.ReadUInt32().FromEndian(endian); uint unknownDataCount = stream.ReadUInt32().FromEndian(endian); uint npcDefStart = stream.ReadUInt32().FromEndian(endian); uint npcDefCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); stream.Position = npcDefStart; NpcDefList = new List <NpcDialogueDefinition>((int)npcDefCount); for (uint i = 0; i < npcDefCount; ++i) { NpcDialogueDefinition n = new NpcDialogueDefinition(stream, refStringStart, endian, bits); NpcDefList.Add(n); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint fileSize = stream.ReadUInt32().SwapEndian(); uint definitionsStart = stream.ReadUInt32().SwapEndian(); uint definitionsCount = stream.ReadUInt32().SwapEndian(); // 64 bytes per entry uint contentsStart = stream.ReadUInt32().SwapEndian(); uint contentsCount = stream.ReadUInt32().SwapEndian(); // 16 bytes per entry uint itemsStart = stream.ReadUInt32().SwapEndian(); uint itemsCount = stream.ReadUInt32().SwapEndian(); // 8 bytes per entry uint refStringStart = stream.ReadUInt32().SwapEndian(); stream.Position = definitionsStart; SearchPointDefinitions = new List <SearchPointDefinition>((int)definitionsCount); for (uint i = 0; i < definitionsCount; ++i) { SearchPointDefinitions.Add(new SearchPointDefinition(stream)); } stream.Position = contentsStart; SearchPointContents = new List <SearchPointContent>((int)contentsCount); for (uint i = 0; i < contentsCount; ++i) { SearchPointContents.Add(new SearchPointContent(stream)); } stream.Position = itemsStart; SearchPointItems = new List <SearchPointItem>((int)itemsCount); for (uint i = 0; i < itemsCount; ++i) { SearchPointItems.Add(new SearchPointItem(stream)); } return(true); }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian) { string magic = stream.ReadAscii(8); if (magic != "WRLDDAT\0") { throw new Exception("Invalid magic."); } uint unknown = stream.ReadUInt32().FromEndian(endian); uint locationCount = stream.ReadUInt32().FromEndian(endian); LocationList = new List <Location>((int)locationCount); for (uint i = 0; i < locationCount; ++i) { Location l = new Location(stream, endian); LocationList.Add(l); } LocationIdDict = new Dictionary <uint, Location>(LocationList.Count); foreach (Location l in LocationList) { LocationIdDict.Add(l.LocationID, l); } return(true); }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian, BitUtils.Bitness bits) { string magic = stream.ReadAscii(8); if (magic != "T8BTEMEG") { throw new Exception("Invalid magic."); } uint encounterGroupCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); EncounterGroupList = new List <EncounterGroup>((int)encounterGroupCount); for (uint i = 0; i < encounterGroupCount; ++i) { EncounterGroup s = new EncounterGroup(stream, refStringStart, endian, bits); EncounterGroupList.Add(s); } EncounterGroupIdDict = new Dictionary <uint, EncounterGroup>(EncounterGroupList.Count); foreach (EncounterGroup e in EncounterGroupList) { EncounterGroupIdDict.Add(e.InGameID, e); } return(true); }
public static bool AutodetectVesperiaPC(Stream stream) { try { while (true) { uint sz = stream.ReadUInt32().FromEndian(EndianUtils.Endianness.BigEndian); if (stream.Position + sz <= stream.Length) { if (stream.ReadAscii(4) != "DDS ") { return(false); } stream.Position = stream.Position + (sz - 4); if (stream.Position == stream.Length) { return(true); } } else { return(false); } } } finally { stream.Position = 0; } }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint strategySetCount = stream.ReadUInt32().SwapEndian(); uint strategyOptionCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); StrategySetList = new List <StrategySet>((int)strategySetCount); for (uint i = 0; i < strategySetCount; ++i) { StrategySet ss = new StrategySet(stream, refStringStart); StrategySetList.Add(ss); } StrategyOptionList = new List <StrategyOption>((int)strategyOptionCount); for (uint i = 0; i < strategyOptionCount; ++i) { StrategyOption so = new StrategyOption(stream, refStringStart); StrategyOptionList.Add(so); } StrategyOptionDict = new Dictionary <uint, StrategyOption>(StrategyOptionList.Count); foreach (var option in StrategyOptionList) { StrategyOptionDict.Add(option.InGameID, option); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint fileSize = stream.ReadUInt32().SwapEndian(); uint skitInfoCount = stream.ReadUInt32().SwapEndian(); uint skitInfoOffset = stream.ReadUInt32().SwapEndian(); uint conditionForwarderCount = stream.ReadUInt32().SwapEndian(); uint conditionForwarderOffset = stream.ReadUInt32().SwapEndian(); uint conditionCount = stream.ReadUInt32().SwapEndian(); uint conditionOffset = stream.ReadUInt32().SwapEndian(); uint uCount4 = stream.ReadUInt32().SwapEndian(); uint uOffset4 = stream.ReadUInt32().SwapEndian(); uint uCount5 = stream.ReadUInt32().SwapEndian(); uint uOffset5 = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); SkitInfoList = new List <SkitInfo>((int)skitInfoCount); stream.Position = skitInfoOffset; for (uint i = 0; i < skitInfoCount; ++i) { SkitInfo s = new SkitInfo(stream, refStringStart); SkitInfoList.Add(s); } SkitConditionForwarderList = new List <SkitConditionForwarder>((int)conditionForwarderCount); stream.Position = conditionForwarderOffset; for (uint i = 0; i < conditionForwarderCount; ++i) { var s = new SkitConditionForwarder(stream); SkitConditionForwarderList.Add(s); } SkitConditionList = new List <SkitCondition>((int)conditionCount); stream.Position = conditionOffset; for (uint i = 0; i < conditionCount; ++i) { var s = new SkitCondition(stream); SkitConditionList.Add(s); } UnknownSkitData4List = new List <UnknownSkitData4>((int)uCount4); stream.Position = uOffset4; for (uint i = 0; i < uCount4; ++i) { var s = new UnknownSkitData4(stream); UnknownSkitData4List.Add(s); } UnknownSkitData5List = new List <UnknownSkitData5>((int)uCount5); stream.Position = uOffset5; for (uint i = 0; i < uCount5; ++i) { var s = new UnknownSkitData5(stream); UnknownSkitData5List.Add(s); } return(true); }
private bool LoadFile( Stream stream, uint textPointerLocationDiff ) { string magic = stream.ReadAscii( 8 ); uint alwaysSame = stream.ReadUInt32().SwapEndian(); uint filesize = stream.ReadUInt32().SwapEndian(); uint lengthSection1 = stream.ReadUInt32().SwapEndian(); stream.Position = 0x50; int textPointerDiffDiff = (int)stream.ReadUInt32().SwapEndian(); stream.Position = 0x20; uint textStart = stream.ReadUInt32().SwapEndian(); int textPointerDiff = (int)stream.ReadUInt32().SwapEndian() - textPointerDiffDiff; EntryList = new List<ScenarioFileEntry>(); // i wonder what the actual logic behind this is... uint textPointersLocation = ( lengthSection1 + 0x80 ).Align( 0x10 ) + textPointerLocationDiff; // + 0x1888; // + 0x1B4C // diff of 2C4 // Actually this isn't constant, dammit. if ( textStart != textPointersLocation ) { stream.Position = textPointersLocation; while ( true ) { long loc = stream.Position; stream.DiscardBytes( 8 ); uint[] ptrs = new uint[4]; ptrs[0] = stream.ReadUInt32().SwapEndian(); ptrs[1] = stream.ReadUInt32().SwapEndian(); ptrs[2] = stream.ReadUInt32().SwapEndian(); ptrs[3] = stream.ReadUInt32().SwapEndian(); if ( stream.Position > textStart ) { break; } if ( ptrs.Any( x => x == 0 ) ) { break; } if ( ptrs.Any( x => x + textPointerDiff < textStart ) ) { break; } if ( ptrs.Any( x => x + textPointerDiff >= filesize ) ) { break; } var s = new ScenarioFileEntry(); s.Pointer = (uint)loc; stream.Position = ptrs[0] + textPointerDiff; s.JpName = stream.ReadShiftJisNullterm(); stream.Position = ptrs[1] + textPointerDiff; s.JpText = stream.ReadShiftJisNullterm(); stream.Position = ptrs[2] + textPointerDiff; s.EnName = stream.ReadShiftJisNullterm(); stream.Position = ptrs[3] + textPointerDiff; s.EnText = stream.ReadShiftJisNullterm(); EntryList.Add( s ); stream.Position = loc + 0x18; } } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint fileSize = stream.ReadUInt32().SwapEndian(); uint skitInfoCount = stream.ReadUInt32().SwapEndian(); uint skitInfoOffset = stream.ReadUInt32().SwapEndian(); uint conditionForwarderCount = stream.ReadUInt32().SwapEndian(); uint conditionForwarderOffset = stream.ReadUInt32().SwapEndian(); uint conditionCount = stream.ReadUInt32().SwapEndian(); uint conditionOffset = stream.ReadUInt32().SwapEndian(); uint uCount4 = stream.ReadUInt32().SwapEndian(); uint uOffset4 = stream.ReadUInt32().SwapEndian(); uint uCount5 = stream.ReadUInt32().SwapEndian(); uint uOffset5 = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); SkitInfoList = new List<SkitInfo>( (int)skitInfoCount ); stream.Position = skitInfoOffset; for ( uint i = 0; i < skitInfoCount; ++i ) { SkitInfo s = new SkitInfo( stream, refStringStart ); SkitInfoList.Add( s ); } SkitConditionForwarderList = new List<SkitConditionForwarder>( (int)conditionForwarderCount ); stream.Position = conditionForwarderOffset; for ( uint i = 0; i < conditionForwarderCount; ++i ) { var s = new SkitConditionForwarder( stream ); SkitConditionForwarderList.Add( s ); } SkitConditionList = new List<SkitCondition>( (int)conditionCount ); stream.Position = conditionOffset; for ( uint i = 0; i < conditionCount; ++i ) { var s = new SkitCondition( stream ); SkitConditionList.Add( s ); } UnknownSkitData4List = new List<UnknownSkitData4>( (int)uCount4 ); stream.Position = uOffset4; for ( uint i = 0; i < uCount4; ++i ) { var s = new UnknownSkitData4( stream ); UnknownSkitData4List.Add( s ); } UnknownSkitData5List = new List<UnknownSkitData5>( (int)uCount5 ); stream.Position = uOffset5; for ( uint i = 0; i < uCount5; ++i ) { var s = new UnknownSkitData5( stream ); UnknownSkitData5List.Add( s ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint blockCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); Blocks = new List<T8BTVABlock>( (int)blockCount ); for ( uint i = 0; i < blockCount; ++i ) { Blocks.Add( new T8BTVABlock( stream, refStringStart ) ); } return true; }
public t_voice_tbl_entry(Stream s, EndianUtils.Endianness e) { string magic = s.ReadAscii(6); if (magic != "voice\0") { throw new Exception("unexpected format"); } ushort entrysize = s.ReadUInt16(e); Index = s.ReadUInt16(e); Name = s.ReadAscii(entrysize - 0x11); Unknown1 = s.ReadUInt56(EndianUtils.Endianness.BigEndian); Unknown2 = s.ReadUInt64(EndianUtils.Endianness.BigEndian); if (Unknown1 != 0 || Unknown2 != 0x1000000c842) { throw new Exception("unexpected format"); } return; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint floorInfoCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); FloorList = new List<FloorInfo>( (int)floorInfoCount ); for ( uint i = 0; i < floorInfoCount; ++i ) { FloorInfo fi = new FloorInfo( stream, refStringStart ); FloorList.Add( fi ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint unknown = stream.ReadUInt32().SwapEndian(); uint titleCount = stream.ReadUInt32().SwapEndian(); TitleList = new List<Title>( (int)titleCount ); for ( uint i = 0; i < titleCount; ++i ) { Title t = new Title( stream ); TitleList.Add( t ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint infoCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); TreasureInfoList = new List<TreasureInfo>( (int)infoCount ); for ( uint i = 0; i < infoCount; ++i ) { TreasureInfo ti = new TreasureInfo( stream, refStringStart ); TreasureInfoList.Add( ti ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint unknown = stream.ReadUInt32().SwapEndian(); uint recipeCount = stream.ReadUInt32().SwapEndian(); RecipeList = new List<Recipe>( (int)recipeCount ); for ( uint i = 0; i < recipeCount; ++i ) { Recipe r = new Recipe( stream ); RecipeList.Add( r ); } return true; }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint blockCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); Blocks = new List <T8BTVABlock>((int)blockCount); for (uint i = 0; i < blockCount; ++i) { Blocks.Add(new T8BTVABlock(stream, refStringStart)); } return(true); }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint entryCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); GradeShopEntryList = new List<GradeShopEntry>( (int)entryCount ); for ( uint i = 0; i < entryCount; ++i ) { GradeShopEntry e = new GradeShopEntry( stream, refStringStart ); GradeShopEntryList.Add( e ); } return true; }
private bool LoadFile(Stream stream, Util.Endianness endian, Util.Bitness bits) { string magic = stream.ReadAscii(8); uint entryCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); GradeShopEntryList = new List <GradeShopEntry>((int)entryCount); for (uint i = 0; i < entryCount; ++i) { GradeShopEntry e = new GradeShopEntry(stream, refStringStart, endian, bits); GradeShopEntryList.Add(e); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint infoCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); TreasureInfoList = new List <TreasureInfo>((int)infoCount); for (uint i = 0; i < infoCount; ++i) { TreasureInfo ti = new TreasureInfo(stream, refStringStart); TreasureInfoList.Add(ti); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint floorInfoCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); FloorList = new List <FloorInfo>((int)floorInfoCount); for (uint i = 0; i < floorInfoCount; ++i) { FloorInfo fi = new FloorInfo(stream, refStringStart); FloorList.Add(fi); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint entryCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); BattleBookEntryList = new List <BattleBookEntry>((int)entryCount); for (uint i = 0; i < entryCount; ++i) { BattleBookEntry e = new BattleBookEntry(stream); BattleBookEntryList.Add(e); } return(true); }
private bool LoadFile(Stream stream, Util.Endianness endian, Util.Bitness bits) { string magic = stream.ReadAscii(8); uint floorInfoCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); FloorList = new List <FloorInfo>((int)floorInfoCount); for (uint i = 0; i < floorInfoCount; ++i) { FloorInfo fi = new FloorInfo(stream, refStringStart, endian, bits); FloorList.Add(fi); } return(true); }
private bool LoadFile(Stream stream, Util.Endianness endian, Util.Bitness bits) { string magic = stream.ReadAscii(8); uint infoCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); TreasureInfoList = new List <TreasureInfo>((int)infoCount); for (uint i = 0; i < infoCount; ++i) { TreasureInfo ti = new TreasureInfo(stream, refStringStart, endian, bits); TreasureInfoList.Add(ti); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint unknown = stream.ReadUInt32().SwapEndian(); uint titleCount = stream.ReadUInt32().SwapEndian(); TitleList = new List <Title>((int)titleCount); for (uint i = 0; i < titleCount; ++i) { Title t = new Title(stream); TitleList.Add(t); } return(true); }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian) { string magic = stream.ReadAscii(8); uint unknown = stream.ReadUInt32().FromEndian(endian); uint titleCount = stream.ReadUInt32().FromEndian(endian); TitleList = new List <Title>((int)titleCount); for (uint i = 0; i < titleCount; ++i) { Title t = new Title(stream, endian); TitleList.Add(t); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint unknown = stream.ReadUInt32().SwapEndian(); uint recipeCount = stream.ReadUInt32().SwapEndian(); RecipeList = new List <Recipe>((int)recipeCount); for (uint i = 0; i < recipeCount; ++i) { Recipe r = new Recipe(stream); RecipeList.Add(r); } return(true); }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint entrySize = stream.ReadUInt32().SwapEndian(); uint synopsisCount = stream.ReadUInt32().SwapEndian(); uint unknown = stream.ReadUInt32().SwapEndian(); stream.DiscardBytes( 0xC ); SynopsisList = new List<SynopsisEntry>( (int)synopsisCount ); for ( uint i = 0; i < synopsisCount; ++i ) { SynopsisEntry l = new SynopsisEntry( stream ); SynopsisList.Add( l ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint fileSize = stream.ReadUInt32().SwapEndian(); uint dataStart = stream.ReadUInt32().SwapEndian(); uint dataCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); stream.Position = dataStart; NpcFileList = new List<NpcFileReference>( (int)dataCount ); for ( uint i = 0; i < dataCount; ++i ) { NpcFileReference n = new NpcFileReference( stream, refStringStart ); NpcFileList.Add( n ); } return true; }
private bool LoadFile(Stream stream, Util.Endianness endian, Util.Bitness bits) { string magic = stream.ReadAscii(8); uint fileSize = stream.ReadUInt32().FromEndian(endian); uint dataStart = stream.ReadUInt32().FromEndian(endian); uint dataCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); stream.Position = dataStart; NpcFileList = new List <NpcFileReference>((int)dataCount); for (uint i = 0; i < dataCount; ++i) { NpcFileReference n = new NpcFileReference(stream, refStringStart, endian, bits); NpcFileList.Add(n); } return(true); }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian) { string magic = stream.ReadAscii(8); uint unknown1 = stream.ReadUInt32().FromEndian(endian); uint entryCount = stream.ReadUInt32().FromEndian(endian); uint unknown2 = stream.ReadUInt32().FromEndian(endian); stream.DiscardBytes(12); BattleBookEntryList = new List <BattleBookEntry>((int)entryCount); for (uint i = 0; i < entryCount; ++i) { BattleBookEntry e = new BattleBookEntry(stream, endian); BattleBookEntryList.Add(e); } return(true); }
public ScenarioDat( Stream data ) { Magic = data.ReadAscii( 8 ); Filesize = data.ReadUInt32().SwapEndian(); Unknown = data.ReadUInt32().SwapEndian(); Filecount = data.ReadUInt32().SwapEndian(); FilesOffset = data.ReadUInt32().SwapEndian(); uint FilesizeAgain = data.ReadUInt32(); uint Padding = data.ReadUInt32(); Entries = new List<ScenarioDatEntry>( (int)Filecount ); for ( uint i = 0; i < Filecount; ++i ) { data.Position = 0x20u + i * 0x20u; var e = new ScenarioDatEntry( data, FilesOffset ); Entries.Add( e ); } }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint entrySize = stream.ReadUInt32().SwapEndian(); uint synopsisCount = stream.ReadUInt32().SwapEndian(); uint unknown = stream.ReadUInt32().SwapEndian(); stream.DiscardBytes(0xC); SynopsisList = new List <SynopsisEntry>((int)synopsisCount); for (uint i = 0; i < synopsisCount; ++i) { SynopsisEntry l = new SynopsisEntry(stream); SynopsisList.Add(l); } return(true); }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(8); uint fileSize = stream.ReadUInt32().SwapEndian(); uint dataStart = stream.ReadUInt32().SwapEndian(); uint dataCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); stream.Position = dataStart; NpcFileList = new List <NpcFileReference>((int)dataCount); for (uint i = 0; i < dataCount; ++i) { NpcFileReference n = new NpcFileReference(stream, refStringStart); NpcFileList.Add(n); } return(true); }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint enemyGroupCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); EnemyGroupList = new List<EnemyGroup>( (int)enemyGroupCount ); for ( uint i = 0; i < enemyGroupCount; ++i ) { EnemyGroup s = new EnemyGroup( stream, refStringStart ); EnemyGroupList.Add( s ); } EnemyGroupIdDict = new Dictionary<uint, EnemyGroup>( EnemyGroupList.Count ); foreach ( EnemyGroup e in EnemyGroupList ) { EnemyGroupIdDict.Add( e.InGameID, e ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint fileSize = stream.ReadUInt32().SwapEndian(); uint unknownDataStart = stream.ReadUInt32().SwapEndian(); uint unknownDataCount = stream.ReadUInt32().SwapEndian(); uint npcDefStart = stream.ReadUInt32().SwapEndian(); uint npcDefCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); stream.Position = npcDefStart; NpcDefList = new List<NpcDialogueDefinition>( (int)npcDefCount ); for ( uint i = 0; i < npcDefCount; ++i ) { NpcDialogueDefinition n = new NpcDialogueDefinition( stream, refStringStart ); NpcDefList.Add( n ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint unknown1 = stream.ReadUInt32().SwapEndian(); uint bytesToEnd = stream.ReadUInt32().SwapEndian(); uint unknown2 = stream.ReadUInt32().SwapEndian(); uint unknown3 = stream.ReadUInt32().SwapEndian(); HorizontalTiles = stream.ReadUInt32().SwapEndian(); VerticalTiles = stream.ReadUInt32().SwapEndian(); uint tileCount = stream.ReadUInt32().SwapEndian(); TileList = new List<MapTile>( (int)tileCount ); for ( uint i = 0; i < tileCount; ++i ) { MapTile mt = new MapTile( stream ); TileList.Add( mt ); } return true; }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian) { string magic = stream.ReadAscii(8); if (magic != "T8BTVA ") { throw new Exception("Invalid magic."); } uint blockCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); Blocks = new List <T8BTVABlock>((int)blockCount); for (uint i = 0; i < blockCount; ++i) { Blocks.Add(new T8BTVABlock(stream, refStringStart, endian)); } return(true); }
public ScenarioDat(Stream data) { Magic = data.ReadAscii(8); Filesize = data.ReadUInt32().SwapEndian(); Unknown = data.ReadUInt32().SwapEndian(); Filecount = data.ReadUInt32().SwapEndian(); FilesOffset = data.ReadUInt32().SwapEndian(); uint FilesizeAgain = data.ReadUInt32(); uint Padding = data.ReadUInt32(); Entries = new List <ScenarioDatEntry>((int)Filecount); for (uint i = 0; i < Filecount; ++i) { data.Position = 0x20u + i * 0x20u; var e = new ScenarioDatEntry(data, FilesOffset); Entries.Add(e); } }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint skillCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); SkillList = new List<Skill>( (int)skillCount ); for ( uint i = 0; i < skillCount; ++i ) { Skill s = new Skill( stream, refStringStart ); SkillList.Add( s ); } SkillIdDict = new Dictionary<uint, Skill>( SkillList.Count ); foreach ( Skill s in SkillList ) { SkillIdDict.Add( s.InGameID, s ); } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint unknown = stream.ReadUInt32().SwapEndian(); uint locationCount = stream.ReadUInt32().SwapEndian(); LocationList = new List<Location>( (int)locationCount ); for ( uint i = 0; i < locationCount; ++i ) { Location l = new Location( stream ); LocationList.Add( l ); } LocationIdDict = new Dictionary<uint, Location>( LocationList.Count ); foreach ( Location l in LocationList ) { LocationIdDict.Add( l.LocationID, l ); } return true; }
private bool LoadFile(Stream stream) { string magic = stream.ReadAscii(4); switch (magic) { case "G1TG": Endian = EndianUtils.Endianness.BigEndian; break; case "GT1G": Endian = EndianUtils.Endianness.LittleEndian; break; default: throw new Exception("Not a g1t file!"); } uint version = stream.ReadUInt32().FromEndian(Endian); switch (version) { case 0x30303530: break; case 0x30303630: break; default: throw new Exception("Unsupported g1t version!"); } uint fileSize = stream.ReadUInt32().FromEndian(Endian); uint headerSize = stream.ReadUInt32().FromEndian(Endian); uint numberTextures = stream.ReadUInt32().FromEndian(Endian); uint unknown = stream.ReadUInt32().FromEndian(Endian); stream.Position = headerSize; uint bytesUnknownData = stream.ReadUInt32().FromEndian(Endian); stream.Position = headerSize + bytesUnknownData; Textures = new List <g1tTexture>((int)numberTextures); for (uint i = 0; i < numberTextures; ++i) { var g = new g1tTexture(stream, Endian); Textures.Add(g); } return(true); }
private bool LoadFile(Stream stream, EndianUtils.Endianness endian, BitUtils.Bitness bits) { string magic = stream.ReadAscii(8); if (magic != "T8BTXTMT") { throw new Exception("Invalid magic."); } uint infoCount = stream.ReadUInt32().FromEndian(endian); uint refStringStart = stream.ReadUInt32().FromEndian(endian); TreasureInfoList = new List <TreasureInfo>((int)infoCount); for (uint i = 0; i < infoCount; ++i) { TreasureInfo ti = new TreasureInfo(stream, refStringStart, endian, bits); TreasureInfoList.Add(ti); } return(true); }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint filesize = stream.ReadUInt32().SwapEndian(); uint modelDefStart = stream.ReadUInt32().SwapEndian(); uint modelDefCount = stream.ReadUInt32().SwapEndian(); uint refStringStart = stream.ReadUInt32().SwapEndian(); uint customStart = stream.ReadUInt32().SwapEndian(); uint customCount = stream.ReadUInt32().SwapEndian(); uint otherStart = stream.ReadUInt32().SwapEndian(); uint otherCount = stream.ReadUInt32().SwapEndian(); uint u20BsectionStart = stream.ReadUInt32().SwapEndian(); uint u20BsectionCount = stream.ReadUInt32().SwapEndian(); uint u80sectionStart = stream.ReadUInt32().SwapEndian(); uint u80sectionCount = stream.ReadUInt32().SwapEndian(); stream.DiscardBytes( 8 ); ModelDefList = new List<CharacterModelDefinition>( (int)modelDefCount ); stream.Position = modelDefStart; for ( uint i = 0; i < modelDefCount; ++i ) { ModelDefList.Add( new CharacterModelDefinition( stream, refStringStart ) ); } ModelCustomList = new List<CustomModelAddition>( (int)customCount ); stream.Position = customStart; for ( uint i = 0; i < customCount; ++i ) { ModelCustomList.Add( new CustomModelAddition( stream, refStringStart ) ); } ModelOtherList = new List<OtherModelAddition>( (int)otherCount ); stream.Position = otherStart; for ( uint i = 0; i < otherCount; ++i ) { ModelOtherList.Add( new OtherModelAddition( stream, refStringStart ) ); } U20BList = new List<Unknown0x20byteAreaB>( (int)u20BsectionCount ); stream.Position = u20BsectionStart; for ( uint i = 0; i < u20BsectionCount; ++i ) { U20BList.Add( new Unknown0x20byteAreaB( stream, refStringStart ) ); } U80List = new List<Unknown0x80byteArea>( (int)u80sectionCount ); stream.Position = u80sectionStart; for ( uint i = 0; i < u80sectionCount; ++i ) { U80List.Add( new Unknown0x80byteArea( stream, refStringStart ) ); } foreach ( var model in ModelDefList ) { model.Custom = new CustomModelAddition[model.CustomCount]; for ( int i = 0; i < model.Custom.Length; ++i ) { model.Custom[i] = ModelCustomList[(int)model.CustomIndex + i]; } model.Other = new OtherModelAddition[model.OtherCount]; for ( int i = 0; i < model.Other.Length; ++i ) { model.Other[i] = ModelOtherList[(int)model.OtherIndex + i]; } model.Unknown0x20Area = new Unknown0x20byteAreaB[model.Unknown0x20AreaCount]; for ( int i = 0; i < model.Unknown0x20Area.Length; ++i ) { model.Unknown0x20Area[i] = U20BList[(int)model.Unknown0x20AreaIndex + i]; } model.Unknown0x80Area = new Unknown0x80byteArea[model.Unknown0x80AreaCount]; for ( int i = 0; i < model.Unknown0x80Area.Length; ++i ) { model.Unknown0x80Area[i] = U80List[(int)model.Unknown0x80AreaIndex + i]; } } return true; }
private bool LoadFile( Stream stream ) { string magic = stream.ReadAscii( 8 ); uint fileSize = stream.ReadUInt32().SwapEndian(); uint definitionsStart = stream.ReadUInt32().SwapEndian(); uint definitionsCount = stream.ReadUInt32().SwapEndian(); // 64 bytes per entry uint contentsStart = stream.ReadUInt32().SwapEndian(); uint contentsCount = stream.ReadUInt32().SwapEndian(); // 16 bytes per entry uint itemsStart = stream.ReadUInt32().SwapEndian(); uint itemsCount = stream.ReadUInt32().SwapEndian(); // 8 bytes per entry uint refStringStart = stream.ReadUInt32().SwapEndian(); stream.Position = definitionsStart; SearchPointDefinitions = new List<SearchPointDefinition>( (int)definitionsCount ); for ( uint i = 0; i < definitionsCount; ++i ) { SearchPointDefinitions.Add( new SearchPointDefinition( stream ) ); } stream.Position = contentsStart; SearchPointContents = new List<SearchPointContent>( (int)contentsCount ); for ( uint i = 0; i < contentsCount; ++i ) { SearchPointContents.Add( new SearchPointContent( stream ) ); } stream.Position = itemsStart; SearchPointItems = new List<SearchPointItem>( (int)itemsCount ); for ( uint i = 0; i < itemsCount; ++i ) { SearchPointItems.Add( new SearchPointItem( stream ) ); } return true; }