diff --git a/project/assets/configs/ragfair.json b/project/assets/configs/ragfair.json index 106c660d..5475ae9b 100644 --- a/project/assets/configs/ragfair.json +++ b/project/assets/configs/ragfair.json @@ -48,9 +48,9 @@ ] }, "pack": { - "chancePercent": 20, + "chancePercent": 18, "itemCountMin": 4, - "itemCountMax": 12, + "itemCountMax": 18, "itemTypeWhitelist": [ "5448eb774bdc2d0a728b4567", "5448e8d64bdc2dce718b4568", diff --git a/project/src/generators/RagfairOfferGenerator.ts b/project/src/generators/RagfairOfferGenerator.ts index 8f69963a..0d470edf 100644 --- a/project/src/generators/RagfairOfferGenerator.ts +++ b/project/src/generators/RagfairOfferGenerator.ts @@ -123,6 +123,7 @@ export class RagfairOfferGenerator // Clone to avoid modifying original array const itemsClone = this.cloner.clone(items); + const itemStackCount = itemsClone[0].upd?.StackObjectsCount ?? 1; // Hydrate ammo boxes with cartridges + ensure only 1 item is present (ammo box) // On offer refresh dont re-add cartridges to ammo box that already has cartridges @@ -132,8 +133,8 @@ export class RagfairOfferGenerator this.itemHelper.addCartridgesToAmmoBox(itemsClone, this.itemHelper.getItem(items[0]._tpl)[1]); } - const itemRootCount = items.filter((item) => item.slotId === "hideout").length; - const roublePrice = Math.round(this.convertOfferRequirementsIntoRoubles(offerRequirements)); + const roubleListingPrice = Math.round(this.convertOfferRequirementsIntoRoubles(offerRequirements)); + const singleItemListingPrice = isPackOffer ? roubleListingPrice / itemStackCount : roubleListingPrice; const offer: IRagfairOffer = { _id: this.hashUtil.generate(), @@ -143,14 +144,13 @@ export class RagfairOfferGenerator items: itemsClone, itemsCost: Math.round(this.handbookHelper.getTemplatePrice(items[0]._tpl)), // Handbook price requirements: offerRequirements, - requirementsCost: roublePrice, - summaryCost: roublePrice, + requirementsCost: singleItemListingPrice, + summaryCost: roubleListingPrice, startTime: time, endTime: this.getOfferEndTime(userID, time), loyaltyLevel: loyalLevel, sellInOnePiece: isPackOffer, locked: false, - unlimitedCount: false, }; this.offerCounter++; diff --git a/project/src/models/eft/ragfair/IRagfairOffer.ts b/project/src/models/eft/ragfair/IRagfairOffer.ts index 40d394f0..e2937694 100644 --- a/project/src/models/eft/ragfair/IRagfairOffer.ts +++ b/project/src/models/eft/ragfair/IRagfairOffer.ts @@ -11,19 +11,21 @@ export interface IRagfairOffer intId: number /** Handbook price */ itemsCost: number - /** Rouble price */ + /** Rouble price per item */ requirementsCost: number startTime: number endTime: number sellInOnePiece: boolean + /** Rouble price - same as requirementsCost */ + summaryCost: number + user: IRagfairOfferUser + + /** Trader only */ + unlimitedCount?: boolean loyaltyLevel: number buyRestrictionMax?: number buyRestrictionCurrent?: number - locked: boolean - unlimitedCount: boolean - /** Rouble price */ - summaryCost: number - user: IRagfairOfferUser + locked?: boolean } export interface OfferRequirement