Compare commits

...

5 Commits

Author SHA1 Message Date
562a74abb4 Make ammo cheaper across the board 2024-02-08 21:30:58 +11:00
071b921188 Add extra slot config 2024-02-08 20:57:55 +11:00
678f54cdc3 Small json fixes 2024-02-08 19:54:19 +11:00
a1a4388f9c Add scarce offers feature 2024-02-08 19:52:15 +11:00
9ea926cd7c Add faster sales setting 2024-02-08 19:31:03 +11:00
3 changed files with 96 additions and 10 deletions

View File

@ -18,10 +18,33 @@
"5b47574386f77428ca22b33c" // Ammo boxes, some ammo boxes are really cheap, some are very expensive. Just buy loose rounds instead.
],
// By default, SPT flea prices will use a trader's price for an item if the trader's price is higher. Even custom item configs from this mod won't apply so you might need to disable this if you have some items set really cheap.
"useTraderPriceForOffersIfHigher": true,
// When an item doesn't have a flea price because it was blacklisted by default, multiply the handbook price by this number to get the new flea price. Default 3.
"handbookPriceMultiplier": 3
"handbookPriceMultiplier": 3,
// Overrides ragfairConfig.runIntervalSeconds if config.enableFasterSales is true. Default 3s.
"runIntervalSecondsOverride": 3,
// When config.enableScarceOffers is true, use these values to limit the number of offers on the flea.
"offerItemCountOverride": {
"max": 3,
"min": 1
},
// When config.enableScarceOffers is true, use these values to limit the quantity of a stackable item (like ammo) per offer on the flea.
"stackablePercentOverride": {
"max": 200,
"min": 20
},
// When config.enableScarceOffers is true, use these values to limit the quantity of a non-stackable item (most items) per offer on the flea.
"nonStackableCountOverride": {
"max": 3,
"min": 1
},
// Adds the specified amount of offers for your current flea market rating if config.addExtraOfferSlot is enabled.
"extraOfferSlotsToAdd": 1
}

View File

