v1.1.2 fixes, and feature additions.

This commit is contained in:
VforValens 2022-08-04 18:05:23 -04:00
parent 446d309d3f
commit 6e81836ff4
7 changed files with 174 additions and 113 deletions

Binary file not shown.

View File

@ -5,11 +5,11 @@
{ {
"ammoStacks": "ammoStacks":
{ {
"grenadeCartridges": 2, "grenadeCartridges": 1,
"marksmanCartridges": 2, "marksmanCartridges": 40,
"pistolCartridges": 2, "pistolCartridges": 50,
"rifleCartridges": 2, "rifleCartridges": 60,
"shotgunCartridges": 2 "shotgunCartridges": 20
} }
}, },
@ -17,22 +17,34 @@
{ {
"bossChance": "bossChance":
{ {
"activated": true, "activated": false,
"chance": 2 "chance": 100
}, },
"maxBotCap": 2, "maxBotCap": 20,
"pmc": "pmc":
{ {
"chanceSameSideIsHostilePercent": 2, "chanceSameSideIsHostilePercent": 50,
"containersOnPMCs": true, "containersOnPMCs": true,
"isUsec": 2, "isUsec": 50,
"lootNValue": 2, "lootNValue": 3,
"maxBackpackLootTotalRub": 2, "maxBackpackLootTotalRub": 150000,
"maxPocketLootTotalRub": 2, "maxPocketLootTotalRub": 50000,
"maxVestLootTotalRub": 2, "maxVestLootTotalRub": 50000,
"pmcDifficulty": "Easy",
"difficultyWeights":
{
"difficulty": "asonline",
"useWeights": false,
"weights":
{
"easy": 3,
"normal": 5,
"hard": 2,
"impossible": 1
}
},
"convertIntoPmcChance": "convertIntoPmcChance":
{ {
@ -43,36 +55,36 @@
"assault for 3.2.0": "assault for 3.2.0":
{ {
"min": 18, "min": 15,
"max": 45 "max": 40
}, },
"cursedassault for 3.2.0": "cursedassault for 3.2.0":
{ {
"min": 18, "min": 15,
"max": 45 "max": 40
}, },
"pmcbot for 3.2.0": "pmcbot for 3.2.0":
{ {
"min": 18, "min": 15,
"max": 35 "max": 30
}, },
"exusec for 3.2.0": "exusec for 3.2.0":
{ {
"min": 5, "min": 5,
"max": 25 "max": 20
} }
} }
}, },
"scav": "scav":
{ {
"lootNValue": 2 "lootNValue": 4
} }
}, },
"flea": "flea":
{ {
"minUserLevel": 2, "minUserLevel": 15,
"blacklist": "blacklist":
{ {
@ -82,35 +94,35 @@
"condition": "condition":
{ {
"conditionChance": 0.4, "conditionChance": 0.2,
"min": 0.8, "min": 0.6,
"max": 0.9 "max": 1.0
}, },
"currencies": "currencies":
{ {
"roubles": 79, "roubles": 78,
"dollars": 21, "dollars": 20,
"euros": 1 "euros": 2
}, },
"offerItemCount": "offerItemCount":
{ {
"min": 9, "min": 8,
"max": 16 "max": 15
}, },
"reputation": "reputation":
{ {
"gain": 0.000002, "gain": 0.0000002,
"loss": 0.000002 "loss": 0.0000002
}, },
"time": "time":
{ {
"baseSellTime": 1, "baseSellTime": 15,
"minSellTime": 1, "minSellTime": 5,
"maxSellTime": 1 "maxSellTime": 15
} }
}, },
@ -119,47 +131,47 @@
"damagePerMeter": 3, "damagePerMeter": 3,
"safeHeight": 9, "safeHeight": 9,
"maxLoyaltyTraders": true, "maxLoyaltyTraders": false,
"timeBeforeDeployLocal": 1, "timeBeforeDeployLocal": 10,
"match_end": "match_end":
{ {
"survived_exp_requirement": 1, "survived_exp_requirement": 200,
"survived_seconds_requirement": 1, "survived_seconds_requirement": 420,
"survived_exp_reward": 1, "survived_exp_reward": 300,
"mia_exp_reward": 1, "mia_exp_reward": 200,
"runner_exp_reward": 1, "runner_exp_reward": 200,
"leftMult": 2, "leftMult": 0,
"miaMult": 12, "miaMult": 1,
"survivedMult": 2, "survivedMult": 1.3,
"runnerMult": 2, "runnerMult": 0.5,
"killedMult": 2, "killedMult": 1,
"headShotMult": 12, "headShotMult": 1.2,
"expOnDamageAllHealth": 52 "expOnDamageAllHealth": 50
} }
}, },
"hideout": "hideout":
{ {
"airFilterUnitFlowRate": 0.004722222222222, "airFilterUnitFlowRate": 0.0047222222222222,
"constructionTime": 2, "constructionTime": 1,
"generatorFuelFlowRate": 0.001319444444444, "generatorFuelFlowRate": 0.0013194444444444,
"gpuBoostRate": 0.04125, "gpuBoostRate": 0.041225,
"productionTime": 2, "productionTime": 1,
"scavCaseTime": 2 "scavCaseTime": 1
}, },
"insurance": "insurance":
{ {
"insuranceMultiplier": "insuranceMultiplier":
{ {
"prapor": 0.1, "prapor": 0.16,
"therapist": 0.2 "therapist": 0.25
}, },
"returnChancePercent": "returnChancePercent":
{ {
"prapor": 8, "prapor": 80,
"therapist": 8 "therapist": 85
} }
}, },
@ -168,72 +180,73 @@
{ {
"standardStash": "standardStash":
{ {
"vertical": 2, "vertical": 28,
"horizontal": 11 "horizontal": 10
}, },
"behindStash": "behindStash":
{ {
"vertical": 3, "vertical": 38,
"horizontal": 11 "horizontal": 10
}, },
"escapeStash": "escapeStash":
{ {
"vertical": 4, "vertical": 48,
"horizontal": 11 "horizontal": 10
}, },
"eodStash": "eodStash":
{ {
"vertical": 6, "vertical": 68,
"horizontal": 11 "horizontal": 10
}, },
"examinedByDefault": true, "examinedByDefault": false,
"removeBackpackFilter": true, "removeBackpackFilter": true,
"weightModifier": 2, "removeKeyUsageMax": false,
"roublesMaxStack": 2, "weightModifier": 1,
"dollarsMaxStack": 2, "roublesMaxStack": 500000,
"eurosMaxStack": 2 "dollarsMaxStack": 50000,
"eurosMaxStack": 50000
}, },
"locations": "locations":
{ {
"allExtractsAvailable": true, "allExtractsAvailable": false,
"exfilTime": 2, "exfilTime": 8,
"extractionsExtended": true, "extractionsExtended": false,
"noExtractRestrictions": true "noExtractRestrictions": false
}, },
"loot": "loot":
{ {
"containersInMarkedRoom": true, "containersInMarkedRoom": true,
"looseLootMultiplier": 2, "looseLootMultiplier": 1,
"staticLootMultiplier": 2 "staticLootMultiplier": 1
}, },
"raid": "raid":
{ {
"carExtractBaseStandingGain": 0.2, "carExtractBaseStandingGain": 0.25,
"chompiesBossFix": true, "chompiesBossFix": true,
"fixOpenZones": true, "fixOpenZones": true,
"scavExtractGain": 0.02, "scavExtractGain": 0.01,
"timeLimit": 2, "timeLimit": 60,
"aiAmount": "High", "aiAmount": "asonline",
"aiDifficulty": "Medium", "aiDifficulty": "asonline",
"bossEnabled": false, "bossEnabled": true,
"scavWars": true, "scavWars": false,
"taggedAndCursed": true, "taggedAndCursed": false,
"enablePve": false "enablePve": true
}, },
"prewipe_events": "prewipe_events":
{ {
"allBossesOnReserve": true, "allBossesOnReserve": false,
"allTradersSellCheapItems": true, "allTradersSellCheapItems": false,
"glukharOnLabs": true, "glukharOnLabs": false,
"killaOnFactory": true, "killaOnFactory": false,
"makeObdolbosPowerful": true "makeObdolbosPowerful": false
} }
} }

