From b7b08f99f26334808eb1f4c6da01c84e8a9edaf0 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 9 Feb 2024 09:56:18 +0000 Subject: [PATCH] Add functionality to apply a multipler to individual dynamic offers on flea Use new functionaliy to apply a large multipler to `5.45x39mm BP gs ammo pack` items to match live data --- project/assets/configs/ragfair.json | 4 ++++ project/src/models/spt/config/IRagfairConfig.ts | 2 ++ project/src/services/RagfairPriceService.ts | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/project/assets/configs/ragfair.json b/project/assets/configs/ragfair.json index 6692f366..abcac4cb 100644 --- a/project/assets/configs/ragfair.json +++ b/project/assets/configs/ragfair.json @@ -267,6 +267,10 @@ "min": -2, "max": 20 }, + "itemPriceMultiplier": { + "5737292724597765e5728562": 6, + "57372ac324597767001bc261": 5 + }, "_currencies": "what percentage of the offers are in each currency", "currencies": { "5449016a4bdc2d6f028b456f": 78, diff --git a/project/src/models/spt/config/IRagfairConfig.ts b/project/src/models/spt/config/IRagfairConfig.ts index f0e0799d..ab9ea730 100644 --- a/project/src/models/spt/config/IRagfairConfig.ts +++ b/project/src/models/spt/config/IRagfairConfig.ts @@ -78,6 +78,8 @@ export interface Dynamic nonStackableCount: MinMax; /** Range of rating offers for items being listed */ rating: MinMax; + /** A multipler to apply to individual tpls price just prior to item quality adjustment */ + itemPriceMultiplier: Record; /** Percentages to sell offers in each currency */ currencies: Record; /** Item tpls that should be forced to sell as a single item */ diff --git a/project/src/services/RagfairPriceService.ts b/project/src/services/RagfairPriceService.ts index 7519e70c..400b8e4d 100644 --- a/project/src/services/RagfairPriceService.ts +++ b/project/src/services/RagfairPriceService.ts @@ -255,6 +255,12 @@ export class RagfairPriceService implements OnLoad isPreset = true; } + const manualPriceMultipler = this.ragfairConfig.dynamic.itemPriceMultiplier[item._tpl]; + if (manualPriceMultipler) + { + itemPrice *= manualPriceMultipler; + } + // Convert to different currency if desiredCurrency param is not roubles if (desiredCurrency !== Money.ROUBLES) {