Merge branch 'master' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.0

This commit is contained in:
Dev 2023-11-04 10:43:06 +00:00
commit 24894643de
6 changed files with 57 additions and 41 deletions

View File

@ -436,7 +436,8 @@
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75, "lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75 "laserIsActiveChancePercent": 75,
"forceStock": true
}, },
"bossgluhar": { "bossgluhar": {
"nvgIsActiveChanceDayPercent": 10, "nvgIsActiveChanceDayPercent": 10,
@ -444,13 +445,15 @@
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightIsActiveDayChancePercent": 45, "lightIsActiveDayChancePercent": 45,
"lightIsActiveNightChancePercent": 95, "lightIsActiveNightChancePercent": 95,
"laserIsActiveChancePercent": 95 "laserIsActiveChancePercent": 95,
"forceStock": true
}, },
"bosskilla": { "bosskilla": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightIsActiveDayChancePercent": 35, "lightIsActiveDayChancePercent": 35,
"lightIsActiveNightChancePercent": 85, "lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 85 "laserIsActiveChancePercent": 85,
"forceStock": true
}, },
"bosskojaniy": { "bosskojaniy": {
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
@ -472,7 +475,8 @@
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75, "lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75 "laserIsActiveChancePercent": 75,
"forceStock": true
}, },
"bossknight": { "bossknight": {
"nvgIsActiveChanceDayPercent": 10, "nvgIsActiveChanceDayPercent": 10,
@ -480,21 +484,24 @@
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75, "lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75 "laserIsActiveChancePercent": 75,
"forceStock": true
}, },
"bosszryachiy": { "bosszryachiy": {
"nvgIsActiveChanceDayPercent": 10, "nvgIsActiveChanceDayPercent": 10,
"nvgIsActiveChanceNightPercent": 90, "nvgIsActiveChanceNightPercent": 90,
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 85, "lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 85 "laserIsActiveChancePercent": 85,
"forceStock": true
}, },
"bossboar": { "bossboar": {
"nvgIsActiveChanceDayPercent": 10, "nvgIsActiveChanceDayPercent": 10,
"nvgIsActiveChanceNightPercent": 90, "nvgIsActiveChanceNightPercent": 90,
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 85, "lightIsActiveNightChancePercent": 85,
"laserIsActiveChancePercent": 85 "laserIsActiveChancePercent": 85,
"forceStock": true
}, },
"bosstest": {}, "bosstest": {},
"followerbully": { "followerbully": {
@ -551,6 +558,7 @@
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75, "lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75, "laserIsActiveChancePercent": 75,
"forceStock": true,
"weaponModLimits": { "weaponModLimits": {
"scopeLimit": 1, "scopeLimit": 1,
"lightLaserLimit": 1 "lightLaserLimit": 1
@ -562,7 +570,8 @@
"faceShieldIsActiveChancePercent": 100, "faceShieldIsActiveChancePercent": 100,
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75, "lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75 "laserIsActiveChancePercent": 75,
"forceStock": true
}, },
"followerzryachiy": { "followerzryachiy": {
"nvgIsActiveChanceDayPercent": 10, "nvgIsActiveChanceDayPercent": 10,
@ -590,6 +599,7 @@
"lightIsActiveDayChancePercent": 25, "lightIsActiveDayChancePercent": 25,
"lightIsActiveNightChancePercent": 75, "lightIsActiveNightChancePercent": 75,
"laserIsActiveChancePercent": 75, "laserIsActiveChancePercent": 75,
"forceStock": true,
"weaponModLimits": { "weaponModLimits": {
"scopeLimit": 2, "scopeLimit": 2,
"lightLaserLimit": 1 "lightLaserLimit": 1
@ -620,6 +630,7 @@
"lightIsActiveDayChancePercent": 35, "lightIsActiveDayChancePercent": 35,
"lightIsActiveNightChancePercent": 95, "lightIsActiveNightChancePercent": 95,
"laserIsActiveChancePercent": 95, "laserIsActiveChancePercent": 95,
"forceStock": true,
"weaponModLimits": { "weaponModLimits": {
"scopeLimit": 1, "scopeLimit": 1,
"lightLaserLimit": 1 "lightLaserLimit": 1
@ -784,7 +795,7 @@
"Backpack": 35, "Backpack": 35,
"FaceCover": 5 "FaceCover": 5
}, },
"randomisedWeaponModSlots": [], "randomisedWeaponModSlots": [],
"mods": { "mods": {
"mod_barrel": 20, "mod_barrel": 20,
"mod_bipod": 10, "mod_bipod": 10,
@ -860,8 +871,7 @@
"mod_reciever": ["5d4405aaa4b9361e6a4e6bd3"], "mod_reciever": ["5d4405aaa4b9361e6a4e6bd3"],
"mod_stock": ["5cde739cd7f00c0010373bd3"], "mod_stock": ["5cde739cd7f00c0010373bd3"],
"mod_rear_sight": ["5a0ed824fcdbcb0176308b0d"], "mod_rear_sight": ["5a0ed824fcdbcb0176308b0d"],
"mod_front_sight": ["5a0f096dfcdbcb0176308b15"], "mod_front_sight": ["5a0f096dfcdbcb0176308b15"]
"mod_magazine": ["6241c2c2117ad530666a5108"]
}, },
"cartridge": { "cartridge": {
"Caliber23x75": ["5e85a9f4add9fe03027d9bf1"], "Caliber23x75": ["5e85a9f4add9fe03027d9bf1"],

View File

@ -275,7 +275,7 @@
"pmcresponse-victim_positive_12": "Good kill, I'll get you next time", "pmcresponse-victim_positive_12": "Good kill, I'll get you next time",
"pmcresponse-victim_positive_13": "You had good angles on me", "pmcresponse-victim_positive_13": "You had good angles on me",
"pmcresponse-victim_positive_14": "I'll get you next time", "pmcresponse-victim_positive_14": "I'll get you next time",
"pmcresponse-victim_positive_15": "You really binted my bingos", "pmcresponse-victim_positive_15": "You really binted my bogos :alien:",
"pmcresponse-victim_positive_16": "You're a stone-cold killer. I didn't stand a chance", "pmcresponse-victim_positive_16": "You're a stone-cold killer. I didn't stand a chance",
"pmcresponse-victim_positive_17": "Alright fair that was a good shot", "pmcresponse-victim_positive_17": "Alright fair that was a good shot",
"pmcresponse-victim_positive_18": "Enjoy my loot", "pmcresponse-victim_positive_18": "Enjoy my loot",

View File

@ -273,11 +273,13 @@ export class BotEquipmentModGenerator
modSpawnChances.mod_handguard = 100; modSpawnChances.mod_handguard = 100;
} }
// If stock mod can take a sub stock mod, force spawn chance to be 100% to ensure stock gets added // If stock mod can take a sub stock mod, force spawn chance to be 100% to ensure sub-stock gets added
if (modSlot === "mod_stock" && modToAddTemplate._props.Slots.find(x => x._name.includes("mod_stock"))) // Or if mod_stock is configured to be forced on
if (modSlot === "mod_stock" && (modToAddTemplate._props.Slots.find(x => x._name.includes("mod_stock") || botEquipConfig.forceStock)))
{ {
// Stock mod can take additional stocks, could be a locking device, force 100% chance // Stock mod can take additional stocks, could be a locking device, force 100% chance
modSpawnChances.mod_stock = 100; const stockSlots = ["mod_stock", "mod_stock_000", "mod_stock_akms"];
this.adjustSlotSpawnChances(modSpawnChances, stockSlots, 100);
} }
const modId = this.hashUtil.generate(); const modId = this.hashUtil.generate();

View File

@ -333,7 +333,7 @@ export class BotLootGenerator
{ {
this.itemHelper.addCartridgesToAmmoBox(itemsToAdd, itemToAddTemplate); this.itemHelper.addCartridgesToAmmoBox(itemsToAdd, itemToAddTemplate);
} }
// make money a stack // Make money a stack
else if (this.itemHelper.isOfBaseclass(itemToAddTemplate._id, BaseClasses.MONEY)) else if (this.itemHelper.isOfBaseclass(itemToAddTemplate._id, BaseClasses.MONEY))
{ {
this.randomiseMoneyStackSize(isPmc, itemToAddTemplate, itemsToAdd[0]); this.randomiseMoneyStackSize(isPmc, itemToAddTemplate, itemsToAdd[0]);
@ -374,14 +374,13 @@ export class BotLootGenerator
} }
} }
/** /**
* Add generated weapons to inventory as loot * Add generated weapons to inventory as loot
* @param botInventory inventory to add preset to * @param botInventory inventory to add preset to
* @param equipmentSlot slot to place the preset in (backpack) * @param equipmentSlot slot to place the preset in (backpack)
* @param templateInventory bots template, assault.json * @param templateInventory bots template, assault.json
* @param modChances chances for mods to spawn on weapon * @param modChances chances for mods to spawn on weapon
* @param botRole bots role, .e.g. pmcBot * @param botRole bots role .e.g. pmcBot
* @param isPmc are we generating for a pmc * @param isPmc are we generating for a pmc
*/ */
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void
@ -498,42 +497,45 @@ export class BotLootGenerator
/** /**
* Randomise the stack size of a money object, uses different values for pmc or scavs * Randomise the stack size of a money object, uses different values for pmc or scavs
* @param isPmc is this a PMC * @param isPmc Is money on a PMC bot
* @param itemTemplate item details * @param itemTemplate item details from db
* @param moneyItem Money stack to randomise * @param moneyItem Money item to randomise
*/ */
protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void
{ {
// Only add if no upd or stack objects exist - preserves existing stack count // PMCs have a different stack max size
if (!moneyItem.upd?.StackObjectsCount) const minStackSize = itemTemplate._props.StackMinRandom;
{ const maxStackSize = (isPmc)
// PMCs have a different stack max size ? this.pmcConfig.dynamicLoot.moneyStackLimits[itemTemplate._id]
const minStackSize = itemTemplate._props.StackMinRandom; : itemTemplate._props.StackMaxRandom;
const maxStackSize = (isPmc) const randomSize = this.randomUtil.getInt(minStackSize, maxStackSize);
? this.pmcConfig.dynamicLoot.moneyStackLimits[itemTemplate._id]
: itemTemplate._props.StackMaxRandom;
moneyItem.upd = { "StackObjectsCount": this.randomUtil.getInt(minStackSize, maxStackSize) }; if (!moneyItem.upd)
{
moneyItem.upd = {};
} }
moneyItem.upd.StackObjectsCount = randomSize;
} }
/** /**
* Randomise the size of an ammo stack * Randomise the size of an ammo stack
* @param isPmc is this a PMC * @param isPmc Is ammo on a PMC bot
* @param itemTemplate item details * @param itemTemplate item details from db
* @param ammoItem Ammo stack to randomise * @param ammoItem Ammo item to randomise
*/ */
protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void
{ {
// only add if no upd or stack objects exist - preserves existing stack count const randomSize = itemTemplate._props.StackMaxSize === 1
if (!ammoItem.upd?.StackObjectsCount) ? 1
{ : this.randomUtil.getInt(itemTemplate._props.StackMinRandom, itemTemplate._props.StackMaxRandom);
const randomSize = itemTemplate._props.StackMaxSize === 1
? 1
: this.randomUtil.getInt(itemTemplate._props.StackMinRandom, itemTemplate._props.StackMaxRandom);
ammoItem.upd = { StackObjectsCount: randomSize }; if (!ammoItem.upd)
{
ammoItem.upd = {};
} }
ammoItem.upd.StackObjectsCount = randomSize ;
} }
/** /**

View File

@ -115,7 +115,7 @@ class ItemHelper
return handbookPrice; return handbookPrice;
} }
const dynamicPrice = this.getDynamicItemPrice[tpl]; const dynamicPrice = this.getDynamicItemPrice(tpl);
if (dynamicPrice) if (dynamicPrice)
{ {
return dynamicPrice; return dynamicPrice;

View File

@ -112,6 +112,8 @@ export interface EquipmentFilters
weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[] weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]
/** Same as weightingAdjustments but based on player level instead of bot level */ /** Same as weightingAdjustments but based on player level instead of bot level */
weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[] weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]
/** Should the stock mod be forced to spawn on bot */
forceStock: boolean
} }
export interface ModLimits export interface ModLimits