diff --git a/project/assets/configs/trader.json b/project/assets/configs/trader.json index 8085599f..71980e53 100644 --- a/project/assets/configs/trader.json +++ b/project/assets/configs/trader.json @@ -160,6 +160,22 @@ "5b432b965acfc47a8774094e": { "min": 120, "max": 352 + }, + "544fb25a4bdc2dfb738b4567": { + "min": 120, + "max": 700 + }, + "5e831507ea0a7c419c2f9bd9": { + "min": 5, + "max": 100 + }, + "5755356824597772cb798962": { + "min": 1, + "max": 400 + }, + "544fb3364bdc2d34748b456a": { + "min": 1, + "max": 800 } }, "itemCategoryRoublePriceLimit": { @@ -183,8 +199,8 @@ "5447bedf4bdc2d87278b4568": 27008, "5447bed64bdc2d97278b4568": 27007, "5447b5e04bdc2d62278b4567": 33006, - "5447b5fc4bdc2d87278b4567": 42005, - "5447b5f14bdc2d61278b4567": 44004, + "5447b5fc4bdc2d87278b4567": 60000, + "5447b5f14bdc2d61278b4567": 60000, "5447b5cf4bdc2d65278b4567": 28003, "5447b6254bdc2dc3278b4568": 28002, "5447e1d04bdc2dff2f8b4567": 19001, @@ -194,7 +210,7 @@ "590c745b86f7743cc433c5f2": 64000, "57864bb7245977548b3b66c2": 85000, - "5448e5284bdc2dcb718b4567": 40001, + "5448e5284bdc2dcb718b4567": 59001, "5a341c4086f77401f2541505": 35000, "5d21f59b6dbe99052b54ef83": 45000, diff --git a/project/src/services/FenceService.ts b/project/src/services/FenceService.ts index 351e3fbd..4a97e2b5 100644 --- a/project/src/services/FenceService.ts +++ b/project/src/services/FenceService.ts @@ -46,6 +46,9 @@ export class FenceService /** Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + /** Items that have a multi-stack */ + protected multiStackItems: Record = {}; + constructor( @inject("WinstonLogger") protected logger: ILogger, @inject("JsonUtil") protected jsonUtil: JsonUtil, @@ -554,6 +557,10 @@ export class FenceService { const priceLimits = this.traderConfig.fence.itemCategoryRoublePriceLimit; const assortRootItems = baseFenceAssort.items.filter((x) => x.parentId === "hideout" && !x.upd?.sptPresetId); + + // Clear cache of multi-stack items + this.multiStackItems = {}; + for (let i = 0; i < assortCount; i++) { const chosenBaseAssortRoot = this.randomUtil.getArrayValue(assortRootItems); @@ -606,12 +613,29 @@ export class FenceService this.itemHelper.remapRootItemId(desiredAssortItemAndChildrenClone); const rootItemBeingAdded = desiredAssortItemAndChildrenClone[0]; - this.randomiseItemUpdProperties(itemDbDetails, rootItemBeingAdded); rootItemBeingAdded.upd.StackObjectsCount = this.getSingleItemStackCount(itemDbDetails); // rootItemBeingAdded.upd.BuyRestrictionCurrent = 0; // rootItemBeingAdded.upd.UnlimitedCount = false; + // Only randomise single items + if (rootItemBeingAdded.upd.StackObjectsCount === 1) + { + this.randomiseItemUpdProperties(itemDbDetails, rootItemBeingAdded); + } + else + { + // Already have multi-stack, skip + if (this.multiStackItems[itemDbDetails._id]) + { + i--; + continue; + } + + // Flag item as added as multi stack + this.multiStackItems[itemDbDetails._id] = true; + } + // Need to add mods to armors so they dont show as red in the trade screen if (this.itemHelper.itemRequiresSoftInserts(rootItemBeingAdded._tpl)) {