Updated to use raw assort dump files

This commit is contained in:
Dev 2024-11-14 16:05:21 +00:00
parent ce251b1e2b
commit b7bd6bea9b
5 changed files with 61821 additions and 2110 deletions

File diff suppressed because it is too large Load Diff

View File

@ -166,12 +166,133 @@
"StackObjectsCount": 20
},
"barterScheme": [{
"count": 3381,
"count": 2618,
"_tpl": "5449016a4bdc2d6f028b456f"
}
]
},
"66abb9456f11600e4e48bacc": {
"questName": "Test Drive - Part 2",
"questId": "63a5cf262964a7488f5243ce",
"itemTpl": "5a26ac0ec4a28200741e1e18",
"itemUpd": {
"BuyRestrictionMax": 180,
"StackObjectsCount": 295000
},
"barterScheme": [{
"count": 609,
"_tpl": "5449016a4bdc2d6f028b456f"
}
]
},
"655b8192065b076eb02c4b4b": {
"questName": "Broadcast - Part 4",
"questId": "6391372c8ba6894d155e77d7",
"itemTpl": "5ea2a8e200685063ec28c05a",
"itemUpd": {
"BuyRestrictionMax": 90,
"StackObjectsCount": 1130000
},
"barterScheme": [{
"count": 420,
"_tpl": "5449016a4bdc2d6f028b456f"
}
]
},
"66b87066e949465471126b26": {
"questName": "Gunsmith Part 25",
"questId": "64f83bd983cfca080a362c82",
"itemTpl": "64637076203536ad5600c990",
"itemUpd": {
"BuyRestrictionMax": 1,
"StackObjectsCount": 1050000
},
"barterScheme": [{
"count": 1,
"_tpl": "6389c8c5dbfd5e4b95197e6b"
}
]
},
"655b8d2b1273611d2462ab7b": {
"questName": "Textile Part 1 - Bear",
"questId": "5e381b0286f77420e3417a74",
"itemTpl": "5b44cf1486f77431723e3d05",
"itemUpd": {
"BuyRestrictionMax": 1,
"StackObjectsCount": 940000
},
"barterScheme": [{
"count": 205349,
"_tpl": "5449016a4bdc2d6f028b456f"
}
]
},
"658066546b98154f4930110f": {
"questName": "Trouble in the Big City",
"questId": "63967028c4a91c5cb76abd81",
"itemTpl": "65290f395ae2ae97b80fdf2d",
"itemUpd": {
"BuyRestrictionMax": 3,
"StackObjectsCount": 720000
},
"barterScheme": [{
"count": 1845,
"_tpl": "5696686a4bdc2da3298b456a"
}
]
},
"655b89b7975a7f3c734661ab": {
"questName": "Audiophile",
"questId": "639135bbc115f907b14700a6",
"itemTpl": "60a3c70cde5f453f634816a3",
"itemUpd": {
"BuyRestrictionMax": 2,
"StackObjectsCount": 930000
},
"barterScheme": [{
"count": 92019,
"_tpl": "5449016a4bdc2d6f028b456f"
}
]
},
"64f980c0c8626c7d460791ca": {
"questName": "Broadcast Part 5",
"questId": "64ee99639878a0569d6ec8c9",
"itemTpl": "63fc44e2429a8a166c7f61e6",
"itemUpd": {
"BuyRestrictionMax": 1,
"StackObjectsCount": 2140000
},
"barterScheme": [{
"count": 10,
"_tpl": "5fc64ea372b0dd78d51159dc"
}
]
},
"667582984ec1b906ff1b19ab": {
"questName": "A Key to Salvation",
"questId": "6672ec2a2b6f3b71be794cc5",
"itemTpl": "635267f063651329f75a4ee8",
"itemUpd": {
"BuyRestrictionMax": 1,
"StackObjectsCount": 245000
},
"barterScheme": [{
"count": 10,
"_tpl": "59e361e886f774176c10a2a5"
},
{
"count": 5,
"_tpl": "62a0a043cf4a99369e2624a5"
},
{
"count": 1,
"_tpl": "5c052e6986f7746b207bc3c9"
}
]
},
"649b182a49f5fa538c64e4fb": {
"questName": "Cocktail Tasting-Event",
"questId": "649af47d717cb30e7e4b5e26",
"itemTpl": "5b2388675acfc4771e1be0be",
"itemUpd": {

View File

@ -67,8 +67,8 @@ namespace AssortGenerator.Common.Helpers
LoyaltyLevel = (int)reward.loyaltyLevel,
QuestId = quest._id,
QuestRewardId = reward.id,
TraderId = reward.traderId,
TraderType = TraderHelper.GetTraderTypeById(reward.traderId),
TraderId = reward.traderId.ToString(),
TraderType = TraderHelper.GetTraderTypeById(reward.traderId.ToString()),
Criteria = "Success",
Items = reward.items
}
@ -84,8 +84,8 @@ namespace AssortGenerator.Common.Helpers
LoyaltyLevel = (int)reward.loyaltyLevel,
QuestId = quest._id,
QuestRewardId = reward.id,
TraderId = reward.traderId,
TraderType = TraderHelper.GetTraderTypeById(reward.traderId),
TraderId = reward.traderId.ToString(),
TraderType = TraderHelper.GetTraderTypeById(reward.traderId.ToString()),
Criteria = "Started",
Items = reward.items
}