View File

@ -1,4 +1,4 @@
export interface Root export interface Config
{ {
DebugMode: boolean DebugMode: boolean
ammo: Ammo ammo: Ammo
@ -51,10 +51,18 @@ export interface Pmc
maxBackpackLootTotalRub: number maxBackpackLootTotalRub: number
maxPocketLootTotalRub: number maxPocketLootTotalRub: number
maxVestLootTotalRub: number maxVestLootTotalRub: number
pmcDifficulty: string difficultyWeights: DifficultyWeights
convertIntoPmcChance: ConvertIntoPmcChance convertIntoPmcChance: ConvertIntoPmcChance
} }
export interface DifficultyWeights
{
useWeights: boolean
weights: Record<string, number>
difficulty: string
}
export interface ConvertIntoPmcChance export interface ConvertIntoPmcChance
{ {
@ -208,6 +216,7 @@ export interface Items
eodStash: Stash eodStash: Stash
examinedByDefault: boolean examinedByDefault: boolean
removeBackpackFilter: boolean removeBackpackFilter: boolean
removeKeyUsageMax: boolean
weightModifier: number weightModifier: number
roublesMaxStack: number roublesMaxStack: number
dollarsMaxStack: number dollarsMaxStack: number

View File

@ -1,6 +1,6 @@
{ {
"name": "Valens-AIO", "name": "Valens-AIO",
"version": "1.1.1", "version": "1.1.2",
"main": "src/mod.js", "main": "src/mod.js",
"license": "CC BY-NC-ND 4.0", "license": "CC BY-NC-ND 4.0",
"author": "Valens", "author": "Valens",

View File

@ -3,9 +3,10 @@ import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger"; import { Logger } from "./logger";
import type { BossLocationSpawn } from "@spt-aki/models/eft/common/ILocationBase"; import type { BossLocationSpawn } from "@spt-aki/models/eft/common/ILocationBase";
import { Traders } from "./traders";
import { Money } from "@spt-aki/models/enums/Money" import { Money } from "@spt-aki/models/enums/Money"
import { Config } from "../config/config"; import { Config } from "../config/config";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { ITrader } from "@spt-aki/models/eft/common/tables/ITrader";
export class Bots export class Bots
{ {
@ -13,14 +14,16 @@ export class Bots
private logger: Logger; private logger: Logger;
private botConfig: IBotConfig; private botConfig: IBotConfig;
private tables: IDatabaseTables; private tables: IDatabaseTables;
private traders: Traders; private traders: Record<string, ITrader>;
private weightedRandomHelper: WeightedRandomHelper;
constructor(logger: Logger, databaseServer: DatabaseServer, botConfig: IBotConfig) constructor(logger: Logger, databaseServer: DatabaseServer, botConfig: IBotConfig, weightedRandomHelper: WeightedRandomHelper)
{ {
this.logger = logger; this.logger = logger;
this.botConfig = botConfig; this.botConfig = botConfig;
this.tables = databaseServer.getTables(); this.tables = databaseServer.getTables();
this.traders = databaseServer.getTables().traders; this.traders = databaseServer.getTables().traders;
this.weightedRandomHelper = weightedRandomHelper;
} }
public updateBots(): void public updateBots(): void
@ -28,11 +31,21 @@ export class Bots
const mod = this.modConfig.bots; const mod = this.modConfig.bots;
// Changes PMC difficulty to Easy, Normal, Hard, Impossible or AsOnline. Default AsOnline. if (mod.pmc.difficultyWeights.difficulty != "asonline")
if (mod.pmc.pmcDifficulty.toLowerCase() != "asonline")
{ {
this.botConfig.pmc.difficulty = mod.pmc.pmcDifficulty // Uses PMC difficulty weighting if Enabled.
this.logger.info(`PMC Bot Difficulty set to ${mod.pmc.pmcDifficulty}`); if (mod.pmc.difficultyWeights.useWeights)
{
const chosenDifficulty = this.chooseRandomWeightedDifficulty();
this.logger.info("PMC Difficulty Chance Weights Patched");
this.logger.info(`PMC Difficulty Chosen: ${chosenDifficulty}`);
}
// Uses PMC difficulty if weighting is Disabled.
else
{
this.botConfig.pmc.difficulty = mod.pmc.difficultyWeights.difficulty;
this.logger.info(`PMC Bot Difficulty set to ${mod.pmc.difficultyWeights.difficulty}`);
}
} }
// Enables common and secure containers to spawn on PMCs while additionally whitelisting the parent IDs. Rarity adjusted via PMC lootNValue. Default true. // Enables common and secure containers to spawn on PMCs while additionally whitelisting the parent IDs. Rarity adjusted via PMC lootNValue. Default true.
@ -45,8 +58,8 @@ export class Bots
// Chance that PMC bot will be USEC or BEAR. Higher value means higher chance for the PMC to be USEC. Default is 50% // Chance that PMC bot will be USEC or BEAR. Higher value means higher chance for the PMC to be USEC. Default is 50%
if (mod.pmc.isUsec != 50) if (mod.pmc.isUsec != 50)
{ {
this.botConfig.pmc.isUsec = mod.isUsec; this.botConfig.pmc.isUsec = mod.pmc.isUsec;
this.logger.info(`PMC isUsec Chance is: ${mod.isUsec}`); this.logger.info(`PMC isUsec Chance is: ${mod.pmc.isUsec}`);
} }
// Max Loot Value in Rubles for PMC bots in Backpack, Pockets, and Vest respectively. Default is 150,000/50,000/50,000 // Max Loot Value in Rubles for PMC bots in Backpack, Pockets, and Vest respectively. Default is 150,000/50,000/50,000
@ -111,6 +124,8 @@ export class Bots
this.logger.info("Chance to Convert Bots into PMC Patched"); this.logger.info("Chance to Convert Bots into PMC Patched");
}*/ }*/
// Make all bosses spawn chance configurable. // Make all bosses spawn chance configurable.
const locations = this.tables.locations; const locations = this.tables.locations;
@ -190,7 +205,8 @@ export class Bots
], ],
"BossEscortAmount": "2" "BossEscortAmount": "2"
} }
] ],
RandomTimeSpawn: false
} }
glugluWave.BossZone = locations.laboratory.base.OpenZones; glugluWave.BossZone = locations.laboratory.base.OpenZones;
@ -375,6 +391,14 @@ export class Bots
dynaLoot.push("5795f317245977243854e041"); dynaLoot.push("5795f317245977243854e041");
} }
private chooseRandomWeightedDifficulty(): string
{
const chosenDifficulty = this.weightedRandomHelper.getWeightedInventoryItem(this.modConfig.bots.pmc.difficultyWeights.weights);
this.botConfig.pmc.difficulty = chosenDifficulty;
return chosenDifficulty;
}
private containers(): any[] private containers(): any[]
{ {
/* Container "id"s /* Container "id"s

View File

@ -21,6 +21,12 @@ export class Items
this.items = this.tables.getTables().templates.items; this.items = this.tables.getTables().templates.items;
this.wtf = this.modConfig.items; this.wtf = this.modConfig.items;
if (this.wtf.removeKeyUsageMax)
{
this.removeKeyUsageMax();
this.logger.info("Key Usage Limit Removed");
}
// Weight Modifier. Multiplier of Weight *= modConfig.weightModifier // Weight Modifier. Multiplier of Weight *= modConfig.weightModifier
if (this.wtf.weightModifier != 1) if (this.wtf.weightModifier != 1)
{ {
@ -119,14 +125,11 @@ export class Items
// Updates backpacks and removes any values in the ExcludedFilter under props > Grids > props > filters > ExcludedFilter in database/templates/items.json // Updates backpacks and removes any values in the ExcludedFilter under props > Grids > props > filters > ExcludedFilter in database/templates/items.json
private updateBackpacks(): void private updateBackpacks(): void
{ {
const items = Object.values(this.tables.getTables().templates.items); const items = Object.values(this.tables.getTables().templates.items).filter(x=>x._parent === "5448e53e4bdc2d60728b4567");
for (const item of items) for (const item of items)
{ {
if (items._parent === "5448e53e4bdc2d60728b4567")
{
for (const grid of item._props.Grids) for (const grid of item._props.Grids)
grid._props.filters[0].ExcludedFilter = []; grid._props.filters[0].ExcludedFilter = [];
}
} }
} }
@ -139,4 +142,13 @@ export class Items
item._props.ExaminedByDefault = this.wtf.examinedByDefault; item._props.ExaminedByDefault = this.wtf.examinedByDefault;
} }
} }
private removeKeyUsageMax(): void
{
const keys = Object.values(this.tables.getTables().templates.items).filter(x=>x._parent === "543be5e94bdc2df1348b4568");
for (const key of keys)
{
key._props.MaximumNumberOfUsage = 0;
}
}
} }

View File

@ -3,6 +3,7 @@ import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
//import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig"; //import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
@ -36,6 +37,7 @@ class ValensAIO implements IPostDBLoadMod
private ragfairConfig: IRagfairConfig; private ragfairConfig: IRagfairConfig;
//private airdropConfig: IAirdropConfig; //private airdropConfig: IAirdropConfig;
private inRaidConfig: IInRaidConfig; private inRaidConfig: IInRaidConfig;
private weightedRandomHelper : WeightedRandomHelper;
public postDBLoad(container: DependencyContainer): void public postDBLoad(container: DependencyContainer): void
{ {
@ -44,6 +46,7 @@ class ValensAIO implements IPostDBLoadMod
const vLogger = new Logger(logger); const vLogger = new Logger(logger);
this.databaseServer = container.resolve<DatabaseServer>("DatabaseServer"); this.databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
this.configServer = container.resolve<ConfigServer>("ConfigServer"); this.configServer = container.resolve<ConfigServer>("ConfigServer");
this.weightedRandomHelper = container.resolve<WeightedRandomHelper>("WeightedRandomHelper");
this.locationConfig = this.configServer.getConfig<ILocationConfig>(ConfigTypes.LOCATION); this.locationConfig = this.configServer.getConfig<ILocationConfig>(ConfigTypes.LOCATION);
this.ragfairConfig = this.configServer.getConfig<IRagfairConfig>(ConfigTypes.RAGFAIR); this.ragfairConfig = this.configServer.getConfig<IRagfairConfig>(ConfigTypes.RAGFAIR);
this.botConfig = this.configServer.getConfig<IBotConfig>(ConfigTypes.BOT); this.botConfig = this.configServer.getConfig<IBotConfig>(ConfigTypes.BOT);
@ -57,7 +60,7 @@ class ValensAIO implements IPostDBLoadMod
const ammo = new Ammo(vLogger, this.databaseServer); const ammo = new Ammo(vLogger, this.databaseServer);
ammo.updateAmmo(); ammo.updateAmmo();
const bots = new Bots(vLogger, this.databaseServer, this.botConfig); const bots = new Bots(vLogger, this.databaseServer, this.botConfig, this.weightedRandomHelper);
bots.updateBots(); bots.updateBots();
const flea = new Flea(vLogger, this.ragfairConfig, this.tables); const flea = new Flea(vLogger, this.ragfairConfig, this.tables);