@ -2,6 +2,15 @@
// Main feature of the mod, set to true to disable blacklist, false to keep it enabled. Other parts of the mod still applies however. Default true.
"disableBsgBlacklist": true,
// Make cheap offers sell faster. Default true.
"enableFasterSales": true,
// Reduces the number of offers and quantities per offer to make the flea experience more hardcore. Highly recommend to enable but default is false.
"enableScarceOffers": true,
// Adds an extra offer for your current flea market rating bracket. So a new account at level 15 can create 3 offers instead of 2. Default is false. Extra amount is configurable in advancedConfigs.
"addExtraOfferSlot": true,
// Limits the flea price of many attachments as these prices can be inflated heavily by Gunsmith tasks in Live Tarkov. Default true.
"limitMaxPriceOfAttachments": true,
@ -20,22 +29,37 @@
// You can manually add flea prices to items, set a multiplier to their existing price or blacklist them entirely.
"customItemConfigs": [
{
// .338 AP round, the best round in the game so it's quite expensive. This also demonstrates the use of the priceMultiplier property. You can lower this if you think it's too expensive, 12k a round.",
// .338 AP round, the best round in the game so it's quite expensive. This also demonstrates the use of the priceMultiplier property. You can lower this if you think it's too expensive.",
"itemId": "5fc382a9d724d907e2077dab",
"priceMultiplier": 1.2
},
{
// .338 FMJ round",
"itemId": "5fc275cf85fd526b824a571a",
"priceMultiplier": 1.3
},
{
// 6.8x51mm FMJ, a bit expensive at 5k a round because of the novelty
"itemId": "6529302b8c26af6326029fb7",
"fleaPriceOverride": 2000
},
{
// 6.8x51mm Hybrid, it's around 2k using my ammo price balancing but we'll make it a bit more expensive due to it's novelty.
"itemId": "6529243824cbe3c74a05e5c1",
"fleaPriceOverride": 2800
},
{
// Regular Weapon Case, I think it's too expensive at the 5 mil mark by default",
"itemId": "59fb023c86f7746d0d4b423c",
"fleaPriceOverride": 1500000
},
{
"itemIdHint": "Dogtag BEAR",
// Dogtag BEAR
"itemId": "59f32bb586f774757e1e8442",
"blacklisted": true
},
{
"itemIdHint": "Dogtag USEC",
// Dogtag USEC
"itemId": "59f32c3b86f77472a31742f0",
"blacklisted": true
}

View File

@ -29,6 +29,7 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { HandbookItem } from "@spt-aki/models/eft/common/tables/IHandbookBase";
import { getAttachmentCategoryIds, isBulletOrShotgunShell } from "./helpers";
import { IGlobals } from "@spt-aki/models/eft/common/IGlobals";
class TheBlacklistMod implements IPostDBLoadModAsync {
private logger: ILogger;
@ -62,11 +63,12 @@ class TheBlacklistMod implements IPostDBLoadModAsync {
const itemTable = tables.templates.items;
const handbookItems = tables.templates.handbook.Items;
const prices = tables.templates.prices;
const globals = tables.globals;
this.baselineBullet = itemTable[this.advancedConfig.baselineBulletId];
ragfairConfig.dynamic.blacklist.enableBsgList = !this.config.disableBsgBlacklist;
ragfairConfig.dynamic.useTraderPriceForOffersIfHigher = this.advancedConfig.useTraderPriceForOffersIfHigher != null ? this.advancedConfig.useTraderPriceForOffersIfHigher : true;
this.updateRagfairConfig(ragfairConfig);
this.updateGlobals(globals);
if (this.config.limitMaxPriceOfAttachments) {
this.attachmentCategoryIds = getAttachmentCategoryIds(tables.templates.handbook.Categories);
@ -128,6 +130,41 @@ class TheBlacklistMod implements IPostDBLoadModAsync {
}
}
private updateRagfairConfig(ragfairConfig: IRagfairConfig) {
ragfairConfig.dynamic.blacklist.enableBsgList = !this.config.disableBsgBlacklist;
if (this.advancedConfig.useTraderPriceForOffersIfHigher != null) {
ragfairConfig.dynamic.useTraderPriceForOffersIfHigher = !!this.advancedConfig.useTraderPriceForOffersIfHigher;
}
if (this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) {
ragfairConfig.runIntervalSeconds = this.advancedConfig.runIntervalSecondsOverride;
}
if (this.config.enableScarceOffers) {
this.updateRagfairConfigToHaveScarceOffers(ragfairConfig);
}
}
private updateRagfairConfigToHaveScarceOffers(ragfairConfig: IRagfairConfig) {
const minMaxPropertiesToOverride = ["offerItemCount", "stackablePercent", "nonStackableCount"];
for (const propertyToOverride of minMaxPropertiesToOverride) {
ragfairConfig.dynamic[propertyToOverride].max = this.advancedConfig[`${propertyToOverride}Override`].max;
ragfairConfig.dynamic[propertyToOverride].min = this.advancedConfig[`${propertyToOverride}Override`].min;
}
}
private updateGlobals(globals: IGlobals) {
const ragfairConfig = globals.config.RagFair;
if (this.config.addExtraOfferSlot) {
for (const settingForBracket of ragfairConfig.maxActiveOfferCount) {
settingForBracket.count += this.advancedConfig.extraOfferSlotsToAdd;
}
}
}
// Returns true if we updated something using the customItemConfig so we can skip to the next handbook item.
private updateItemUsingCustomItemConfig(customItemConfig, item: ITemplateItem , prices: Record<string, number>, originalPrice: number, ragfairConfig: IRagfairConfig): boolean {
if (customItemConfig?.blacklisted) {
@ -199,11 +236,13 @@ class TheBlacklistMod implements IPostDBLoadModAsync {
const baseDamageMultiplier = item._props.Damage / baselineDamage;
let penetrationMultiplier: number;
if (basePenetrationMultiplier > 1) {
// We are checking for > 0.99 because we want the baseline bullet (mult of 1) to be close to its baseline price.
if (basePenetrationMultiplier > 0.99) {
// A good gradient to make higher power rounds more expensive
penetrationMultiplier = 7 * basePenetrationMultiplier - 6;
penetrationMultiplier = 3 * basePenetrationMultiplier - 2;
} else {
// Due to maths above, its really easy to go < 1. The baseline ammo is mid tier with a reasonable 1000 rouble each. Ammo weaker than this tend to be pretty crap so we'll make it much cheaper
// The baseline ammo is mid tier with a reasonable 1000 rouble each. Ammo weaker than this tend to be pretty crap so we'll make it much cheaper
const newMultiplier = basePenetrationMultiplier * 0.7;
penetrationMultiplier = newMultiplier < 0.1 ? 0.1 : newMultiplier;
}