/// <summary> /// Initializes and extracts files from the zone objects S3D and WLD (if specified) /// </summary> /// <param name="shortName">The zone shortname</param> private static void ExtractObjectsFile(string shortName) { var filePath = _settings.EverQuestDirectory + shortName + "_obj" + LanternStrings.PfsFormatExtension; var objectsS3DArchive = new PfsArchive(filePath, _logger); if (!objectsS3DArchive.Initialize()) { return; } if (_settings.ExtractWld) { PfsFile objectsWldFile = objectsS3DArchive.GetFile(shortName + "_obj" + LanternStrings.WldFormatExtension); if (objectsWldFile == null) { return; } var wld = new WldFile(objectsWldFile, shortName, WldType.Objects, _logger, _settings); if (wld.Initialize()) { wld.OutputFiles(); objectsS3DArchive.WriteAllFiles(wld.GetMaterialTypes(), "Objects/", true); } else { _logger.LogError("Unable to initialize objects wld"); } } else { objectsS3DArchive.WriteAllFiles(); } }
/// <summary> /// Parses and extracts the character models from the archive /// </summary> /// <param name="shortName">The zone shortname</param> private static void ExtractCharactersFile(string shortName) { var filePath = _settings.EverQuestDirectory + shortName + "_chr" + LanternStrings.PfsFormatExtension; var charactersS3DArchive = new PfsArchive(filePath, _logger); if (!charactersS3DArchive.Initialize()) { return; } if (_settings.ExtractWld) { PfsFile charactersWldFile = charactersS3DArchive.GetFile(shortName + "_chr" + LanternStrings.WldFormatExtension); if (charactersWldFile == null) { return; } var wld = new WldFile(charactersWldFile, shortName, WldType.Characters, _logger, _settings); if (wld.Initialize()) { wld.OutputFiles(); charactersS3DArchive.WriteAllFiles(wld.GetMaterialTypes(), "Characters/", true); } else { _logger.LogError("Unable to initialize characters WLD"); } } else { charactersS3DArchive.WriteAllFiles(); } }
/// <summary> /// Initializes and extracts files from the main zone S3D and WLD (if specified) /// </summary> /// <param name="shortName">The zone shortname</param> private static void ExtractZoneFile(string shortName) { var filePath = _settings.EverQuestDirectory + shortName + LanternStrings.PfsFormatExtension; var zoneS3DArchive = new PfsArchive(filePath, _logger); if (!zoneS3DArchive.Initialize()) { _logger.LogError("Failed to initialize zone PFS archive!"); return; } if (_settings.ExtractWld) { PfsFile zoneWldFile = zoneS3DArchive.GetFile(shortName + LanternStrings.WldFormatExtension); if (zoneWldFile != null) { var wld = new WldFile(zoneWldFile, shortName, WldType.Zone, _logger, _settings); if (wld.Initialize()) { wld.OutputFiles(); zoneS3DArchive.WriteAllFiles(wld.GetMaterialTypes(), "Zone/", true); } else { _logger.LogError("Unable to initialize objects.wld"); } } PfsFile zoneObjectsWldFile = zoneS3DArchive.GetFile("objects" + LanternStrings.WldFormatExtension); if (zoneObjectsWldFile != null) { var wld = new WldFile(zoneObjectsWldFile, shortName, WldType.ZoneObjects, _logger, _settings); if (wld.Initialize()) { wld.OutputFiles(); } else { _logger.LogError("Unable to initialize objects.wld"); } } PfsFile zoneLightsFile = zoneS3DArchive.GetFile("lights" + LanternStrings.WldFormatExtension); if (zoneLightsFile != null) { var wld = new WldFile(zoneLightsFile, shortName, WldType.Lights, _logger, _settings); if (wld.Initialize()) { wld.OutputFiles(); } else { _logger.LogError("Unable to initialize lights.wld"); } } } else { zoneS3DArchive.WriteAllFiles(); } }