Fence changes:

Larger number of weapon presets
Larger stack size for ammos (override stack size of ammo by parent id, not item id)
Removed ammo boxes from blacklist + add max limit of 2
Removed fence debug logging
Make weapon picker check if weapon is on blacklist before adding
Fixed incorrect weapon mod removal check
Reduced chances mods are removed from weapons
This commit is contained in:
Dev 2024-02-08 21:58:47 +00:00
parent 596785eda9
commit 28677f672b
2 changed files with 42 additions and 29 deletions

View File

@ -55,8 +55,8 @@
"partialRefreshChangePercent": 15,
"assortSize": 140,
"weaponPresetMinMax": {
"min": 8,
"max": 15
"min": 12,
"max": 19
},
"equipmentPresetMinMax": {
"min": 8,
@ -66,6 +66,7 @@
"presetPriceMult": 1.5,
"regenerateAssortsOnRefresh": false,
"itemTypeLimits": {
"543be5cb4bdc2deb348b4568": 2,
"550aa4bf4bdc2dd6348b456b": 3,
"55818add4bdc2d5b648b456f": 5,
"5448bc234bdc2d3c308b4569": 5,
@ -113,6 +114,10 @@
"59e690b686f7746c9f75e848": {
"min": 5,
"max": 15
},
"5485a8684bdc2da71d8b4567": {
"min": 80,
"max": 7000
}
},
"itemCategoryRoublePriceLimit": {
@ -154,18 +159,20 @@
},
"presetSlotsToRemoveChancePercent": {
"mod_scope": 70,
"mod_magazine": 60,
"mod_magazine": 50,
"mod_sight_rear": 20,
"mod_sight_front": 20,
"mod_muzzle": 70,
"mod_pistol_grip": 40,
"mod_stock": 50,
"mod_stock_000": 20,
"mod_tactical_2": 40,
"mod_muzzle": 40,
"mod_pistol_grip": 5,
"mod_stock": 5,
"mod_handguard": 10,
"mod_barrel": 5,
"mod_stock_000": 10,
"mod_tactical_2": 35,
"mod_foregrip": 20,
"mod_mount": 20,
"mod_reciever": 10,
"mod_charge": 20,
"mod_mount": 40,
"mod_reciever": 5,
"mod_charge": 5,
"mod_mount_000": 20,
"mod_mount_002": 20,
"mod_mount_003": 20,
@ -176,14 +183,13 @@
"mod_tactical_002": 40,
"mod_tactical_003": 40,
"front_plate": 25,
"back_plate": 25,
"left_side_plate": 25,
"right_side_plate": 25
"back_plate": 75,
"left_side_plate": 75,
"right_side_plate": 75
},
"blacklistSeasonalItems": true,
"blacklist": [
"5c164d2286f774194c5e69fa",
"543be5cb4bdc2deb348b4568",
"543be6674bdc2df1348b4569",
"5448bf274bdc2dfc2f8b456a",
"5447bedf4bdc2d87278b4568",

View File

@ -196,7 +196,6 @@ export class FenceService
{
const itemQualityModifier = this.itemHelper.getItemQualityModifier(item);
assort.barter_scheme[item._id][0][0].count *= itemQualityModifier;
this.logger.warning(`Reduced item ${item._tpl} price to : ${assort.barter_scheme[item._id][0][0].count}`);
}
}
@ -527,16 +526,18 @@ export class FenceService
while (weaponPresetsAddedCount < desiredWeaponPresetsCount)
{
const randomPresetRoot = this.randomUtil.getArrayValue(weaponPresetRootItems);
if (this.traderConfig.fence.blacklist.includes(randomPresetRoot._tpl))
{
continue;
}
const rootItemDb = this.itemHelper.getItem(randomPresetRoot._tpl)[1];
const presetWithChildrenClone = this.jsonUtil.clone(
this.itemHelper.findAndReturnChildrenAsItems(baseFenceAssort.items, randomPresetRoot._id),
);
if (this.itemHelper.isOfBaseclass(rootItemDb._id, BaseClasses.WEAPON))
{
this.randomiseItemUpdProperties(rootItemDb, presetWithChildrenClone[0]);
}
this.randomiseItemUpdProperties(rootItemDb, presetWithChildrenClone[0]);
this.removeRandomModsOfItem(presetWithChildrenClone);
@ -752,6 +753,20 @@ export class FenceService
*/
protected getSingleItemStackCount(itemDbDetails: ITemplateItem): number
{
if (this.itemHelper.isOfBaseclass(itemDbDetails._id, BaseClasses.AMMO))
{
const overrideValues = this.traderConfig.fence.itemStackSizeOverrideMinMax[itemDbDetails._parent];
if (overrideValues)
{
return this.randomUtil.getInt(overrideValues.min, overrideValues.max);
}
// No override, use stack max size from item db
return itemDbDetails._props.StackMaxSize === 1
? 1
: this.randomUtil.getInt(itemDbDetails._props.StackMinRandom, itemDbDetails._props.StackMaxRandom);
}
// Check for override in config, use values if exists
const overrideValues = this.traderConfig.fence.itemStackSizeOverrideMinMax[itemDbDetails._id];
if (overrideValues)
@ -759,14 +774,6 @@ export class FenceService
return this.randomUtil.getInt(overrideValues.min, overrideValues.max);
}
if (this.itemHelper.isOfBaseclass(itemDbDetails._id, BaseClasses.AMMO))
{
// No override, use stack max size from item db
return itemDbDetails._props.StackMaxSize === 1
? 1
: this.randomUtil.getInt(itemDbDetails._props.StackMinRandom, itemDbDetails._props.StackMaxRandom);
}
return 1;
}
@ -824,7 +831,7 @@ export class FenceService
// Roll from 0 to 9999, then divide it by 100: 9999 = 99.99%
const randomChance = this.randomUtil.getInt(0, 9999) / 100;
return randomChance > removalChance && !itemsBeingDeleted.includes(weaponMod._id);
return removalChance > randomChance && !itemsBeingDeleted.includes(weaponMod._id);
}
/**