View File

@ -55,7 +55,7 @@ namespace AssortGenerator.Models.Input
public string target { get; set; }
public List<QuestRewardItem> items { get; set; }
public int? loyaltyLevel { get; set; }
public string traderId { get; set; }
public object traderId { get; set; }
public bool? findInRaid { get; set; }
public bool? unknown { get; set; }
}

View File

@ -35,25 +35,27 @@ namespace AssortGenerator
var jsonObject = JsonDocument.Parse(json);
// Find root data node
var data = jsonObject.RootElement;
var rootData = jsonObject.RootElement;
var dataObject = rootData.GetProperty("data");
// Find assort items node and parse into list
string itemsJson = data.GetProperty("items").ToString();
string itemsJson = dataObject.GetProperty("items").ToString();
List<Item> items = JsonSerializer.Deserialize<List<Item>>(itemsJson);
// Fix items that have ran out of stock in the dump and give stack size
FixZeroSizedStackAssorts(items, 100);
UpdateunlimitedCountItemStackSize(items);
UpdateUnlimitedCountItemStackSize(items);
FixFullyPurchasedStackLimits(items);
// Find barter scheme node and parse into dictionary
var barterSchemeJson = data.GetProperty("barter_scheme").ToString();
var barterSchemeJson = dataObject.GetProperty("barter_scheme").ToString();
var barterSchemeItems = JsonSerializer.Deserialize<Dictionary<string, List<List<BarterObject>>>>(barterSchemeJson);
// Find loyalty level node and parse into dictionary
var loyaltyLevelItemsJson = data.GetProperty("loyal_level_items").ToString();
var loyaltyLevelItemsJson = dataObject.GetProperty("loyal_level_items").ToString();
var loyaltyLevelItems = JsonSerializer.Deserialize<Dictionary<string, int>>(loyaltyLevelItemsJson);
WriteOutputFilesForTrader(trader, items, barterSchemeItems, loyaltyLevelItems, finalisedQuestData, missingQuestAssortPrices);
@ -62,7 +64,7 @@ namespace AssortGenerator
JsonWriter.WriteJson(finalisedQuestData, "", Directory.GetCurrentDirectory(), "quests");
}
private static void UpdateunlimitedCountItemStackSize(List<Item> items)
private static void UpdateUnlimitedCountItemStackSize(List<Item> items)
{
foreach (var item in items
.Where(item => (item.upd?.UnlimitedCount.GetValueOrDefault(false) ?? false) && item.slotId == "hideout"))
@ -192,7 +194,7 @@ namespace AssortGenerator
{
var missingAssortDataWithNoFix = new List<AssortUnlocks>();
var questData = QuestHelper.GetFinalisedQuestData();
// iterate over each missing assort
// Iterate over each missing assort
foreach (var missingQuestAssort in missingQuestAssorts)
{
// Single item, maybe we can add one in (skip complex items like guns/ammo boxes etc)