diff --git a/GenerateQuestFile/Program.cs b/GenerateQuestFile/Program.cs index 3379f53..4fc052d 100644 --- a/GenerateQuestFile/Program.cs +++ b/GenerateQuestFile/Program.cs @@ -93,7 +93,7 @@ namespace GenerateQuestFile AddMissingFields(quest); - // quest has start conditions, check to ensure they're carried over + // Quest has start conditions, check to ensure they're carried over if (originalQuest.conditions.AvailableForStart.Count > 0) { AddMissingAvailableForStartConditions(originalQuest, quest); @@ -161,6 +161,8 @@ namespace GenerateQuestFile return new int[] { (int)status }; case QuestStatus.StartedSuccess: return new int[] { (int)QuestStatus.Started, (int)QuestStatus.Success }; + case QuestStatus.SuccessFail: + return new int[] { (int)QuestStatus.Success, (int)QuestStatus.Fail }; } throw new Exception($"Unable to process quest status {status}"); @@ -224,16 +226,22 @@ namespace GenerateQuestFile foreach (var questRequirementToAdd in originalQuest.conditions.AvailableForStart.ToList()) { //Exists already, skip - if (questToUpdate.Value.conditions.AvailableForStart.Any( - x => x._parent == questRequirementToAdd._parent - && x._props.target?.ToString() == questRequirementToAdd._props.target?.ToString()) - ) + //if (questToUpdate.Value.conditions.AvailableForStart.Any( + // x => x._parent == questRequirementToAdd._parent + // && x._props.target?.ToString() == questRequirementToAdd._props.target?.ToString()) + // ) + //{ + // continue; + //} + + if (questToUpdate.Value.conditions.AvailableForStart.Any(x => string.Equals(x._parent, "quest", StringComparison.CurrentCultureIgnoreCase))) { continue; } if (questRequirementToAdd._parent == "Quest") { + LoggingHelpers.LogInfo($"Quest {questToUpdate.Value.QuestName} missing AvailableForStart quest requirement, adding prereq of {questRequirementToAdd._props.target} {QuestHelper.GetQuestNameById(questRequirementToAdd._props.target?.ToString())}"); questRequirementToAdd._props.id = Sha256(new DateTime().ToString()); if (!questRequirementToAdd._props.availableAfter.HasValue) @@ -250,8 +258,21 @@ namespace GenerateQuestFile } + // Already exists, skip + if(questToUpdate.Value.conditions.AvailableForStart + .Any(x => x._props.target?.ToString() == questRequirementToAdd._props.target?.ToString() + && x._parent == questRequirementToAdd._parent)) + { + continue; + } + questToUpdate.Value.conditions.AvailableForStart.Add(questRequirementToAdd); } + + if (questToUpdate.Value.conditions.AvailableForStart.Count(x => x._parent == "Quest") > 1) + { + LoggingHelpers.LogWarning($"Quest {questToUpdate.Value.QuestName} has {questToUpdate.Value.conditions.AvailableForStart.Count(x => x._parent == "Quest")} quest prereqs, is this correct?"); + } } /// diff --git a/QuestValidator.Common/Helpers/QuestNames.cs b/QuestValidator.Common/Helpers/QuestNames.cs index 531798e..53ced83 100644 --- a/QuestValidator.Common/Helpers/QuestNames.cs +++ b/QuestValidator.Common/Helpers/QuestNames.cs @@ -106,7 +106,7 @@ namespace QuestValidator.Common.Helpers { Quest.OnlyBusiness, "5ae448a386f7744d3730fff0"}, { Quest.MakeUltraGreatAgain, "5ae448bf86f7744d733e55ee"}, { Quest.BigSale, "5ae448e586f7744dcf0c2a67"}, - { Quest.TheBloodOfWar, "5ae448f286f77448d73c0131"}, + { Quest.TheBloodOfWarP1, "5ae448f286f77448d73c0131"}, { Quest.DressedToKill, "5ae4490786f7744ca822adcc"}, { Quest.DatabaseP1, "5ae4493486f7744efa289417"}, { Quest.DatabaseP2, "5ae4493d86f7744b8e15aa8f"}, @@ -424,11 +424,11 @@ namespace QuestValidator.Common.Helpers { "639872fc93ae507d5858c3a6", "Gunsmith Part 11"}, { "5ae448a386f7744d3730fff0", "Only business"}, { "5ae448bf86f7744d733e55ee", "Make ULTRA Great Again"}, - { "5ae448e586f7744dcf0c2a67", "Big sale" }, - { "5ae448f286f77448d73c0131", "The Blood of War" }, - { "5ae4490786f7744ca822adcc", "Dressed to kill" }, - { "5ae4493486f7744efa289417", "Database Part 1" }, - { "5ae4493d86f7744b8e15aa8f", "Database Part 2" }, + { "5ae448e586f7744dcf0c2a67", "Big sale"}, + { "5ae448f286f77448d73c0131", "The Blood of War Part 1"}, + { "5ae4490786f7744ca822adcc", "Dressed to kill"}, + { "5ae4493486f7744efa289417", "Database Part 1"}, + { "5ae4493d86f7744b8e15aa8f", "Database Part 2"}, { "5ae4495086f77443c122bc40", "Sew it good Part 1"}, { "5ae4495c86f7744e87761355", "Sew it good Part 2"}, { "5ae4496986f774459e77beb6", "Sew it good Part 3"}, @@ -436,9 +436,9 @@ namespace QuestValidator.Common.Helpers { "5ae4498786f7744bde357695", "The key to success"}, { "5ae4499a86f77449783815db", "Charisma brings success"}, { "5ae449a586f7744bde357696", "No Fuss Needed"}, - { "5ae449b386f77446d8741719", "Gratitude" }, - { "5ae449c386f7744bde357697", "Sales Night" }, - { "5ae449d986f774453a54a7e1", "Supervisor" }, + { "5ae449b386f77446d8741719", "Gratitude"}, + { "5ae449c386f7744bde357697", "Sales Night"}, + { "5ae449d986f774453a54a7e1", "Supervisor"}, { "5b47799d86f7746c5d6a5fd8", "Gunsmith Part 12" }, { "5ac244c486f77413e12cf945", "Gunsmith Part 13" }, { "639872fe8871e1272b10ccf6", "Gunsmith Part 14" }, @@ -574,7 +574,7 @@ namespace QuestValidator.Common.Helpers { "6179b3bdc7560e13d23eeb8d", "Corporate Secrets" }, { "6179b5eabca27a099552e052", "Counteraction" }, { "6179ad0a6e9dd54ac275e3f2", "Huntsman Path Outcasts" }, - { "6179b4f16e9dd54ac275e407", "MissingCargo" }, + { "6179b4f16e9dd54ac275e407", "Missing Cargo" }, { "6179b4d1bca27a099552e04e", "Revision Part 2" }, { "6179b5b06e9dd54ac275e409", "Our Own Land" }, { "61904daa7d0d857927447b9c", "The Hermit" }, diff --git a/QuestValidator.Common/Helpers/QuestRequirements.cs b/QuestValidator.Common/Helpers/QuestRequirements.cs index 2e39c6c..3606afd 100644 --- a/QuestValidator.Common/Helpers/QuestRequirements.cs +++ b/QuestValidator.Common/Helpers/QuestRequirements.cs @@ -128,7 +128,7 @@ namespace QuestValidator.Common.Helpers { Quest.SpaTourP7, GetQuestData(Quest.SpaTourP7) .AddPrerequisiteQuest(Quest.SpaTourP6, QuestStatus.Success) }, { Quest.FishingGear, GetQuestData(Quest.FishingGear) - .AddPrerequisiteQuest(Quest.FriendFromTheWestP2, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.FriendFromTheWestP1, QuestStatus.Success) }, { Quest.TigrSafari, GetQuestData(Quest.TigrSafari) .AddPrerequisiteQuest(Quest.FishingGear, QuestStatus.Success) }, { Quest.ScrapMetal, GetQuestData(Quest.ScrapMetal) @@ -185,7 +185,7 @@ namespace QuestValidator.Common.Helpers { Quest.GunsmithP3, GetQuestData(Quest.GunsmithP3) .AddPrerequisiteQuest(Quest.GunsmithP1, QuestStatus.Success) }, { Quest.GunsmithP4, GetQuestData(Quest.GunsmithP4) - .AddPrerequisiteQuest(Quest.GunsmithP3, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.GunsmithP2, QuestStatus.Success) }, { Quest.GunsmithP5, GetQuestData(Quest.GunsmithP5) .AddPrerequisiteQuest(Quest.GunsmithP4, QuestStatus.Success) }, { Quest.GunsmithP6, GetQuestData(Quest.GunsmithP6) @@ -251,7 +251,7 @@ namespace QuestValidator.Common.Helpers { Quest.BigSale, GetQuestData(Quest.BigSale) .AddPrerequisiteQuest(Quest.OnlyBusiness, QuestStatus.Success) }, { Quest.DressedToKill, GetQuestData(Quest.DressedToKill) - .AddPrerequisiteQuest(Quest.TheBloodOfWar, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.TheBloodOfWarP1, QuestStatus.Success) }, { Quest.DatabaseP1, GetQuestData(Quest.DatabaseP1) .AddPrerequisiteQuest(Quest.BigSale, QuestStatus.Success) }, { Quest.DatabaseP2, GetQuestData(Quest.DatabaseP2) @@ -309,7 +309,7 @@ namespace QuestValidator.Common.Helpers { Quest.TheTarkovShooterP8, GetQuestData(Quest.TheTarkovShooterP8) .AddPrerequisiteQuest(Quest.TheTarkovShooterP7, QuestStatus.Success) }, { Quest.Bullshit, GetQuestData(Quest.Bullshit) - .AddPrerequisiteQuest(Quest.Chumming, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.SilentCaliber, QuestStatus.Success) }, { Quest.SilentCaliber, GetQuestData(Quest.SilentCaliber) .AddPrerequisiteQuest(Quest.Chumming, QuestStatus.Success) }, { Quest.Insomnia, GetQuestData(Quest.Insomnia) @@ -339,7 +339,7 @@ namespace QuestValidator.Common.Helpers .AddPrerequisiteQuest(Quest.LendLeaseP2, QuestStatus.Success) }, { Quest.TheGuide, GetQuestData(Quest.TheGuide) .AddPrerequisiteQuest(Quest.WetJobP6, QuestStatus.Success) }, - { Quest.TheBloodOfWar, GetQuestData(Quest.TheBloodOfWar) + { Quest.TheBloodOfWarP1, GetQuestData(Quest.TheBloodOfWarP1) .AddPrerequisiteQuest(Quest.BigSale, QuestStatus.Success) }, { Quest.TheBloodOfWarP2, GetQuestData(Quest.TheBloodOfWarP2) .AddPrerequisiteQuest(Quest.SewItGoodP1, QuestStatus.Success) }, @@ -365,23 +365,23 @@ namespace QuestValidator.Common.Helpers { Quest.TheSurvivalistPathUnprotectedButDangerous, GetQuestData(Quest.TheSurvivalistPathUnprotectedButDangerous) .AddPrerequisiteQuest(Quest.Acquaintance, QuestStatus.Success) }, { Quest.TheSurvivalistPathThrifty, GetQuestData(Quest.TheSurvivalistPathThrifty) - .AddPrerequisiteQuest(Quest.Acquaintance, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.TheSurvivalistPathUnprotectedButDangerous, QuestStatus.Success) }, { Quest.TheSurvivalistPathZhivchik, GetQuestData(Quest.TheSurvivalistPathZhivchik) .AddPrerequisiteQuest(Quest.TheSurvivalistPathThrifty, QuestStatus.Success) }, { Quest.TheSurvivalistPathWoundedBeast, GetQuestData(Quest.TheSurvivalistPathWoundedBeast) - .AddPrerequisiteQuest(Quest.TheSurvivalistPathThrifty, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.TheSurvivalistPathZhivchik, QuestStatus.Success) }, { Quest.TheSurvivalistPathToughGuy, GetQuestData(Quest.TheSurvivalistPathToughGuy) .AddPrerequisiteQuest(Quest.TheSurvivalistPathWoundedBeast, QuestStatus.Success) }, { Quest.TheSurvivalistPathColdBlooded, GetQuestData(Quest.TheSurvivalistPathColdBlooded) .AddPrerequisiteQuest(Quest.TheSurvivalistPathWoundedBeast, QuestStatus.Success) }, { Quest.TheSurvivalistPathEagleOwl, GetQuestData(Quest.TheSurvivalistPathEagleOwl) - .AddPrerequisiteQuest(Quest.TheSurvivalistPathColdBlooded, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.TheSurvivalistPathToughGuy, QuestStatus.Success) }, { Quest.TheSurvivalistPathCombatMedic, GetQuestData(Quest.TheSurvivalistPathCombatMedic) - .AddPrerequisiteQuest(Quest.TheSurvivalistPathColdBlooded, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.TheSurvivalistPathEagleOwl, QuestStatus.Success) }, { Quest.TheSurvivalistPathJunkie, GetQuestData(Quest.TheSurvivalistPathJunkie) .AddPrerequisiteQuest(Quest.TheSurvivalistPathColdBlooded, QuestStatus.Success) }, { Quest.HuntsmanPathSecuredPerimeter, GetQuestData(Quest.HuntsmanPathSecuredPerimeter) - .AddPrerequisiteQuest(Quest.TheSurvivalistPathWoundedBeast, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.TheTarkovShooterP3, QuestStatus.Success) }, { Quest.HuntsmanPathTheTrophy, GetQuestData(Quest.HuntsmanPathTheTrophy) .AddPrerequisiteQuest(Quest.HuntsmanPathSecuredPerimeter, QuestStatus.Success) }, { Quest.HuntsmanPathWoodsCleaning, GetQuestData(Quest.HuntsmanPathWoodsCleaning) @@ -389,7 +389,7 @@ namespace QuestValidator.Common.Helpers { Quest.HuntsmanPathController, GetQuestData(Quest.HuntsmanPathController) .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success) }, { Quest.HuntsmanPathSellOut, GetQuestData(Quest.HuntsmanPathSellOut) - .AddPrerequisiteQuest(Quest.HuntsmanPathTheTrophy, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success) }, { Quest.HuntsmanPathWoodsKeeper, GetQuestData(Quest.HuntsmanPathWoodsKeeper) .AddPrerequisiteQuest(Quest.HuntsmanPathSecuredPerimeter, QuestStatus.Success) }, { Quest.HuntsmanPathJustice, GetQuestData(Quest.HuntsmanPathJustice) @@ -397,7 +397,7 @@ namespace QuestValidator.Common.Helpers { Quest.HuntsmanPathEvilWatchman, GetQuestData(Quest.HuntsmanPathEvilWatchman) .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success) }, { Quest.HuntsmanPathFactoryChief, GetQuestData(Quest.HuntsmanPathFactoryChief) - .AddPrerequisiteQuest(Quest.HuntsmanPathSecuredPerimeter, QuestStatus.Success) + .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success) .AddPrerequisiteQuest(Quest.Scout, QuestStatus.Success)}, { Quest.HuntsmanPathEraser, GetQuestData(Quest.HuntsmanPathEraser) .AddPrerequisiteQuest(Quest.BunkerP2, QuestStatus.Success) @@ -409,10 +409,10 @@ namespace QuestValidator.Common.Helpers .AddPrerequisiteQuest(Quest.RiggedGame, QuestStatus.Success) .AddPrerequisiteQuest(Quest.TheChemistryCloset, QuestStatus.Success) }, { Quest.HuntsmanPathOutcasts, GetQuestData(Quest.HuntsmanPathOutcasts) - .AddPrerequisiteQuest(Quest.HuntsmanPathTheTrophy, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success) }, { Quest.HuntsmanPathRelentless, GetQuestData(Quest.HuntsmanPathRelentless) }, { Quest.Ambulance, GetQuestData(Quest.Ambulance) - .AddPrerequisiteQuest(Quest.TheSurvivalistPathColdBlooded, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.ShadyBusiness, QuestStatus.Success) }, { Quest.CourtesyVisit, GetQuestData(Quest.CourtesyVisit) .AddPrerequisiteQuest(Quest.TheSurvivalistPathToughGuy, QuestStatus.Success) }, { Quest.ShadyBusiness, GetQuestData(Quest.ShadyBusiness) @@ -420,7 +420,7 @@ namespace QuestValidator.Common.Helpers { Quest.Nostalgia, GetQuestData(Quest.Nostalgia) .AddPrerequisiteQuest(Quest.CourtesyVisit, QuestStatus.Success) }, { Quest.FishingPlace, GetQuestData(Quest.FishingPlace) - .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsCleaning, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.Nostalgia, QuestStatus.Success) }, { Quest.HuntingTrip, GetQuestData(Quest.HuntingTrip) .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsKeeper, QuestStatus.Success) }, { Quest.Reserv, GetQuestData(Quest.Reserv) @@ -473,14 +473,14 @@ namespace QuestValidator.Common.Helpers .AddPrerequisiteQuest(Quest.EagleEye, QuestStatus.Success) }, { Quest.PestControl, GetQuestData(Quest.PestControl) .AddPrerequisiteQuest(Quest.HuntsmanPathWoodsKeeper, QuestStatus.Success) }, - { Quest.BackDoor, GetQuestData(Quest.BackDoor) + { Quest.BackDoor, GetQuestData(Quest.HuntsmanPathSecuredPerimeter) .AddPrerequisiteQuest(Quest.SurplusGoods, QuestStatus.Success) }, { Quest.SafeCorridor, GetQuestData(Quest.SafeCorridor) .AddPrerequisiteQuest(Quest.ChemicalP4, QuestStatus.Success) }, { Quest.InventoryCheck, GetQuestData(Quest.InventoryCheck) .AddPrerequisiteQuest(Quest.FuelMatter, QuestStatus.Success) }, { Quest.FuelMatter, GetQuestData(Quest.FuelMatter) - .AddPrerequisiteQuest(Quest.OnlyBusiness, QuestStatus.Success) }, + .AddPrerequisiteQuest(Quest.TheBloodOfWarP1, QuestStatus.Success) }, { Quest.DiseaseHistory, GetQuestData(Quest.DiseaseHistory) .AddPrerequisiteQuest(Quest.Pharmacist, QuestStatus.Success) }, { Quest.Documents, GetQuestData(Quest.Documents) @@ -511,8 +511,7 @@ namespace QuestValidator.Common.Helpers .AddPrerequisiteQuest(Quest.Revision, QuestStatus.StartedSuccess) .AddPrerequisiteQuest(Quest.EagleEye, QuestStatus.Success) }, { Quest.TheHermit, GetQuestData(Quest.TheHermit) - .AddPrerequisiteQuest(Quest.TheSurvivalistPathToughGuy, QuestStatus.Success) - .AddPrerequisiteQuest(Quest.CourtesyVisit, QuestStatus.Success)}, + .AddPrerequisiteQuest(Quest.CourtesyVisit, QuestStatus.StartedSuccess)}, { Quest.LongRoad, GetQuestData(Quest.LongRoad) .AddPrerequisiteQuest(Quest.FriendFromTheWestP2, QuestStatus.Success) }, { Quest.MissingCargo, GetQuestData(Quest.MissingCargo) @@ -553,11 +552,11 @@ namespace QuestValidator.Common.Helpers { Quest.Reconnaissance, GetQuestData(Quest.Reconnaissance) .AddPrerequisiteQuest(Quest.EasyJobPart1, QuestStatus.Success)}, { Quest.TopSecret, GetQuestData(Quest.TopSecret) - .AddPrerequisiteQuest(Quest.FriendFromTheWestP2, QuestStatus.Success)}, + .AddPrerequisiteQuest(Quest.MissingCargo, QuestStatus.Success)}, { Quest.BroadcastPart1, GetQuestData(Quest.BroadcastPart1) .AddPrerequisiteQuest(Quest.FarmingP2, QuestStatus.Success)}, { Quest.StrayDogs, GetQuestData(Quest.StrayDogs) - .AddPrerequisiteQuest(Quest.HuntsmanPathOutcasts, QuestStatus.Success)}, + .AddPrerequisiteQuest(Quest.HuntsmanPathTheTrophy, QuestStatus.Success)}, { Quest.Trophies, GetQuestData(Quest.Trophies) .AddPrerequisiteQuest(Quest.TheCleaner, QuestStatus.Success)}, { Quest.SpecialEquipment, GetQuestData(Quest.SpecialEquipment) @@ -641,8 +640,8 @@ namespace QuestValidator.Common.Helpers { Quest.Slaughterhouse, GetQuestData(Quest.Slaughterhouse) .AddPrerequisiteQuest(Quest.TheHuntsmanPathAdministrator, QuestStatus.Success) .AddPrerequisiteQuest(Quest.BroadcastPart4, QuestStatus.Success)}, - // { Quest.DangerousRoad, GetQuestData(Quest.DangerousRoad) - // .AddPrerequisiteQuest(Quest., QuestStatus.Success)},// NO DATA YET + { Quest.DangerousRoad, GetQuestData(Quest.DangerousRoad) + .AddPrerequisiteQuest(Quest.SupplyPlans, QuestStatus.SuccessFail)}, { Quest.WorstJobInTheWorld, GetQuestData(Quest.WorstJobInTheWorld) .AddPrerequisiteQuest(Quest.RevisionStreetsOfTarkov, QuestStatus.Success) .AddPrerequisiteQuest(Quest.WetJobP5, QuestStatus.Success)}, diff --git a/QuestValidator.Common/Models/Quest.cs b/QuestValidator.Common/Models/Quest.cs index e012c8f..6b589f3 100644 --- a/QuestValidator.Common/Models/Quest.cs +++ b/QuestValidator.Common/Models/Quest.cs @@ -103,7 +103,7 @@ OnlyBusiness = 97, MakeUltraGreatAgain = 98, BigSale = 99, - TheBloodOfWar = 100, + TheBloodOfWarP1 = 100, DressedToKill = 101, DatabaseP1 = 102, DatabaseP2 = 103, diff --git a/QuestValidator.Common/Models/QuestStatus.cs b/QuestValidator.Common/Models/QuestStatus.cs index bb7cdf5..d30521b 100644 --- a/QuestValidator.Common/Models/QuestStatus.cs +++ b/QuestValidator.Common/Models/QuestStatus.cs @@ -5,6 +5,7 @@ Started = 2, Success = 4, Fail = 5, + SuccessFail = 98, StartedSuccess = 99 } }