diff --git a/Valens-AIO/V-AIO Progression ReadMe.pdf b/Valens-AIO/V-AIO Progression ReadMe.pdf new file mode 100644 index 0000000..39d58f0 Binary files /dev/null and b/Valens-AIO/V-AIO Progression ReadMe.pdf differ diff --git a/Valens-AIO/Valens-AIO ReadMe.pdf b/Valens-AIO/Valens-AIO ReadMe.pdf index a1b7f7c..dd98eb3 100644 Binary files a/Valens-AIO/Valens-AIO ReadMe.pdf and b/Valens-AIO/Valens-AIO ReadMe.pdf differ diff --git a/Valens-AIO/config/config.json b/Valens-AIO/config/config.json index 7958ffd..ccc7306 100644 --- a/Valens-AIO/config/config.json +++ b/Valens-AIO/config/config.json @@ -1,5 +1,5 @@ { - "DebugMode": true, + "DebugMode": false, "ammo": { @@ -25,7 +25,7 @@ "pmc": { - "chanceSameSideIsHostilePercent": 50, + "chanceSameSideIsHostile": 50, "containersOnPMCs": true, "isUsec": 50, "lootNValue": 3, @@ -33,6 +33,30 @@ "maxPocketLootTotalRub": 50000, "maxVestLootTotalRub": 50000, + "convertIntoPmcChance": + { + "assault": + { + "min": 15, + "max": 40 + }, + "cursedAssault": + { + "min": 15, + "max": 40 + }, + "pmcBot": + { + "min": 15, + "max": 30 + }, + "exUsec": + { + "min": 5, + "max": 20 + } + }, + "difficultyWeights": { "difficulty": "asonline", @@ -46,36 +70,14 @@ } }, - "convertIntoPmcChance": + "looseWeaponInBackpackChance": 15, + "looseWeaponInBackpackLoot": { - "assault": 25, - "cursedAssault": 25, - "pmcBot": 25, - "exUsec": 10, - - "assault for 3.2.0": - { - "min": 15, - "max": 40 - }, - "cursedassault for 3.2.0": - { - "min": 15, - "max": 40 - }, - "pmcbot for 3.2.0": - { - "min": 15, - "max": 30 - }, - "exusec for 3.2.0": - { - "min": 5, - "max": 20 - } + "min": 1, + "max": 1 } }, - + "scav": { "lootNValue": 4 @@ -97,8 +99,8 @@ "DOCUMENTS_CASE": { - "width": 1, - "height": 2, + "width": 2, + "height": 1, "cellsH": 4, "cellsV": 4 }, @@ -195,8 +197,8 @@ { "width": 2, "height": 2, - "cellsH": 3, - "cellsV": 4 + "cellsH": 4, + "cellsV": 3 }, "SICC_ORGANIZATIONAL_POUCH": @@ -217,8 +219,8 @@ "THICC_ITEM_CASE": { - "width": 3, - "height": 5, + "width": 5, + "height": 3, "cellsH": 14, "cellsV": 14 }, @@ -286,7 +288,7 @@ "KAPPA": { "width": 3, - "height": 4, + "height": 3, "cellsH": 3, "cellsV": 4 } @@ -424,10 +426,10 @@ "locations": { - "allExtractsAvailable": true, + "allExtractsAvailable": false, "exfilTime": 8, - "extractionsExtended": true, - "noExtractRestrictions": true + "extractionsExtended": false, + "noExtractRestrictions": false }, "loot": @@ -437,6 +439,11 @@ "staticLootMultiplier": 1 }, + "progression": + { + "enabled": true + }, + "quests": { "onlyFoundInRaid": true @@ -461,7 +468,7 @@ { "allBossesOnReserve": false, "allTradersSellCheapItems": false, - "glukharOnLabs": false, + "gluharOnLabs": false, "killaOnFactory": false, "makeObdolbosPowerful": false }, @@ -474,4 +481,4 @@ "overheat": false, "slide": false } -} +} \ No newline at end of file diff --git a/Valens-AIO/config/config.ts b/Valens-AIO/config/config.ts index 884d3e0..d5142a9 100644 --- a/Valens-AIO/config/config.ts +++ b/Valens-AIO/config/config.ts @@ -11,6 +11,7 @@ export interface Config items: Items locations: Locations loot: Loot + progression: Progression raid: Raid quests: Quests prewipeEvents: PrewipeEvents @@ -47,7 +48,7 @@ export interface BossChance export interface Pmc { - chanceSameSideIsHostilePercent: number + chanceSameSideIsHostile: number containersOnPMCs: boolean isUsec: number lootNValue: number @@ -56,6 +57,8 @@ export interface Pmc maxVestLootTotalRub: number difficultyWeights: DifficultyWeights convertIntoPmcChance: ConvertIntoPmcChance + looseWeaponInBackpackChance: number + looseWeaponInBackpackLoot: LooseWeapon } export interface DifficultyWeights @@ -75,35 +78,19 @@ export interface Weights export interface ConvertIntoPmcChance { - assault: number - cursedAssault: number - pmcBot: number - exUsec: number - "assault for 3.2.0": AssaultFor320 - "cursedassault for 3.2.0": CursedassaultFor320 - "pmcbot for 3.2.0": PmcbotFor320 - "exusec for 3.2.0": ExusecFor320 + assault: PmcChance + cursedAssault: PmcChance + pmcBot : PmcChance + exUsec : PmcChance } -export interface AssaultFor320 +export interface PmcChance { min: number max: number } - -export interface CursedassaultFor320 -{ - min: number - max: number -} - -export interface PmcbotFor320 -{ - min: number - max: number -} - -export interface ExusecFor320 + +export interface LooseWeapon { min: number max: number @@ -302,6 +289,11 @@ export interface Loot staticLootMultiplier: number } +export interface Progression +{ + enabled: boolean +} + export interface Quests { onlyFoundInRaid: boolean @@ -326,7 +318,7 @@ export interface PrewipeEvents { allBossesOnReserve: boolean allTradersSellCheapItems: boolean - glukharOnLabs: boolean + gluharOnLabs: boolean killaOnFactory: boolean makeObdolbosPowerful: boolean } diff --git a/Valens-AIO/package.json b/Valens-AIO/package.json index d0a066d..e0be496 100644 --- a/Valens-AIO/package.json +++ b/Valens-AIO/package.json @@ -1,10 +1,10 @@ { "name": "Valens-AIO", - "version": "1.2.3", + "version": "1.3.0", "main": "src/mod.js", "license": "CC BY-NC-ND 4.0", "author": "Valens", - "akiVersion": "3.1.*", + "akiVersion": "3.2.*", "scripts": { "setup:environment": "npm i", "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" \"./**/*.*\" ./dist", diff --git a/Valens-AIO/src/airdrop.ts b/Valens-AIO/src/airdrop.ts index 33753bd..76adfab 100644 --- a/Valens-AIO/src/airdrop.ts +++ b/Valens-AIO/src/airdrop.ts @@ -1,5 +1,4 @@ -/*import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; -import { Config } from "../config/config"; +/*import { Config } from "../config/config"; import { Logger } from "./logger"; import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; @@ -8,7 +7,7 @@ export class Airdrop { private modConfig: Config = require("../config/config.jsonc"); private logger: Logger; - private tables: IDatabaseTables; + private databaseServer: IDatabaseTables; private airdropConfig: IAirdropConfig; constructor(logger: Logger, databaseServer: DatabaseServer, airdropConfig: IAirdropConfig) diff --git a/Valens-AIO/src/ammo.ts b/Valens-AIO/src/ammo.ts index cacafad..d8901df 100644 --- a/Valens-AIO/src/ammo.ts +++ b/Valens-AIO/src/ammo.ts @@ -7,17 +7,17 @@ export class Ammo { private modConfig: Config = require("../config/config.json") private logger: Logger; - private databaseServer: DatabaseServer; + private tables: DatabaseServer; constructor(logger: Logger, databaseServer: DatabaseServer) { this.logger = logger; - this.databaseServer = databaseServer; + this.tables = databaseServer.getTables(); } public updateAmmo(): void { - const items = this.databaseServer.getTables().templates.items; + const items = this.tables.templates.items; const mod = this.modConfig.ammo; if (mod.ammoStacks.grenadeCartridges != 1) diff --git a/Valens-AIO/src/bots.ts b/Valens-AIO/src/bots.ts index 0901f47..c98e589 100644 --- a/Valens-AIO/src/bots.ts +++ b/Valens-AIO/src/bots.ts @@ -1,5 +1,4 @@ import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { Logger } from "./logger"; import type { BossLocationSpawn } from "@spt-aki/models/eft/common/ILocationBase"; @@ -13,7 +12,7 @@ export class Bots private modConfig: Config = require("../config/config.json"); private logger: Logger; private botConfig: IBotConfig; - private tables: IDatabaseTables; + private tables: DatabaseServer; private traders: Record; private weightedRandomHelper: WeightedRandomHelper; @@ -22,361 +21,166 @@ export class Bots this.logger = logger; this.botConfig = botConfig; this.tables = databaseServer.getTables(); - this.traders = databaseServer.getTables().traders; + this.traders = this.tables.traders; this.weightedRandomHelper = weightedRandomHelper; } public updateBots(): void { - + // modConfig variables const mod = this.modConfig.bots; + const modPMC = this.modConfig.bots.pmc; + const modScav = this.modConfig.bots.scav; + const preWipe = this.modConfig.prewipeEvents; + + // Server side variables + const pmc = this.botConfig.pmc; + const lootNValue = this.botConfig.lootNValue; + + // Start modifications - if (mod.pmc.difficultyWeights.difficulty != "asonline") + + // Checks if straight up difficulty selection is used or not to determine if it should use that or if it should then go to use weighted difficulties. + if (modPMC.difficultyWeights.difficulty != "asonline") { - // Uses PMC difficulty weighting if Enabled. - if (mod.pmc.difficultyWeights.useWeights) + // Uses PMC difficulty weighting if straight up difficulty selection is not used. + if (modPMC.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. + // 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}`); + pmc.difficulty = modPMC.difficultyWeights.difficulty; + this.logger.info(`PMC Bot Difficulty set to ${modPMC.difficultyWeights.difficulty}`); } } - // Enables common and secure containers to spawn on PMCs while additionally whitelisting the parent IDs. Rarity adjusted via PMC lootNValue. Default true. - if (mod.pmc.containersOnPMCs) + + // Enables common and secure containers to spawn on PMCs by whitelisting the parent IDs. Rarity adjusted via PMC lootNValue. Default true. + if (modPMC.containersOnPMCs) { this.containersOnPMCs(); - this.logger.info(`Containers On PMCs: ${mod.pmc.containersOnPMCs}`); + this.logger.info(`Containers On PMCs: ${modPMC.containersOnPMCs}`); } - // 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) + + // Chance that PMC bot will be USEC or BEAR. Default is 50% + if (modPMC.isUsec != 50) { - this.botConfig.pmc.isUsec = mod.pmc.isUsec; - this.logger.info(`PMC isUsec Chance is: ${mod.pmc.isUsec}`); + pmc.isUsec = modPMC.isUsec; + this.logger.info(`PMC isUsec Chance is: ${modPMC.isUsec}`); } + // Max Loot Value in Rubles for PMC bots in Backpack, Pockets, and Vest respectively. Default is 150,000/50,000/50,000 - if (mod.pmc.maxBackpackLootTotalRub != 150000 - || mod.pmc.maxPocketLootTotalRub !=50000 - || mod.pmc.maxVestLootTotalRub != 50000) + if (modPMC.maxBackpackLootTotalRub != 150000 + || modPMC.maxPocketLootTotalRub !=50000 + || modPMC.maxVestLootTotalRub != 50000) { - this.botConfig.pmc.maxBackpackLootTotalRub = mod.pmc.maxBackpackLootTotalRub; - this.botConfig.pmc.maxPocketLootTotalRub = mod.pmc.maxPocketLootTotalRub; - this.botConfig.pmc.maxVestLootTotalRub = mod.pmc.maxVestLootTotalRub; - this.logger.info("PMC Loot Value totals changed!"); - this.logger.info(`Max Backpack Total Value: ${mod.pmc.maxBackpackLootTotalRub}`); - this.logger.info(`Max Pocket Total Value: ${mod.pmc.maxPocketLootTotalRub}`); - this.logger.info(`Max Vest Total Value: ${mod.pmc.maxVestLootTotalRub}`); + this.changeMaxLootvalue(); + this.logger.info(`PMC Loot Value totals changed! \n Max Backpack Total Value: ${modPMC.maxBackpackLootTotalRub} \n Max Pocket Total Value: ${modPMC.maxPocketLootTotalRub} \n Max Vest Total Value: ${modPMC.maxVestLootTotalRub}`); } - // Chance that the PMC bot of your side (BEAR/USEC) will be hostile or not. Default is 50%. - if (mod.pmc.chanceSameSideIsHostilePercent != 50) + + // Chance that the PMC bot of your faction (BEAR/USEC) will be hostile or not. Default is 50%. + if (modPMC.chanceSameSideIsHostile != 50) { - this.botConfig.pmc.chanceSameSideIsHostilePercent = mod.pmc.chanceSameSideIsHostilePercent; - this.logger.info(`Chance Same Side Is Hostle is ${mod.pmc.chanceSameSideIsHostilePercent}`); + pmc.chanceSameSideIsHostilePercent = modPMC.chanceSameSideIsHostile; + this.logger.info(`Chance Same Side Is Hostle is ${modPMC.chanceSameSideIsHostile}`); } - // Max Bot Cap located in configs/bot.json/maxBotCap + + // Adjusts the Max Bot Cap located in configs/bot.json/maxBotCap if (mod.maxBotCap != 20) { this.botConfig.maxBotCap = mod.maxBotCap; this.logger.info(`Bot Cap is now ${mod.maxBotCap}`); } - if (mod.pmc.lootNValue != 3 || mod.scav.lootNValue != 4) + + // Modifies the lootNValue of PMC or Scav if configured outside of the defaults. + if (modPMC.lootNValue != 3 || modScav.lootNValue != 4) { - this.botConfig.lootNValue.scav = mod.scav.lootNValue; - this.botConfig.lootNValue.pmc = mod.pmc.lootNValue; - this.logger.info("Loot NValue for bots has been changed!"); - this.logger.info(`Scav lootNValue set to ${mod.scav.lootNValue}`); - this.logger.info(`PMC lootNValue set to ${mod.pmc.lootNValue}`); + lootNValue.scav = modScav.lootNValue; + lootNValue.pmc = modPMC.lootNValue; + this.logger.info(`lootNValue for bots has been changed! \n Scav lootNValue set to ${modScav.lootNValue} \n PMC lootNValue set to ${modPMC.lootNValue}`); } - if (mod.pmc.convertIntoPmcChance.assault != 25 || mod.pmc.convertIntoPmcChance.cursedAssault != 25 - || mod.pmc.convertIntoPmcChance.pmcBot != 25 || mod.pmc.convertIntoPmcChance.exUsec != 10) - { - this.botConfig.pmc.types.assault = mod.pmc.convertIntoPmcChance.assault; - this.botConfig.pmc.types.cursedAssault = mod.pmc.convertIntoPmcChance.cursedAssault; - this.botConfig.pmc.types.pmcBot = mod.pmc.convertIntoPmcChance.pmcBot; - this.botConfig.pmc.types.exUsec = mod.pmc.convertIntoPmcChance.exUsec; - } - /*if (mod.pmc.convertIntoPmcChance["assault for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["assault for 3.2.0"].max != 40 - || mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].max != 40 - || mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].max != 30 - || mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].max != 20) + // Adjusts the chance for PMC to spawn instead of the default bot type if configured outside of the default values. + const pmcChance = modPMC.convertIntoPmcChance; + if (pmcChance.assault.min != 15 || pmcChance.assault.max != 40 + || pmcChance.cursedAssault.min != 15 || pmcChance.cursedAssault.max != 40 + || pmcChance.pmcBot.min != 15 || pmcChance.pmcBot.max != 30 + || pmcChance.exUsec.min != 5 || pmcChance.exUsec.max != 20) { - this.botConfig.pmc.convertIntoPmcChance.assault.min = mod.pmc.convertIntoPmcChance["assault for 3.2.0"].min; - this.botConfig.pmc.convertIntoPmcChance.assault.max = mod.pmc.convertIntoPmcChance["assault for 3.2.0"].max; - this.botConfig.pmc.convertIntoPmcChance.cursedassault.min = mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].min; - this.botConfig.pmc.convertIntoPmcChance.cursedassault.max = mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].max; - this.botConfig.pmc.convertIntoPmcChance.pmcbot.min = mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].min; - this.botConfig.pmc.convertIntoPmcChance.pmcbot.max = mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].max; - this.botConfig.pmc.convertIntoPmcChance.exusec.min = mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].min; - this.botConfig.pmc.convertIntoPmcChance.exusec.max = mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].max; + this.adjustPmcChance(); this.logger.info("Chance to Convert Bots into PMC Patched"); - }*/ + } - - // Make all bosses spawn chance configurable. - const locations = this.tables.locations; - + // Makes *all* bosses spawn chance configurable. if (mod.bossChance.activated) { - for (const i in locations) - { - if (i !== "base") - { - if (locations[i].base.BossLocationSpawn !== []) - { - for (const x in locations[i].base.BossLocationSpawn) - { - locations[i].base.BossLocationSpawn[x].BossChance = mod.bossChance.chance; - this.logger.info(`Boss Chance set to ${mod.bossChance.chance}`) - } - } - } - } + this.configureBossChance(); + this.logger.info(`Boss Chance set to ${mod.bossChance.chance}`) } + // Prewipe Events - if (this.modConfig.prewipeEvents.killaOnFactory) + + + // Spawn Killa On Factory + if (preWipe.killaOnFactory) { - const killaWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.factory4_day.base.OpenZones); - this.tables.locations.factory4_day.base.BossLocationSpawn.push(killaWave); - locations.factory4_night.base.BossLocationSpawn.push(killaWave); - this.logger.info("Killa Prewipe Event Enabled"); + this.spawnKillaOnFactory(); + this.logger.info("Killa On Factry Enabled"); } - if (this.modConfig.prewipeEvents.allBossesOnReserve) + + // Spawns All Bosses On Reserve + if (preWipe.allBossesOnReserve) { - let bossWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.rezervbase.base.OpenZones); - locations.rezervbase.base.BossLocationSpawn.push(bossWave); - bossWave = this.createBossWave("bossBully", 100, "followerBully", 4, locations.rezervbase.base.OpenZones); - locations.rezervbase.base.BossLocationSpawn.push(bossWave); - bossWave = this.createBossWave("bossKojaniy", 100, "followerKojaniy", 2, locations.rezervbase.base.OpenZones); - locations.rezervbase.base.BossLocationSpawn.push(bossWave); - bossWave = this.createBossWave("bossSanitar", 100, "followerSanitar", 2, locations.rezervbase.base.OpenZones); - locations.rezervbase.base.BossLocationSpawn.push(bossWave); + this.spawnAllBossesOnReserve(); this.logger.info("Bosses On Reserve Prewipe Event Enabled"); } - - if (this.modConfig.prewipeEvents.glukharOnLabs) - { - const glugluWave: BossLocationSpawn = { - "BossName": "bossGluhar", - "BossChance": 43, - "BossZone": "ZoneRailStrorage,ZoneRailStrorage,ZoneRailStrorage,ZonePTOR1,ZonePTOR2,ZoneBarrack,ZoneBarrack,ZoneBarrack,ZoneSubStorage", - "BossPlayer": false, - "BossDifficult": "normal", - "BossEscortType": "followerGluharAssault", - "BossEscortDifficult": "normal", - "BossEscortAmount": "0", - "Time": -1, - "TriggerId": "", - "TriggerName": "", - "Supports": [ - { - "BossEscortType": "followerGluharAssault", - "BossEscortDifficult": [ - "normal" - ], - "BossEscortAmount": "2" - }, - { - "BossEscortType": "followerGluharSecurity", - "BossEscortDifficult": [ - "normal" - ], - "BossEscortAmount": "2" - }, - { - "BossEscortType": "followerGluharScout", - "BossEscortDifficult": [ - "normal" - ], - "BossEscortAmount": "2" - } - ], - RandomTimeSpawn: false - } - glugluWave.BossZone = locations.laboratory.base.OpenZones; - locations.laboratory.base.BossLocationSpawn.push(glugluWave); - this.logger.info("Glukhar On Labs Prewipe Event Enabled"); + + // Spawns Gluhar On Labs + if (preWipe.gluharOnLabs) + { + this.spawnGluharOnLabs(); + this.logger.info("Gluhar On Labs Prewipe Event Enabled"); } + // All cheap items on traders - if (this.modConfig.prewipeEvents.allTradersSellCheapItems) + if (preWipe.allTradersSellCheapItems) { + this.allTradersSellCheapItems(); this.logger.info("Cheap Items On Traders Prewipe Event Enabled"); - for (const trader in this.traders) - { - for (const assort in this.traders[trader].assort.barter_scheme) - { - const itemScheme = this.traders[trader].assort.barter_scheme[assort]; - switch (itemScheme[0][0]._tpl) - { - case Money.ROUBLES: - itemScheme[0][0].count = itemScheme[0][0].count * 0.01; - break; - case Money.DOLLARS: - itemScheme[0][0].count = itemScheme[0][0].count * 0.1; - break; - case Money.EUROS: - itemScheme[0][0].count = itemScheme[0][0].count * 0.05; - break; - default: - break; - - } - } - } } - if (this.modConfig.prewipeEvents.makeObdolbosPowerful) + // Makes Obdolbos Super Powered + if (preWipe.makeObdolbosPowerful) { - const obdolbosBuff = [ - { - "BuffType": "StaminaRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": 0.5, - "AbsoluteValue": true, - "SkillName": "" - }, - { - "BuffType": "SkillRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": 10, - "AbsoluteValue": true, - "SkillName": "Endurance" - }, - { - "BuffType": "SkillRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": 10, - "AbsoluteValue": true, - "SkillName": "Strength" - }, - { - "BuffType": "SkillRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": 20, - "AbsoluteValue": true, - "SkillName": "StressResistance" - }, - { - "BuffType": "SkillRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": 20, - "AbsoluteValue": true, - "SkillName": "Charisma" - }, - { - "BuffType": "SkillRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": -20, - "AbsoluteValue": true, - "SkillName": "Memory" - }, - { - "BuffType": "SkillRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": -20, - "AbsoluteValue": true, - "SkillName": "Intellect" - }, - { - "BuffType": "SkillRate", - "Chance": 1, - "Delay": 1, - "Duration": 1800, - "Value": -20, - "AbsoluteValue": true, - "SkillName": "Attention" - }, - { - "BuffType": "Pain", - "Chance": 0.25, - "Delay": 1, - "Duration": 1800, - "Value": 0, - "AbsoluteValue": false, - "SkillName": "" - }, - { - "BuffType": "StomachBloodloss", - "Chance": 0.25, - "Delay": 1, - "Duration": 1800, - "Value": 0, - "AbsoluteValue": false, - "SkillName": "" - }, - { - "BuffType": "HydrationRate", - "Chance": 0.25, - "Delay": 1, - "Duration": 1800, - "Value": -0.05, - "AbsoluteValue": true, - "SkillName": "" - }, - { - "BuffType": "EnergyRate", - "Chance": 0.25, - "Delay": 1, - "Duration": 1800, - "Value": -0.05, - "AbsoluteValue": true, - "SkillName": "" - }, - { - "BuffType": "DamageModifier", - "Chance": 0.25, - "Delay": 1, - "Duration": 1800, - "Value": 0.2, - "AbsoluteValue": false, - "SkillName": "" - }, - { - "BuffType": "QuantumTunnelling", - "Chance": 0.25, - "Delay": 1, - "Duration": 1800, - "Value": 0, - "AbsoluteValue": false, - "SkillName": "" - }] - - this.tables.globals.config.Health.Effects.Stimulator.Buffs.Buffs_Obdolbos = obdolbosBuff; + this.makeObdolbosPowerful(); this.logger.info("Make Obdolbos Powerful Prewipe Event Enabled"); } + + if (modPMC.looseWeaponInBackpackChance != 15 || modPMC.looseWeaponInBackpackLoot.max != 1 || modPMC.looseWeaponInBackpackLoot.min != 1) + { + this.changeLooseWeapon(); + this.logger.info("Loose Weapon In PMC Backpack Values Patched"); + } } - // 5c0a840b86f7742ffa4f2482 thicc items case + + // Functions start here. + + // Function to enable secured and common containers on PMCs. private containersOnPMCs(): void { const dynaLoot = this.botConfig.pmc.dynamicLoot.whitelist; @@ -393,43 +197,8 @@ export class Bots return chosenDifficulty; } - private containers(): any[] - { - /* Container "id"s - * - * S I C C pouch: 5d235bb686f77443f4331278 - * Magazine Case: 5c127c4486f7745625356c13 - * Weapon Case: 59fb023c86f7746d0d4b423c - * T H I C C Weapon Case: 5b6d9ce188a4501afc1b2b25 - * Item Case: 59fb042886f7746c5005a7b2 - * T H I C C Item Case: 5c0a840b86f7742ffa4f2482 - * Money case: 59fb016586f7746d0d4b423a - * Mr Holodilnick Thermal Bag: 5c093db286f7740a1b2617e3 - * Medicine case: 5aafbcd986f7745e590fff23 - * Lucky scav junkbox: 5b7c710788a4506dec015957 - * Grenade case: 5e2af55f86f7746d4159f07c - * Ammunition case: 5aafbde786f774389d0cbc0f - * Documents case: 590c60fc86f77412b13fddcf - * Key tool: 59fafd4b86f7745ca07e123 - * Injector case: 619cbf7d23893217ec30b689 - * Dogtag case: 5c093e3486f77430cb02e593 - * Keycard holder: 619cbf9e0a7c3a1a2731940a - * WZ Wallet: 60b0f6c058e0b0481a09ad11 - * Pistol case: 567143bf4bdc2d1a0f8b4567 - * Secure container: 5448bf274bdc2dfc2f8b456a - * Kappa container: 5c093ca986f7740a1867ab12 - * Gamma container: 60b0f6c058e0b0481a09ad11 - */ - - const lootItems = ["5d235bb686f77443f4331278","5c127c4486f7745625356c13","59fb023c86f7746d0d4b423c","5b6d9ce188a4501afc1b2b25","59fb042886f7746c5005a7b2","5c0a840b86f7742ffa4f2482", - "59fb016586f7746d0d4b423a","5c093db286f7740a1b2617e3","5aafbcd986f7745e590fff23","5b7c710788a4506dec015957","5e2af55f86f7746d4159f07c","5448bf274bdc2dfc2f8b456a","5c093ca986f7740a1867ab12", - "5aafbde786f774389d0cbc0f","590c60fc86f77412b13fddcf","59fafd4b86f7745ca07e1232","619cbf7d23893217ec30b689","619cbf9e0a7c3a1a2731940a","5c093e3486f77430cb02e593","60b0f6c058e0b0481a09ad11", - "567143bf4bdc2d1a0f8b4567","60b0f6c058e0b0481a09ad11","59db794186f77448bc595262","5857a8b324597729ab0a0e7d"] - - return lootItems; - } - private createBossWave(role: string, chance: number, followers: string, escortAmount: number, zones: string): any + public createBossWave(role: string, chance: number, followers: string, escortAmount: number, zones: string): any { return { "BossName": role, @@ -443,4 +212,296 @@ export class Bots "Time": -1 } } + + + private adjustPmcChance(): void + { + const pmcConfig = this.botConfig.pmc.convertIntoPmcChance; + const modConfig = this.modConfig.bots.pmc.convertIntoPmcChance; + + pmcConfig.assault.min = modConfig.assault.min; + pmcConfig.assault.max = modConfig.assault.max; + pmcConfig.cursedassault.min = modConfig.cursedAssault.min; + pmcConfig.cursedassault.max = modConfig.cursedAssault.max; + pmcConfig.pmcbot.min = modConfig.pmcBot.min; + pmcConfig.pmcbot.max = modConfig.pmcBot.max; + pmcConfig.exusec.min = modConfig.exUsec.min; + pmcConfig.exusec.max = modConfig.exUsec.max; + } + + + private changeMaxLootvalue(): void + { + const lootConfig = this.botConfig.pmc; + const modConfig = this.modConfig.bots.pmc; + + lootConfig.maxBackpackLootTotalRub = modConfig.maxBackpackLootTotalRub; + lootConfig.maxPocketLootTotalRub = modConfig.maxPocketLootTotalRub; + lootConfig.maxVestLootTotalRub = modConfig.maxVestLootTotalRub; + } + + + private configureBossChance(): void + { + const locations = this.tables.locations; + + for (const i in locations) + { + if (i !== "base") + { + if (locations[i].base.BossLocationSpawn !== []) + { + for (const x in locations[i].base.BossLocationSpawn) + { + locations[i].base.BossLocationSpawn[x].BossChance = this.modConfig.bots.bossChance.chance; + } + } + } + } + } + + + private spawnKillaOnFactory(): void + { + const locations = this.tables.locations; + const killaWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.factory4_day.base.OpenZones); + this.tables.locations.factory4_day.base.BossLocationSpawn.push(killaWave); + locations.factory4_night.base.BossLocationSpawn.push(killaWave); + } + + + private spawnAllBossesOnReserve(): void + { + const locations = this.tables.locations; + let bossWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.rezervbase.base.OpenZones); + locations.rezervbase.base.BossLocationSpawn.push(bossWave); + bossWave = this.createBossWave("bossBully", 100, "followerBully", 4, locations.rezervbase.base.OpenZones); + locations.rezervbase.base.BossLocationSpawn.push(bossWave); + bossWave = this.createBossWave("bossKojaniy", 100, "followerKojaniy", 2, locations.rezervbase.base.OpenZones); + locations.rezervbase.base.BossLocationSpawn.push(bossWave); + bossWave = this.createBossWave("bossSanitar", 100, "followerSanitar", 2, locations.rezervbase.base.OpenZones); + locations.rezervbase.base.BossLocationSpawn.push(bossWave); + } + + + private spawnGluharOnLabs(): void + { + const locations = this.tables.locations; + const glugluWave: BossLocationSpawn = + { + "BossName": "bossGluhar", + "BossChance": 43, + "BossZone": "ZoneRailStrorage,ZoneRailStrorage,ZoneRailStrorage,ZonePTOR1,ZonePTOR2,ZoneBarrack,ZoneBarrack,ZoneBarrack,ZoneSubStorage", + "BossPlayer": false, + "BossDifficult": "normal", + "BossEscortType": "followerGluharAssault", + "BossEscortDifficult": "normal", + "BossEscortAmount": "0", + "Time": -1, + "TriggerId": "", + "TriggerName": "", + "Supports": [ + { + "BossEscortType": "followerGluharAssault", + "BossEscortDifficult": [ + "normal" + ], + "BossEscortAmount": "2" + }, + { + "BossEscortType": "followerGluharSecurity", + "BossEscortDifficult": [ + "normal" + ], + "BossEscortAmount": "2" + }, + { + "BossEscortType": "followerGluharScout", + "BossEscortDifficult": [ + "normal" + ], + "BossEscortAmount": "2" + } + ], + RandomTimeSpawn: false + } + + glugluWave.BossZone = locations.laboratory.base.OpenZones; + locations.laboratory.base.BossLocationSpawn.push(glugluWave); + } + + + private allTradersSellCheapItems(): void + { + + for (const trader in this.traders) + { + for (const assort in this.traders[trader].assort.barter_scheme) + { + const itemScheme = this.traders[trader].assort.barter_scheme[assort]; + switch (itemScheme[0][0]._tpl) + { + case Money.ROUBLES: + itemScheme[0][0].count = itemScheme[0][0].count * 0.01; + break; + case Money.DOLLARS: + itemScheme[0][0].count = itemScheme[0][0].count * 0.1; + break; + case Money.EUROS: + itemScheme[0][0].count = itemScheme[0][0].count * 0.05; + break; + default: + break; + + } + } + } + } + + + private makeObdolbosPowerful(): void + { + + const obdolbosBuff = [ + { + "BuffType": "StaminaRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": 0.5, + "AbsoluteValue": true, + "SkillName": "" + }, + { + "BuffType": "SkillRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": 10, + "AbsoluteValue": true, + "SkillName": "Endurance" + }, + { + "BuffType": "SkillRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": 10, + "AbsoluteValue": true, + "SkillName": "Strength" + }, + { + "BuffType": "SkillRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": 20, + "AbsoluteValue": true, + "SkillName": "StressResistance" + }, + { + "BuffType": "SkillRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": 20, + "AbsoluteValue": true, + "SkillName": "Charisma" + }, + { + "BuffType": "SkillRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": -20, + "AbsoluteValue": true, + "SkillName": "Memory" + }, + { + "BuffType": "SkillRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": -20, + "AbsoluteValue": true, + "SkillName": "Intellect" + }, + { + "BuffType": "SkillRate", + "Chance": 1, + "Delay": 1, + "Duration": 1800, + "Value": -20, + "AbsoluteValue": true, + "SkillName": "Attention" + }, + { + "BuffType": "Pain", + "Chance": 0.25, + "Delay": 1, + "Duration": 1800, + "Value": 0, + "AbsoluteValue": false, + "SkillName": "" + }, + { + "BuffType": "StomachBloodloss", + "Chance": 0.25, + "Delay": 1, + "Duration": 1800, + "Value": 0, + "AbsoluteValue": false, + "SkillName": "" + }, + { + "BuffType": "HydrationRate", + "Chance": 0.25, + "Delay": 1, + "Duration": 1800, + "Value": -0.05, + "AbsoluteValue": true, + "SkillName": "" + }, + { + "BuffType": "EnergyRate", + "Chance": 0.25, + "Delay": 1, + "Duration": 1800, + "Value": -0.05, + "AbsoluteValue": true, + "SkillName": "" + }, + { + "BuffType": "DamageModifier", + "Chance": 0.25, + "Delay": 1, + "Duration": 1800, + "Value": 0.2, + "AbsoluteValue": false, + "SkillName": "" + }, + { + "BuffType": "QuantumTunnelling", + "Chance": 0.25, + "Delay": 1, + "Duration": 1800, + "Value": 0, + "AbsoluteValue": false, + "SkillName": "" + }] + + this.tables.globals.config.Health.Effects.Stimulator.Buffs.Buffs_Obdolbos = obdolbosBuff; + } + + + private changeLooseWeapon():void + { + const pmcConfig = this.botConfig.pmc; + const modConfig = this.modConfig.bots.pmc; + + pmcConfig.looseWeaponInBackpackChancePercent = modConfig.looseWeaponInBackpackChance; + pmcConfig.looseWeaponInBackpackLootMinMax.min = modConfig.looseWeaponInBackpackLoot.min; + pmcConfig.looseWeaponInBackpackLootMinMax.max = modConfig.looseWeaponInBackpackLoot.max; + } + } diff --git a/Valens-AIO/src/containers.ts b/Valens-AIO/src/containers.ts index ff185b2..ce8664b 100644 --- a/Valens-AIO/src/containers.ts +++ b/Valens-AIO/src/containers.ts @@ -1,5 +1,3 @@ - -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { Logger } from "./logger"; import { Config } from "../config/config"; @@ -9,7 +7,7 @@ export class Containers { private modConfig: Config = require("../config/config.json"); private logger: Logger; - private tables: IDatabaseTables; + private tables: DatabaseServer; constructor(logger: Logger, databaseServer: DatabaseServer) { diff --git a/Valens-AIO/src/flea.ts b/Valens-AIO/src/flea.ts index 0311589..0cc7e24 100644 --- a/Valens-AIO/src/flea.ts +++ b/Valens-AIO/src/flea.ts @@ -1,4 +1,4 @@ -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { Logger } from "./logger"; import { Config } from "../config/config"; @@ -8,14 +8,14 @@ export class Flea private modConfig: Config = require("../config/config.json"); private logger: Logger; private ragfairConfig: IRagfairConfig; - private tables: IDatabaseTables; + private tables: DatabaseServer; - constructor (logger: Logger, ragfairConfig: IRagfairConfig, tables: IDatabaseTables) + constructor (logger: Logger, ragfairConfig: IRagfairConfig, databaseServer: DatabaseServer) { this.logger = logger; this.ragfairConfig = ragfairConfig; - this.tables = tables; + this.tables = databaseServer.getTables(); } diff --git a/Valens-AIO/src/globals.ts b/Valens-AIO/src/globals.ts index 63d1d4d..6ac9a39 100644 --- a/Valens-AIO/src/globals.ts +++ b/Valens-AIO/src/globals.ts @@ -6,18 +6,18 @@ export class Globals { private modConfig: Config = require("../config/config.json"); private logger: Logger; - private databaseServer: DatabaseServer; + private tables: DatabaseServer; constructor(logger: Logger, databaseServer: DatabaseServer) { this.logger = logger; - this.databaseServer = databaseServer; + this.tables = databaseServer.getTables(); } public updateGlobals(): void { const mod = this.modConfig.globals; - const global = this.databaseServer.getTables().globals; + const global = this.tables.globals; if (mod.damagePerMeter != 9 || mod.safeHeight != 3) { @@ -50,7 +50,7 @@ export class Globals private matchEndSettings(): void { - const global1 = this.databaseServer.getTables().globals.config.exp.match_end; + const global1 = this.tables.globals.config.exp.match_end; const mod = this.modConfig.globals.matchEnd; global1.survived_exp_requirement = mod.survivedExpRequirement; @@ -63,8 +63,8 @@ export class Globals global1.survivedMult = mod.survivedMult; global1.runnerMult = mod.runnerMult; global1.killedMult = mod.killedMult; - this.databaseServer.getTables().globals.config.exp.kill.headShotMult = mod.headShotMult; - this.databaseServer.getTables().globals.config.exp.kill.expOnDamageAllHealth = mod.expOnDamageAllHealth; + this.tables.globals.config.exp.kill.headShotMult = mod.headShotMult; + this.tables.globals.config.exp.kill.expOnDamageAllHealth = mod.expOnDamageAllHealth; this.logger.info("Match End Settings Patched"); } } diff --git a/Valens-AIO/src/hideout.ts b/Valens-AIO/src/hideout.ts index f5b930e..16d30f3 100644 --- a/Valens-AIO/src/hideout.ts +++ b/Valens-AIO/src/hideout.ts @@ -6,12 +6,12 @@ export class Hideout { private modConfig: Config = require("../config/config.json") private logger: Logger; - private databaseServer: DatabaseServer; + private tables: DatabaseServer; constructor(logger: Logger, databaseServer: DatabaseServer) { this.logger = logger; - this.databaseServer = databaseServer; + this.tables = databaseServer.getTables(); } public updateHideout(): void @@ -40,7 +40,7 @@ export class Hideout ||mod.generatorFuelFlowRate != 0.0013194444444444 ||mod.gpuBoostRate != 0.041225) { - const settings = this.databaseServer.getTables().hideout.settings; + const settings = this.tables.hideout.settings; settings.airFilterUnitFlowRate = mod.airFilterUnitFlowRate; settings.generatorFuelFlowRate = mod.generatorFuelFlowRate; settings.gpuBoostRate = mod.gpuBoostRate; @@ -53,7 +53,7 @@ export class Hideout private updateConstructionTime() { - for (const area of this.databaseServer.getTables().hideout.areas) + for (const area of this.tables.hideout.areas) { for (const stage in area.stages) { @@ -65,7 +65,7 @@ export class Hideout private updateProductionTime() { - for (const production of this.databaseServer.getTables().hideout.production) + for (const production of this.tables.hideout.production) { production.productionTime *= this.modConfig.hideout.productionTime; } @@ -73,7 +73,7 @@ export class Hideout private updateScavCase() { - for (const scavCase of this.databaseServer.getTables().hideout.scavcase) + for (const scavCase of this.tables.hideout.scavcase) { scavCase.ProductionTime *= this.modConfig.hideout.scavCaseTime; } diff --git a/Valens-AIO/src/items.ts b/Valens-AIO/src/items.ts index 0c35c1c..a43dfa8 100644 --- a/Valens-AIO/src/items.ts +++ b/Valens-AIO/src/items.ts @@ -1,7 +1,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { Config } from "../config/config"; import { Logger } from "./logger"; -import { Money } from "@spt-aki/models/enums/Money" export class Items { @@ -14,13 +13,13 @@ export class Items constructor(logger: Logger, databaseServer: DatabaseServer) { this.logger = logger; - this.tables = databaseServer; + this.tables = databaseServer.getTables(); } public updateItems(): void { - this.items = this.tables.getTables().templates.items; + this.items = this.tables.templates.items; this.mod = this.modConfig.items; if (this.mod.removeKeyUsageMax) diff --git a/Valens-AIO/src/locations.ts b/Valens-AIO/src/locations.ts index c9931ca..34f6783 100644 --- a/Valens-AIO/src/locations.ts +++ b/Valens-AIO/src/locations.ts @@ -1,4 +1,3 @@ -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { Config } from "../config/config"; import { Logger } from "./logger"; @@ -7,7 +6,7 @@ export class Locations { private modConfig: Config = require("../config/config.json"); private logger: Logger; - private tables: IDatabaseTables; + private tables: DatabaseServer; constructor (logger: Logger, databaseServer: DatabaseServer) { diff --git a/Valens-AIO/src/loot.ts b/Valens-AIO/src/loot.ts index 93bbf7b..55efede 100644 --- a/Valens-AIO/src/loot.ts +++ b/Valens-AIO/src/loot.ts @@ -1,5 +1,4 @@ import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { Config } from "../config/config"; import { Logger } from "./logger"; @@ -8,7 +7,7 @@ export class Loot { private modConfig: Config = require("../config/config.json"); private logger: Logger; - private tables: IDatabaseTables; + private tables: DatabaseServer; private locationConfig: ILocationConfig; constructor (logger: Logger, databaseServer: DatabaseServer, locationConfig: ILocationConfig) diff --git a/Valens-AIO/src/mod.ts b/Valens-AIO/src/mod.ts index 721be32..c550ed8 100644 --- a/Valens-AIO/src/mod.ts +++ b/Valens-AIO/src/mod.ts @@ -1,7 +1,6 @@ import { DependencyContainer } from "tsyringe"; import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; @@ -27,13 +26,13 @@ import { Weapons } from "./weapons"; import { Containers } from "./containers"; import { Locations } from "./locations"; import { Quests } from "./quests"; +import { Progression } from "./progression"; //import { Airdrop } from "./airdrop"; class ValensAIO implements IPostDBLoadMod { private modConfig: Config = require("../config/config.json"); private logger: ILogger; - private tables: IDatabaseTables; private databaseServer: DatabaseServer; private configServer: ConfigServer; private botConfig: IBotConfig; @@ -55,7 +54,6 @@ class ValensAIO implements IPostDBLoadMod this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR); this.botConfig = this.configServer.getConfig(ConfigTypes.BOT); - this.tables = this.databaseServer.getTables(); this.inRaidConfig = this.configServer.getConfig(ConfigTypes.IN_RAID); this.insuranceConfig = this.configServer.getConfig(ConfigTypes.INSURANCE); @@ -71,7 +69,7 @@ class ValensAIO implements IPostDBLoadMod const containers = new Containers(vLogger, this.databaseServer); containers.updateContainers(); - const flea = new Flea(vLogger, this.ragfairConfig, this.tables); + const flea = new Flea(vLogger, this.ragfairConfig, this.databaseServer); flea.updateFlea(); const globals = new Globals(vLogger, this.databaseServer); @@ -91,6 +89,9 @@ class ValensAIO implements IPostDBLoadMod const loot = new Loot(vLogger, this.databaseServer, this.locationConfig); loot.updateLoot(); + + const progression = new Progression(vLogger, this.databaseServer, this.botConfig); + progression.updateProgression(); const quests = new Quests(vLogger, this.databaseServer); quests.updateQuests(); diff --git a/Valens-AIO/src/progression.ts b/Valens-AIO/src/progression.ts new file mode 100644 index 0000000..2f077c4 --- /dev/null +++ b/Valens-AIO/src/progression.ts @@ -0,0 +1,291 @@ +import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { Logger } from "./logger"; +import { Config } from "../config/config"; + +export class Progression +{ + private modConfig: Config = require("../config/config.json"); + private logger: Logger; + private botConfig: IBotConfig; + private tables: DatabaseServer; + + constructor(logger: Logger, databaseServer: DatabaseServer, botConfig: IBotConfig) + { + this.logger = logger; + this.botConfig = botConfig; + this.tables = databaseServer.getTables(); + } + + public updateProgression(): void + { + + // modConfig variables + const mod = this.modConfig.progression; + + + // Server side variables + + + if (mod.enabled) + { + this.generateProgression(); + this.logger.info("Progressional Gear Changes Injected"); + } + } + + + // Functions start here + + + private generateProgression() + { + const primaryWeaponArrayLL1 = ["574d967124597745970e7c94", "57d14d2524597714373db789", "57f4c844245977379d5c14d1", "59984ab886f7743e98271174", "5ea03f7400685063ec28bfa8", "5ae08f0a5acfc408fb1398a1", "5bfd297f0db834001a669119", "59d6088586f774275f37482f", "583990e32459771419544dd2", "59e6152586f77473dc057aa1", "5c07c60e0db834002330051f", "5a38e6bac4a2826c6e06d79b", "56dee2bdd2720bc8328b4567", "5447a9cd4bdc2dbd208b4567", "5d2f0d8048f0356c925bc3b0", "5d2f0d8048f0356c925bc3b0", "5fc3e272f8b6a877a729eac5", "58948c8e86f77409493f7266", "5644bd2b4bdc2d3b4c8b4572", "59e6687d86f77411d949b251", "54491c4f4bdc2db1078b4568", "5ba26383d4351e00334c93d9", "587e02ff24597743df3deaeb", "5c501a4d2e221602b412b540", "60db29ce99594040e04c4a27", "5580223e4bdc2d1c128b457f", "61f7c9e189e6fb1a5e3ea78d", "5e870397991fd70db46995c8", "5de652c31b7e3716273428be"]; + const primaryWeaponArrayLL2 = primaryWeaponArrayLL1.concat(...["5839a40f24597726f856b511", "59ff346386f77477562ff5e2", "5ab8e9fcd8ce870019439434", "5bf3e03b0db834001d2c4a9c", "55801eed4bdc2d89578b4588", "5fbcc1d9016cce60e8341ab3", "628b5638ad252a16da6dd245", "5f2a9575926fd9352339381f", "5a7828548dc32e5a9c28b516", "60339954d62c9b14ed777c06", "6184055050224f204c1da540", "623063e994fc3f7b302a9696", "5e00903ae9dc277128008b87", "5ac66cb05acfc40198510a10", "5aafa857e5b5b00018480968", "5cc82d76e24e8d00134b4b83", "5bfea6e90db834001b7347f3", "576165642459773c7a400233", "606dae0ab0e443224b421bb7"]); + const primaryWeaponArrayLL3 = primaryWeaponArrayLL2.concat(...["5ac66d725acfc43b321d4b60", "5a0ec13bfcdbcb00165aa685", "5abcbc27d8ce8700182eceeb", "5ac4cd105acfc40016339859", "5ac66d2e5acfc43b321d4b53", "5ac66d9b5acfc4001633997a", "5beed0f50db834001c062b12", "57838ad32459774a17445cd2", "5c46fbd72e2216398b5a8c9c", "5e848cc2988a8701445df1e8", "5d43021ca4b9362eab4b5e25", "588892092459774ac91d4b11", "5c488a752e221602b412af63", "5b0bbe4e5acfc40dc528a72d", "618428466ef05c2ce828f218", "5a367e5dc4a282000e49738f", "5df8ce05b11454561e39243b", "6176aca650224f204c1da3fb", "628a60ae6b1d481ff772e9c8", "6183afd850224f204c1da514", "6165ac306ef05c2ce828ef74", "6259b864ebedf17603599e88"]); + + const holsterArrayLL1 = ["5448bd6b4bdc2dfc2f8b4569", "571a12c42459771f627b58a0", "576a581d2459771e7b1bc4f1", "5a17f98cfcdbcb0980087290", "5e81c3cbac2bb513793cdc75", "5cadc190ae921500103bb3b6", "56d59856d2720bd8418b456a", "5a7ae0c351dfba0017554310"]; + const holsterArrayLL2 = holsterArrayLL1.concat(...["61a4c8884f95bc3b2c5dc96f", "56e0598dd2720bb5668b45a6", "59f98b4986f7746f546d2cef", "602a9740da11d6478d5a06dc", "6193a720f8ee7e52e42109ed"]); + const holsterArrayLL3 = holsterArrayLL2.concat(...["5abccb7dd8ce87001773e277", "5d3eb3b0a4b93615055e84d2", "5b1fa9b25acfc40018633c01"]); + + + const backpackArrayLL1 = ["5ab8ee7786f7742d8f33f0b9", "544a5cde4bdc2d39388b456b", "5e9dcf5986f7746c417435b3", "5ab8f04f86f774585f4237d8", "5ca20d5986f774331e7c9602"]; + const backpackArrayLL2 = backpackArrayLL1.concat(...["545cdae64bdc2d39198b4568", "60a2828e8689911a226117f9", "618bb76513f5097c8d5aa2d5", "5f5e467b0bc58666c37e7821", "5ab8ebf186f7742d8b372e80"]); + const backpackArrayLL3 = backpackArrayLL2.concat(...["5f5e46b96bdad616ad46d613", "5d5d940f86f7742797262046", "60a272cc93ef783291411d8e", "6034d103ca006d2dca39b3f0", "619cf0335771dd3c390269ae", "628e1ffc83ec92260c0f437f"]); + + + const tacticalVestArrayLL1 = ["5929a2a086f7744f4b234d43", "5e4abc1f86f774069619fbaa", "6034d0230ca681766b6a0fb5", "6034cf5fffd42c541047f72e", "572b7adb24597762ae139821", "5c0e3eb886f7742015526062"]; + const tacticalVestArrayLL2 = tacticalVestArrayLL1.concat(...["5d5d8ca986f7742798716522", "544a5caa4bdc2d1a388b4568", "5c0e446786f7742013381639", "592c2d1a86f7746dbe2af32a", "5d5d85c586f774279a21cbdb", "59e7643b86f7742cbf2c109", "5b44c8ea86f7742d1627baf1", "5ca20abf86f77418567a43f2", "5d5d646386f7742797261fd9", "5fd4c60f875c30179f5d04c2", "60a6220e953894617404b00a", "61bc85697113f767765c7fe7", "603648ff5a45383c122086ac", "5e4abfed86f77406a2713cf7"]); + const tacticalVestArrayLL3 = tacticalVestArrayLL2.concat(...["60a3c70cde5f453f634816a3", "5648a69d4bdc2ded0b8b457b", "5ab8dced86f774646209ec87", "5ab8dab586f77441cd04f2a2", "60a621c49c197e4e8c4455e6", "5b44cad286f77402a54ae7e5", "5c0e6a1586f77404597b4965", "5c0e722886f7740458316a57", "5c0e746986f7741453628fe5", "5d5d87f786f77427997cfaef", "5df8a42886f77412640e2e75", "628d0618d1ba6e4fa07ce5a4", "61bcc89aef0f505f0c6cd0fc", "628dc750b910320f4c27a732", "628cd624459354321c4b7fa2"]); + + + const earpieceArrayLL1 = ["5b432b965acfc47a8774094e", "6033fa48ffd42c541047f728"]; + const earpieceArrayLL2 = earpieceArrayLL1.concat(...["5645bcc04bdc2d363b8b4572", "5aa2ba71e5b5b000137b758f"]); + const earpieceArrayLL3 = earpieceArrayLL2.concat(...["5a16b9fffcdbcb0176308b34"]); + + + const headwearArrayLL1 = ["5a7c4850e899ef00150be885", "5aa7d193e5b5b000171d063f", "5c06c6a80db834001b735491", "59e7711e86f7746cae05fbe1", "5ac4c50d5acfc40019262e87", "5645bc214bdc2d363b8b4571", "5aa2a7e8e5b5b00016327c16", "5b40e61f5acfc4001a599bec", "5aa2b87de5b5b00016327c25", "5b40e5e25acfc4001a599bea"]; + const headwearArrayLL2 = headwearArrayLL1.concat(...["5aa7d03ae5b5b00016327db5", "5d5e7d28a4b936645d161203", "5aa7e454e5b5b0214e506fa2", "5aa7e3abe5b5b000171d064d", "5b40e4035acfc47a87740943", "5b432d215acfc4771e1c6624", "5f60e784f2bcbb675b00dac7", "5aa2ba19e5b5b00014028f4e", "5b43271c5acfc432ff4dce65", "60b52e5bc7d8103275739d67", "5a16b672fcdbcb001912fa83"]); + const headwearArrayLL3 = headwearArrayLL2.concat(...["5ac8d6885acfc400180ae7b0", "5a154d5cfcdbcb001a3b00da", "5e00c1ad86f774747333222c", "5b40e3f35acfc40016388218", "5b4329f05acfc47a86086aa1", "5d6d3716a4b9361bc8618872", "5aa2b9ede5b5b000137b758b", "5c091a4e0db834001d5addc8", "5f60e7788adaa7100c3adb49", "5f60e6403b85f6263c14558c", "5aa7e373e5b5b000137b76f0"]); + + + const armorVestArrayLL1 = ["5df8a2ca86f7740bfe6df777", "5ab8e4ed86f7742d8e50c7fa", "5648a7494bdc2d9d488b4583", "5c0e5bab86f77461f55ed1f3", "5c0e5edb86f77461f55ed1f7", "62a09d79de7ac81993580530"]; + const armorVestArrayLL2 = armorVestArrayLL1.concat(...["5b44d22286f774172b0c9de8", "5c0e51be86f774598e797894"]) + const armorVestArrayLL3 = armorVestArrayLL2.concat(...["5f5f41476bdad616ad46d631", "545cdb794bdc2d3a198b456a", "5ab8e79e86f7742d8b372e78", "5b44d0de86f774503d30cba8", "5c0e53c886f7747fa54205c7", "5c0e57ba86f7747fa141986d", "5ca2151486f774244a3b8d30", "609e8540d5c319764c2bc2e9"]); + + const eyewearArrayLL1 = ["5aa2b986e5b5b00014028f4c", "557ff21e4bdc2d89578b4586", "5b432be65acfc433000ed01f"]; + const eyewearArrayLL2 = eyewearArrayLL1.concat(...["5d5fca1ea4b93635fd598c07"]); + const eyewearArrayLL3 = eyewearArrayLL2.concat(...["603409c80ca681766b6a0fb2", "5c0d32fcd174af02a1659c75", "5d6d2e22a4b9361bd5780d05"]); + + const armBandArrayLL1 = ["5b3f16c486f7747c327f55f7", "5b3f3ade86f7746b6b790d8e", "5b3f3af486f774679e752c1f", "5b3f3b0186f774021a2afef7", "5b3f3b0e86f7746752107cda"]; + const armBandArrayLL2 = armBandArrayLL1; + const armBandArrayLL3 = armBandArrayLL2.concat(...["619bdf9cc9546643a67df6f8", "619bc61e86e01e16f839a999", "619bdfd4c9546643a67df6fa", "619bdd8886e01e16f839a99c", "60b0f988c4449e4cb624c1da", "5f9949d869e2777a0e779ba5"]); + + const faceCoverArrayLL1 = ["572b7f1624597762ae139822"]; + const faceCoverArrayLL2 = faceCoverArrayLL1.concat(...["5ab8f39486f7745cd93a1cca", "5b4325355acfc40019478126"]); + const faceCoverArrayLL3 = faceCoverArrayLL2.concat(...["5ab8f85d86f7745cd93a1cf5", "5b432f3d5acfc4704b4a1dfb"]); + + const ammo127x55ArrayLL3 = ["5cadf6e5ae921500113bb973", "5cadf6eeae921500134b2799"]; + + const ammo762x54ArrayLL1 = ["5887431f2459777e1612938f"]; + const ammo762x54ArrayLL2 = ammo762x54ArrayLL1.concat(...["5e023cf8186a883be655e54f"]); + const ammo762x54ArrayLL3 = ammo762x54ArrayLL2.concat(...["59e77a2386f7742ee578960a", "560d61e84bdc2da74d8b4571"]); + + const ammo762x51ArrayLL1 = ["5e023e6e34d52a55c3304f71"]; + const ammo762x51ArrayLL2 = ammo762x51ArrayLL1.concat(...["5e023e53d4353e3302577c4c"]); + const ammo762x51ArrayLL3 = ammo762x51ArrayLL2.concat(...["58dd3ad986f77403051cba8f", "5a608bf24f39f98ffc77720e", "5a6086ea4f39f99cd479502f"]); + + const ammo762x39ArrayLL1 = ["5656d7c34bdc2d9d198b4587", "59e4d3d286f774176a36250a"]; + const ammo762x39ArrayLL2 = ammo762x39ArrayLL1.concat(...["59e4cf5286f7741778269d8a"]); + const ammo762x39ArrayLL3 = ammo762x39ArrayLL2.concat(...["59e4d24686f7741776641ac7", "59e0d99486f7744a32234762"]); + + const ammo762x35ArrayLL2 = ["5fbe3ffdf8b6a877a729ea82"]; + const ammo762x35ArrayLL3 = ammo762x35ArrayLL2.concat(...["6196365d58ef8c428c287da1", "619636be6db0f2477964e710"]); + + const ammo762x25TTArrayLL1 = ["5735fdcd2459776445391d61", "5735ff5c245977640e39ba7e", "573601b42459776410737435", "573602322459776445391df1"]; + const ammo762x25TTArrayLL2 = ammo762x25TTArrayLL1.concat(...["5736026a245977644601dc61", "573603c924597764442bd9cb"]); + const ammo762x25TTArrayLL3 = ammo762x25TTArrayLL2.concat(...["573603562459776430731618"]); + + const ammo366TKMArrayLL1 = ["59e6542b86f77411dc52a77a", "59e655cb86f77411dc52a77b"]; + const ammo366TKMArrayLL2 = ammo366TKMArrayLL1.concat(...["59e6658b86f77411d949b250"]); + const ammo366TKMArrayLL3 = ammo366TKMArrayLL2.concat(...["5f0596629e22f464da6bbdd9"]); + + const ammo556x45ArrayLL1 = ["59e6920f86f77411d82aa167", "54527a984bdc2d4e668b4567", "59e68f6f86f7746c9f75e846", "59e6927d86f77411da468256"]; + const ammo556x45ArrayLL2 = ammo556x45ArrayLL1.concat(...["59e6918f86f7746c9f75e849", "59e6906286f7746c9f75e847"]); + const ammo556x45ArrayLL3 = ammo556x45ArrayLL2.concat(...["60194943740c5d77f6705eea", "59e690b686f7746c9f75e848", "5c0d5ae286f7741e46554302"]); + + const ammo545x39ArrayLL1 = ["56dff338d2720bbd668b4569", "56dff4a2d2720bbd668b456a", "56dff3afd2720bba668b4567"]; + const ammo545x39ArrayLL2 = ammo545x39ArrayLL1.concat(...["56dff2ced2720bb4668b4567", "56dff4ecd2720b5f5a8b4568", "56dff421d2720b5f5a8b4567"]); + const ammo545x39ArrayLL3 = ammo545x39ArrayLL2.concat(...["56dfef82d2720bbd668b4567", "56dff061d2720bb5668b4567", "56dff026d2720bb8668b4567", "5c0d5e4486f77478390952fe"]); + + const ammo57x28ArrayLL2 = ["5cc80f8fe4a949033b0224a2"]; + const ammo57x28ArrayLL3 = ammo57x28ArrayLL2.concat(...["5cc80f38e4a949001152b560", "5cc80f53e4a949000e1ea4f8", "5cc80f67e4a949035e43bbba", "5cc80f79e4a949033c7343b2", "5cc86840d7f00c002412c56c"]); + + const ammo46x30ArrayLL1 = ["5ba26812d4351e003201fef1"]; + const ammo46x30ArrayLL2 = ammo46x30ArrayLL1; + const ammo46x30ArrayLL3 = ammo46x30ArrayLL2.concat(...["5ba2678ad4351e44f824b344", "5ba26844d4351e00334c9475"]); + + const ammo9x18ArrayLL1 = ["573719762459775a626ccbc1", "57371e4124597760ff7b25f1", "57371eb62459776125652ac1", "57371f2b24597761224311f1", "5737201124597760fc4431f1", "5737207f24597760ff7b25f2"]; + const ammo9x18ArrayLL2 = ammo9x18ArrayLL1.concat(...["57371b192459775a9f58a5e0"]); + const ammo9x18ArrayLL3 = ammo9x18ArrayLL2.concat(...["573718ba2459775a75491131", "573719df2459775a626ccbc2", "57371aab2459775a77142f22", "573720e02459776143012541", "57372140245977611f70ee91", "5737218f245977612125ba51"]); + + const ammo9x19ArrayLL1 = ["58864a4f2459770fcc257101", "5c3df7d588a4501f290594e5"]; + const ammo9x19ArrayLL2 = ammo9x19ArrayLL1.concat(...["56d59d3ad2720bdb418b4577"]); + const ammo9x19ArrayLL3 = ammo9x19ArrayLL2.concat(...["5c925fa22e221601da359b7b", "5efb0e16aeb21837e749c7ff", "5efb0da7a29a85116f6ea05f"]); + + const ammo9x21ArrayLL2 = ["5a26abfac4a28232980eabff"]; + const ammo9x21ArrayLL3 = ammo9x21ArrayLL2.concat(...["5a269f97c4a282000b151807", "5a26ac06c4a282000c5a90a8"]); + + const ammo9x39ArrayLL2 = ["57a0dfb82459774d3078b56c"]; + const ammo9x39ArrayLL3 = ammo9x39ArrayLL2.concat(...["57a0e5022459774d1673f889", "5c0d688c86f77413ae3407b2", "5c0d668f86f7747ccb7f13b2"]); + + const ammo9x33RArrayLL2 = ["62330b3ed4dc74626d570b95", "62330bfadc5883093563729b", "62330c40bdd19b369e1e53d1"]; + const ammo9x33RArrayLL3 = ammo9x33RArrayLL2.concat(...["62330c18744e5e31df12f516"]); + + const ammo1143x23ACPArrayLL1 = ["5e81f423763d9f754677bf2e"]; + const ammo1143x23ACPArrayLL2 = ammo1143x23ACPArrayLL1.concat(...["5efb0d4f4bc50b58e81710f3"]); + const ammo1143x23ACPArrayLL3 = ammo1143x23ACPArrayLL2.concat(...["5efb0cabfb3e451d70735af5", "5efb0fc6aeb21837e749c801"]); + + const ammo12x70ArrayLL1 = ["560d5e524bdc2d25448b4571", "5d6e6772a4b936088465b17c", "5d6e67fba4b9361bc73bc779", "58820d1224597753c90aeb13", "5d6e6869a4b9361c140bcfde", "5d6e6891a4b9361bd473feea", ]; + const ammo12x70ArrayLL2 = ammo12x70ArrayLL1.concat(...["5d6e6806a4b936088465b17e", "5d6e689ca4b9361bc8618956", "5d6e68e6a4b9361c140bcfe0"]); + const ammo12x70ArrayLL3 = ammo12x70ArrayLL2.concat(...["5d6e68b3a4b9361bca7e50b5", "5d6e68dea4b9361bcc29e659", "5d6e68a8a4b9360b6c0d54e2", "5d6e6911a4b9361bd5780d52", "5d6e68c4a4b9361b93413f79", "5c0d591486f7744c505b416f"]); + + const ammo20x70ArrayLL1 = ["5a38ebd9c4a282000d722a5b", "5d6e695fa4b936359b35d852", "5d6e6a42a4b9364f07165f52", "5d6e6a53a4b9361bd473feec"]; + const ammo20x70ArrayLL2 = ammo20x70ArrayLL1.concat(...["5d6e69b9a4b9361bc8618958", "5d6e69c7a4b9360b6c0d54e4"]); + const ammo20x70ArrayLL3 = ammo20x70ArrayLL2.concat(...["5d6e6a05a4b93618084f58d0", "5d6e6a5fa4b93614ec501745"]); + + const ammo23x75ArrayLL3 = ["5e85a9a6eacf8c039e4e2ac1", "5f647f31b6238e5dd066e196"]; + + + const progressionWhitelistLL1: IBotConfig.Equipment.whitelist.EquipmentFilterDetails = + { + "levelRange": + { + "min": 1, + "max": 15 + }, + "equipment": + { + "FirstPrimaryWeapon": [...primaryWeaponArrayLL1], + "Holster": [...holsterArrayLL1], + "Backpack": [...backpackArrayLL1], + "TacticalVest": [...tacticalVestArrayLL1], + "Earpiece": [...earpieceArrayLL1], + "Headwear": [...headwearArrayLL1], + "ArmorVest": [...armorVestArrayLL1], + "Eyewear": [...eyewearArrayLL1], + "ArmBand": [...armBandArrayLL1], + "FaceCover": [...faceCoverArrayLL1] + }, + "cartridge": + { + "Caliber762x54R": [...ammo762x54ArrayLL1], + "Caliber762x51": [...ammo762x51ArrayLL1], + "Caliber762x39": [...ammo762x39ArrayLL1], + "Caliber762x25TT": [...ammo762x25TTArrayLL1], + "Caliber366TKM": [...ammo366TKMArrayLL1], + "Caliber556x45NATO": [...ammo556x45ArrayLL1], + "Caliber545x39": [...ammo545x39ArrayLL1], + "Caliber46x30": [...ammo46x30ArrayLL1], + "Caliber1143x23ACP": [...ammo1143x23ACPArrayLL1], + "Caliber9x19PARA": [...ammo9x19ArrayLL1], + "Caliber9x18PM": [...ammo9x18ArrayLL1], + "Caliber12g": [...ammo12x70ArrayLL1], + "Caliber20g": [...ammo20x70ArrayLL1] + } + } + + const progressionWhitelistLL2: IBotConfig.Equipment.whitelist.EquipmentFilterDetails = + { + "levelRange": + { + "min": 16, + "max": 25 + }, + "equipment": + { + "FirstPrimaryWeapon": [...primaryWeaponArrayLL2], + "Holster": [...holsterArrayLL2], + "Backpack": [...backpackArrayLL2], + "TacticalVest": [...tacticalVestArrayLL2], + "Earpiece": [...earpieceArrayLL2], + "Headwear": [...headwearArrayLL2], + "ArmorVest": [...armorVestArrayLL2], + "Eyewear": [...eyewearArrayLL2], + "ArmBand": [...armBandArrayLL2], + "FaceCover": [...faceCoverArrayLL2] + }, + "cartridge": + { + "Caliber762x54R": [...ammo762x54ArrayLL2], + "Caliber762x51": [...ammo762x51ArrayLL2], + "Caliber762x39": [...ammo762x39ArrayLL2], + "Caliber762x35": [...ammo762x35ArrayLL2], + "Caliber762x25TT": [...ammo762x25TTArrayLL2], + "Caliber366TKM": [...ammo366TKMArrayLL2], + "Caliber556x45NATO": [...ammo556x45ArrayLL2], + "Caliber545x39": [...ammo545x39ArrayLL2], + "Caliber57x28": [...ammo57x28ArrayLL2], + "Caliber46x30": [...ammo46x30ArrayLL2], + "Caliber1143x23ACP": [...ammo1143x23ACPArrayLL2], + "Caliber9x39": [...ammo9x39ArrayLL2], + "Caliber9x33R": [...ammo9x33RArrayLL2], + "Caliber9x21": [...ammo9x21ArrayLL2], + "Caliber9x19PARA": [...ammo9x19ArrayLL2], + "Caliber9x18PM": [...ammo9x18ArrayLL2], + "Caliber12g": [...ammo12x70ArrayLL2], + "Caliber20g": [...ammo20x70ArrayLL2] + } + } + + + const progressionWhitelistLL3: IBotConfig.Equipment.whitelist.EquipmentFilterDetails = + { + "levelRange": + { + "min": 26, + "max": 36 + }, + "equipment": + { + "FirstPrimaryWeapon": [...primaryWeaponArrayLL3], + "Holster": [...holsterArrayLL3], + "Backpack": [...backpackArrayLL3], + "TacticalVest": [...tacticalVestArrayLL3], + "Earpiece": [...earpieceArrayLL3], + "Headwear": [...headwearArrayLL3], + "ArmorVest": [...armorVestArrayLL3], + "Eyewear": [...eyewearArrayLL3], + "ArmBand": [...armBandArrayLL3], + "FaceCover": [...faceCoverArrayLL3] + }, + "cartridge": + { + "Caliber127x55": [...ammo127x55ArrayLL3], + "Caliber762x54R": [...ammo762x54ArrayLL3], + "Caliber762x51": [...ammo762x51ArrayLL3], + "Caliber762x39": [...ammo762x39ArrayLL3], + "Caliber762x35": [...ammo762x35ArrayLL3], + "Caliber762x25TT": [...ammo762x25TTArrayLL3], + "Caliber366TKM": [...ammo366TKMArrayLL3], + "Caliber556x45NATO": [...ammo556x45ArrayLL3], + "Caliber545x39": [...ammo545x39ArrayLL3], + "Caliber57x28": [...ammo57x28ArrayLL3], + "Caliber46x30": [...ammo46x30ArrayLL3], + "Caliber1143x23ACP": [...ammo1143x23ACPArrayLL3], + "Caliber9x39": [...ammo9x39ArrayLL3], + "Caliber9x33R": [...ammo9x33RArrayLL3], + "Caliber9x21": [...ammo9x21ArrayLL3], + "Caliber9x19PARA": [...ammo9x19ArrayLL3], + "Caliber9x18PM": [...ammo9x18ArrayLL3], + "Caliber12g": [...ammo12x70ArrayLL3], + "Caliber20g": [...ammo20x70ArrayLL3], + "Caliber23x75": [...ammo23x75ArrayLL3] + } + } + + this.botConfig.equipment.pmc.whitelist.push(progressionWhitelistLL1); + this.botConfig.equipment.pmc.whitelist.push(progressionWhitelistLL2); + this.botConfig.equipment.pmc.whitelist.push(progressionWhitelistLL3); + } +} \ No newline at end of file diff --git a/Valens-AIO/src/quests.ts b/Valens-AIO/src/quests.ts index e437f4c..057ee6b 100644 --- a/Valens-AIO/src/quests.ts +++ b/Valens-AIO/src/quests.ts @@ -1,4 +1,4 @@ -import { Logger } from "winston"; +import { Logger } from "./logger"; import { Config } from "../config/config"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; @@ -6,12 +6,12 @@ export class Quests { private modConfig: Config = require("../config/config.json"); private logger: Logger; - private databaseServer: DatabaseServer; + private tables: DatabaseServer; constructor(logger: Logger, databaseServer: DatabaseServer) { this.logger = logger; - this.databaseServer = databaseServer.getTables(); + this.tables = databaseServer.getTables(); } public updateQuests(): void @@ -26,7 +26,7 @@ export class Quests // Updates the weight modifier (as a multiplier) for all items in database/templates/items.json private onlyFoundInRaid(): void { - const quests = this.databaseServer.templates.quests; + const quests = this.tables.templates.quests; for (const questid in quests) { diff --git a/Valens-AIO/src/raid.ts b/Valens-AIO/src/raid.ts index a359f46..368e05d 100644 --- a/Valens-AIO/src/raid.ts +++ b/Valens-AIO/src/raid.ts @@ -1,4 +1,3 @@ -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; import { Logger } from "./logger"; @@ -8,7 +7,7 @@ export class Raid { private modConfig: Config = require("../config/config.json") private logger: Logger; - private tables: IDatabaseTables; + private tables: DatabaseServer; private inRaidConfig: IInRaidConfig; constructor(logger:Logger, databaseServer: DatabaseServer, inRaidConfig: IInRaidConfig) diff --git a/Valens-AIO/src/weapons.ts b/Valens-AIO/src/weapons.ts index eaba34a..90532d4 100644 --- a/Valens-AIO/src/weapons.ts +++ b/Valens-AIO/src/weapons.ts @@ -1,4 +1,3 @@ -import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { Config } from "../config/config"; import { Logger } from "./logger"; @@ -7,7 +6,7 @@ export class Weapons { private modConfig: Config = require("../config/config.json") private logger: Logger; - private tables: IDatabaseTables; + private tables: DatabaseServer; private mod: any; private weapons: any; diff --git a/Valens-AIO/types/callbacks/NotifierCallbacks.d.ts b/Valens-AIO/types/callbacks/NotifierCallbacks.d.ts index cd1e736..c42058f 100644 --- a/Valens-AIO/types/callbacks/NotifierCallbacks.d.ts +++ b/Valens-AIO/types/callbacks/NotifierCallbacks.d.ts @@ -16,7 +16,7 @@ export declare class NotifierCallbacks { * until we actually have something to send because otherwise we'd spam the client * and the client would abort the connection due to spam. */ - sendNotification(_sessionID: string, req: any, resp: any, _data: any): void; + sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; diff --git a/Valens-AIO/types/controllers/BotController.d.ts b/Valens-AIO/types/controllers/BotController.d.ts index 8782d71..5e6f05d 100644 --- a/Valens-AIO/types/controllers/BotController.d.ts +++ b/Valens-AIO/types/controllers/BotController.d.ts @@ -30,6 +30,6 @@ export declare class BotController { */ getBotDifficulty(type: string, difficulty: string): Difficulty; protected getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string): Difficulty; - generate(info: IGenerateBotsRequestData): IBotBase[]; + generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[]; getBotCap(): number; } diff --git a/Valens-AIO/types/controllers/HideoutController.d.ts b/Valens-AIO/types/controllers/HideoutController.d.ts index b8c1f7c..3eefe1a 100644 --- a/Valens-AIO/types/controllers/HideoutController.d.ts +++ b/Valens-AIO/types/controllers/HideoutController.d.ts @@ -45,13 +45,30 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected configServer: ConfigServer; + protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer); upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; - putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Create item in hideout slot item array, remove item from player inventory + * @param pmcData Profile data + * @param addItemToHideoutRequest reqeust from client to place item in area slot + * @param sessionID Session id + * @returns IItemEventRouterResponse object + */ + putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; - protected removeItemFromGenerator(sessionID: string, pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; + /** + * Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot + * @param sessionID Session id + * @param pmcData Profile to update + * @param removeResourceRequest client request + * @param output response to send to client + * @param hideoutArea Area fuel is being removed from + * @returns IItemEventRouterResponse response + */ + protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** diff --git a/Valens-AIO/types/controllers/InraidController.d.ts b/Valens-AIO/types/controllers/InraidController.d.ts index 8940c97..b899e7d 100644 --- a/Valens-AIO/types/controllers/InraidController.d.ts +++ b/Valens-AIO/types/controllers/InraidController.d.ts @@ -13,9 +13,11 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { InsuranceService } from "../services/InsuranceService"; import { JsonUtil } from "../utils/JsonUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class InraidController { protected saveServer: SaveServer; protected jsonUtil: JsonUtil; + protected timeUtil: TimeUtil; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; protected itemHelper: ItemHelper; @@ -27,7 +29,16 @@ export declare class InraidController { protected inRaidHelper: InRaidHelper; protected configServer: ConfigServer; protected inraidConfig: IInRaidConfig; - constructor(saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); + constructor(saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void; + /** + * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them + * @param offraidData Save Progress Request + * @param pmcData player profile + * @param isPlayerScav Was the player a pScav + */ + private markOrRemoveFoundInRaidItems; + private handlePostRaidPlayerScavProcess; + private handlePostRaidPlayerScavKarmaChanges; } diff --git a/Valens-AIO/types/controllers/InsuranceController.d.ts b/Valens-AIO/types/controllers/InsuranceController.d.ts index af45442..6895383 100644 --- a/Valens-AIO/types/controllers/InsuranceController.d.ts +++ b/Valens-AIO/types/controllers/InsuranceController.d.ts @@ -41,5 +41,4 @@ export declare class InsuranceController { * @returns response object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; - doAbsolutelyNothing(): void; } diff --git a/Valens-AIO/types/controllers/NoteController.d.ts b/Valens-AIO/types/controllers/NoteController.d.ts index cc78383..ee70541 100644 --- a/Valens-AIO/types/controllers/NoteController.d.ts +++ b/Valens-AIO/types/controllers/NoteController.d.ts @@ -2,11 +2,10 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { INoteActionData } from "../models/eft/notes/INoteActionData"; import { ItemEventRouter } from "../routers/ItemEventRouter"; -declare class NoteController { +export declare class NoteController { protected itemEventRouter: ItemEventRouter; constructor(itemEventRouter: ItemEventRouter); addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse; } -export { NoteController }; diff --git a/Valens-AIO/types/controllers/RepairController.d.ts b/Valens-AIO/types/controllers/RepairController.d.ts index 330684d..0e78ef6 100644 --- a/Valens-AIO/types/controllers/RepairController.d.ts +++ b/Valens-AIO/types/controllers/RepairController.d.ts @@ -21,7 +21,6 @@ export declare class RepairController { protected repairHelper: RepairHelper; protected configServer: ConfigServer; protected repairConfig: IRepairConfig; - protected readonly WEAPON_SKILL_REPAIR_GAIN: number; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Repair with trader diff --git a/Valens-AIO/types/generators/BotGenerator.d.ts b/Valens-AIO/types/generators/BotGenerator.d.ts index 6e837fa..a5fc0ad 100644 --- a/Valens-AIO/types/generators/BotGenerator.d.ts +++ b/Valens-AIO/types/generators/BotGenerator.d.ts @@ -8,6 +8,7 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; @@ -26,11 +27,12 @@ export declare class BotGenerator { protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; protected botInventoryGenerator: BotInventoryGenerator; + protected botEquipmentFilterService: BotEquipmentFilterService; protected botHelper: BotHelper; protected gameEventHelper: GameEventHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botEquipmentFilterService: BotEquipmentFilterService, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -39,7 +41,7 @@ export declare class BotGenerator { * @returns */ generatePlayerScav(role: string, difficulty: string, botTemplate: IBotType): IBotBase; - generate(info: IGenerateBotsRequestData): IBotBase[]; + generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[]; /** * Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check * @param botRole the bot role to check if should be a pmc diff --git a/Valens-AIO/types/generators/BotLootGenerator.d.ts b/Valens-AIO/types/generators/BotLootGenerator.d.ts index 9e45529..c6a3f29 100644 --- a/Valens-AIO/types/generators/BotLootGenerator.d.ts +++ b/Valens-AIO/types/generators/BotLootGenerator.d.ts @@ -1,7 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; -import { ItemMinMax, Items } from "../models/eft/common/tables/IBotType"; +import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem, Props } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; @@ -11,6 +11,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotLootCacheService } from "../services/BotLootCacheService"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { BotWeaponGenerator } from "./BotWeaponGenerator"; export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; @@ -18,11 +19,12 @@ export declare class BotLootGenerator { protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; + protected botWeaponGenerator: BotWeaponGenerator; protected botLootCacheService: BotLootCacheService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer); - generateLoot(lootPool: Items, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, inventory: PmcInventory): void; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer); + generateLoot(templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void; protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached @@ -36,6 +38,16 @@ export declare class BotLootGenerator { * @param isPmc is the bot being generated for a pmc */ protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; + /** + * Add generated weapons to inventory as loot + * @param botInventory inventory to add preset to + * @param equipmentSlot slot to place the preset in (backpack) + * @param templateInventory bots template, assault.json + * @param modChances chances for mods to spawn on weapon + * @param botRole bots role, .e.g. pmcBot + * @param isPmc are we generating for a pmc + */ + protected addLooseWeaponsToInventorySlot(botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void; /** * Get a random item from the pool parameter using the biasedRandomNumber system * @param pool pool of items to pick an item from diff --git a/Valens-AIO/types/generators/BotWeaponGenerator.d.ts b/Valens-AIO/types/generators/BotWeaponGenerator.d.ts index e9e298b..9215214 100644 --- a/Valens-AIO/types/generators/BotWeaponGenerator.d.ts +++ b/Valens-AIO/types/generators/BotWeaponGenerator.d.ts @@ -6,6 +6,7 @@ import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase" import { Inventory, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -26,12 +27,60 @@ export declare class BotWeaponGenerator { protected readonly modMagazineSlotId = "mod_magazine"; protected botConfig: IBotConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer); - generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; + /** + * Get a random weapon from a bots pool of weapons (weighted) + * @param equipmentSlot Primary/secondary/holster + * @param botTemplateInventory e.g. assault.json + * @returns weapon tpl + */ + pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: Inventory): string; + /** + * Generated a weapon based on the supplied weapon tpl + * @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool()) + * @param equipmentSlot slot to fit into, primary/secondary/holster + * @param botTemplateInventory e.g. assault.json + * @param weaponParentId + * @param modChances + * @param botRole + * @param isPmc + * @returns GenerateWeaponResult object + */ + generateWeaponByTpl(weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult; + /** + * Generate an entirely random weapon + * @param equipmentSlot Primary/secondary/holster + * @param botTemplateInventory e.g. assault.json + * @param weaponParentId + * @param modChances + * @param botRole + * @param isPmc + * @returns GenerateWeaponResult object + */ + generateRandomWeapon(equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult; + /** + * Create array with weapon base as only element + * Add additional properties as required + * @param weaponTpl + * @param weaponParentId + * @param equipmentSlot + * @param weaponItemTemplate + * @param botRole for durability values + * @returns + */ + constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[]; + /** + * Add compatible magazines to an inventory based on a generated weapon + * @param weaponDetails + * @param magCounts + * @param inventory + * @param botRole the bot type we're getting generating extra mags for + */ + addExtraMagazinesToInventory(weaponDetails: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; /** * Get the mods necessary to kit out a weapon to its preset level * @param weaponTpl weapon to find preset for * @param equipmentSlot the slot the weapon will be placed in - * @param weaponParentId + * @param weaponParentId Value used for the parentid * @returns array of weapon mods */ protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[]; @@ -45,9 +94,10 @@ export declare class BotWeaponGenerator { * @param magCounts * @param ammoTpl * @param inventory + * @param botRole the bot type we're getting generating extra mags for * @returns */ - protected generateExtraMagazines(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory): void; + protected generateExtraMagazines(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void; /** * Get a randomised number of bullets for a specific magazine * @param magCounts min and max count of magazines @@ -73,9 +123,10 @@ export declare class BotWeaponGenerator { * Get a weapons magazine tpl from a weapon template * @param weaponMods mods from a weapon template * @param weaponTemplate Weapon to get magazine tpl for + * @param botRole the bot type we are getting the magazine for * @returns magazine tpl string */ - protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem): string; + protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for diff --git a/Valens-AIO/types/helpers/BotGeneratorHelper.d.ts b/Valens-AIO/types/helpers/BotGeneratorHelper.d.ts index 413fc10..3cd7256 100644 --- a/Valens-AIO/types/helpers/BotGeneratorHelper.d.ts +++ b/Valens-AIO/types/helpers/BotGeneratorHelper.d.ts @@ -28,20 +28,13 @@ export declare class BotGeneratorHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, configServer: ConfigServer); - generateModsForItem(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, isPmc?: boolean): Item[]; + generateModsForItem(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[]; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent * @returns true if it is cylinder related */ magazineIsCylinderRelated(magazineParentName: string): boolean; - /** - * Get a list of non black-listed cartridges from the PMC bot config - * @param cartridgesToFilter catridges to filter - * @param itemModPool - * @returns string array of cartridges PMCs can use - */ - getNonBlacklistedPmcCartridges(cartridgesToFilter: string[]): string[]; /** * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot * never return true for an item that has 0% spawn chance diff --git a/Valens-AIO/types/helpers/DialogueHelper.d.ts b/Valens-AIO/types/helpers/DialogueHelper.d.ts index 9776c6a..e3e2bda 100644 --- a/Valens-AIO/types/helpers/DialogueHelper.d.ts +++ b/Valens-AIO/types/helpers/DialogueHelper.d.ts @@ -1,3 +1,4 @@ +import { Item } from "../models/eft/common/tables/IItem"; import { Dialogue, MessageContent, MessagePreview } from "../models/eft/profile/IAkiProfile"; import { MessageType } from "../models/enums/MessageType"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,7 +16,25 @@ export declare class DialogueHelper { protected itemHelper: ItemHelper; constructor(hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper); createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent; + /** + * Add a templated message to the dialogue. + * @param dialogueID + * @param messageContent + * @param sessionID + * @param rewards + */ addDialogueMessage(dialogueID: string, messageContent: MessageContent, sessionID: string, rewards?: any[]): void; + /** + * Get the preview contents of the last message in a dialogue. + * @param dialogue + * @returns + */ getMessagePreview(dialogue: Dialogue): MessagePreview; - getMessageItemContents(messageID: string, sessionID: string): any[]; + /** + * Get the item contents for a particular message. + * @param messageID + * @param sessionID + * @returns + */ + getMessageItemContents(messageID: string, sessionID: string): Item[]; } diff --git a/Valens-AIO/types/helpers/ExtendedProfileHelper.d.ts b/Valens-AIO/types/helpers/ExtendedProfileHelper.d.ts deleted file mode 100644 index c05d88e..0000000 --- a/Valens-AIO/types/helpers/ExtendedProfileHelper.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { BotGenerator } from "../generators/BotGenerator"; -import { IPmcData, Skills, Stats } from "../models/eft/common/IPmcData"; -import { DatabaseServer } from "../servers/DatabaseServer"; -import { SaveServer } from "../servers/SaveServer"; -import { BotLootCacheService } from "../services/BotLootCacheService"; -import { FenceService } from "../services/FenceService"; -import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; -import { Watermark } from "../utils/Watermark"; -import { ItemHelper } from "./ItemHelper"; -import { ProfileHelper } from "./ProfileHelper"; -/** - * This class needs to exist outside of ProfileHelper to ensure cyclic deps don't cause the server to fail on load - */ -export declare class ExtendedProfileHelper extends ProfileHelper { - protected botLootCacheService: BotLootCacheService; - protected botGenerator: BotGenerator; - constructor(jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, botLootCacheService: BotLootCacheService, fenceService: FenceService, botGenerator: BotGenerator); - generatePlayerScav(sessionID: string): IPmcData; - protected getScavSkills(sessionID: string): Skills; - protected removeSecureContainer(profile: IPmcData): IPmcData; - protected getDefaultScavSkills(): Skills; - protected getScavStats(sessionID: string): Stats; - protected getScavLevel(sessionID: string): number; - protected getScavExperience(sessionID: string): number; - protected setScavCooldownTimer(profile: IPmcData, pmcData: IPmcData): IPmcData; -} diff --git a/Valens-AIO/types/helpers/GameEventHelper.d.ts b/Valens-AIO/types/helpers/GameEventHelper.d.ts index b2d6377..7613053 100644 --- a/Valens-AIO/types/helpers/GameEventHelper.d.ts +++ b/Valens-AIO/types/helpers/GameEventHelper.d.ts @@ -2,7 +2,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; export declare class GameEventHelper { protected databaseServer: DatabaseServer; constructor(databaseServer: DatabaseServer); - get EVENT(): Record; + get events(): Record; get christmasEventItems(): string[]; itemIsChristmasRelated(itemId: string): boolean; christmasEventEnabled(): boolean; diff --git a/Valens-AIO/types/helpers/HideoutHelper.d.ts b/Valens-AIO/types/helpers/HideoutHelper.d.ts index 6ac0945..36e4009 100644 --- a/Valens-AIO/types/helpers/HideoutHelper.d.ts +++ b/Valens-AIO/types/helpers/HideoutHelper.d.ts @@ -30,14 +30,10 @@ export declare class HideoutHelper { protected inventoryHelper: InventoryHelper; protected playerService: PlayerService; protected configServer: ConfigServer; - static BITCOIN_FARM: string; - protected WATER_COLLECTOR: string; - protected BITCOIN: string; - protected EXPEDITIONARY_FUEL_TANK: string; - static NAME_BACKENDCOUNTERS_CRAFTING: string; - static SKILL_NAME_HIDEOUT: string; - static HOUR_FOR_SKILL_CRAFTING: number; - static SKILL_NAME_CRAFITING: string; + static bitcoinFarm: string; + static waterCollector: string; + static bitcoin: string; + static expeditionaryFuelTank: string; protected hideoutConfig: IHideoutConfig; constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/Valens-AIO/types/helpers/InRaidHelper.d.ts b/Valens-AIO/types/helpers/InRaidHelper.d.ts index b818a48..c3cbfbb 100644 --- a/Valens-AIO/types/helpers/InRaidHelper.d.ts +++ b/Valens-AIO/types/helpers/InRaidHelper.d.ts @@ -16,21 +16,72 @@ export declare class InRaidHelper { protected inventoryHelper: InventoryHelper; protected paymentHelper: PaymentHelper; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper); + /** + * Reset the SPT inraid property stored in a profile to 'none' + * @param sessionID Session id + */ protected removePlayer(sessionID: string): void; + /** + * Some maps have one-time-use keys (e.g. Labs + * Remove the relevant key from an inventory based on the post-raid request data passed in + * @param offraidData post-raid data + * @param sessionID Session id + */ protected removeMapAccessKey(offraidData: ISaveProgressRequestData, sessionID: string): void; + /** + * Check an array of items and add an upd object to money items with a stack count of 1 + * Single stack money items have no upd object and thus no StackObjectsCount, causing issues + * @param items Items array to check + */ addUpdToMoneyFromRaid(items: Item[]): void; /** - * Add positive karma for PMC kills - * @param {*} existingFenceStanding - * @param {*} victims + * Add karma changes up and return the new value + * @param existingFenceStanding Current fence standing level + * @param victims Array of kills player performed + * @returns adjusted karma level after kills are taken into account */ - calculateFenceStandingChangeFromKills(existingFenceStanding: number, victims: Victim[]): void; - setBaseStats(profileData: IPmcData, offraidData: ISaveProgressRequestData, sessionID: string): IPmcData; - markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; - removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; - setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + calculateFenceStandingChangeFromKills(existingFenceStanding: number, victims: Victim[]): number; + /** + * Reset a profile to a baseline, used post-raid + * Reset points earned during session property + * Increment exp + * Remove Labs keycard + * @param profileData Profile to update + * @param saveProgressRequest post raid save data request data + * @param sessionID Sessino id + * @returns Reset profile object + */ + updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData; + /** + * Adds SpawnedInSession property to items found in a raid + * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true + * @param preRaidProfile profile to update + * @param postRaidProfile profile to upate inventory contents of + * @param isPlayerScav Was this a p scav raid + * @returns + */ + addSpawnedInSessionPropertyToItems(preRaidProfile: IPmcData, postRaidProfile: IPmcData, isPlayerScav: boolean): IPmcData; + /** + * Iterate over inventory items and remove the property that defines an item as Found in Raid + * Only removes property if item had FiR when entering raid + * @param postRaidProfile profile to update items for + * @returns Updated profile with SpawnedInSession removed + */ + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + /** + * Update a players inventory post-raid + * Remove equipped items from pre-raid + * Add new items found in raid to profile + * Store insurance items in profile + * @param sessionID + * @param pmcData Profile to update + * @param postRaidProfile Profile returned by client after a raid + * @returns Updated profile + */ + setInventory(sessionID: string, pmcData: IPmcData, postRaidProfile: IPmcData): IPmcData; /** * Clear pmc inventory of all items except those that are exempt + * Used post-raid to remove items after death * @param pmcData Player profile * @param sessionID Session id * @returns Player profile with pmc inventory cleared diff --git a/Valens-AIO/types/helpers/QuestHelper.d.ts b/Valens-AIO/types/helpers/QuestHelper.d.ts index 650929a..0f68cd5 100644 --- a/Valens-AIO/types/helpers/QuestHelper.d.ts +++ b/Valens-AIO/types/helpers/QuestHelper.d.ts @@ -1,9 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Quest } from "../models/eft/common/tables/IBotBase"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ItemEventRouter } from "../routers/ItemEventRouter"; @@ -36,8 +36,7 @@ export declare class QuestHelper { protected configServer: ConfigServer; protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer); - static get STATUS(): Record; - questStatus(pmcData: IPmcData, questID: string): string; + questStatus(pmcData: IPmcData, questID: string): QuestStatus; /** * returns true is the condition is satisfied */ @@ -49,11 +48,17 @@ export declare class QuestHelper { * Debug Routine for showing some information on the * quest list in question. */ - dumpQuests(quests: any, label?: any): void; + dumpQuests(quests: any): void; loyaltyRequirementCheck(loyaltyRequirementProperties: AvailableForProps, profile: IPmcData): boolean; protected processReward(reward: Reward): any[]; - getQuestRewardItems(quest: IQuest, state: string): Reward[]; - addQuestToPMCData(pmcData: IPmcData, quest: Quest, newState: string, acceptedQuest: IAcceptQuestRequestData): void; + getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[]; + /** + * Add quest with new state value to pmc profile + * @param pmcData profile to add quest to + * @param newState state the new quest should be in when added + * @param acceptedQuest Details of quest being added + */ + addQuestToPMCData(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): void; acceptedUnlocked(acceptedQuestId: string, sessionID: string): IQuest[]; failedUnlocked(failedQuestId: string, sessionID: string): IQuest[]; applyMoneyBoost(quest: IQuest, moneyBoost: number): IQuest; @@ -84,6 +89,13 @@ export declare class QuestHelper { */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Alter a quests state + Add a record to tis status timers object + * @param pmcData Profile to update + * @param newQuestState new state the qeust should be in + * @param questId id of the quest to alter the status of + */ + updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void; /** * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks * @param pmcData Player profile @@ -92,7 +104,7 @@ export declare class QuestHelper { * @param sessionID Seession id * @returns array of reward objects */ - applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; + applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: QuestStatus, sessionID: string): Reward[]; /** * Get the intel center bonus a player has * @param pmcData player profile diff --git a/Valens-AIO/types/helpers/RagfairOfferHelper.d.ts b/Valens-AIO/types/helpers/RagfairOfferHelper.d.ts index 5a77e13..8d03bee 100644 --- a/Valens-AIO/types/helpers/RagfairOfferHelper.d.ts +++ b/Valens-AIO/types/helpers/RagfairOfferHelper.d.ts @@ -40,7 +40,7 @@ export declare class RagfairOfferHelper { protected ragfairOfferService: RagfairOfferService; protected localeService: LocaleService; protected configServer: ConfigServer; - protected static TPL_GOODS_SOLD: string; + protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); diff --git a/Valens-AIO/types/helpers/RagfairServerHelper.d.ts b/Valens-AIO/types/helpers/RagfairServerHelper.d.ts index a52306b..e4939d1 100644 --- a/Valens-AIO/types/helpers/RagfairServerHelper.d.ts +++ b/Valens-AIO/types/helpers/RagfairServerHelper.d.ts @@ -26,7 +26,7 @@ export declare class RagfairServerHelper { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; - protected static TPL_GOODS_RETURNED: string; + protected static goodsReturnedTemplate: string; constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item diff --git a/Valens-AIO/types/helpers/RepairHelper.d.ts b/Valens-AIO/types/helpers/RepairHelper.d.ts index 545108e..9a3ab29 100644 --- a/Valens-AIO/types/helpers/RepairHelper.d.ts +++ b/Valens-AIO/types/helpers/RepairHelper.d.ts @@ -14,7 +14,7 @@ export declare class RepairHelper { protected configServer: ConfigServer; protected repairConfig: IRepairConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer); - updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit?: boolean): Item; + updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit?: boolean, applyRandomDegradation?: boolean): Item; protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number): number; protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, armorMax: number): number; isWeaponTemplate(tpl: string): boolean; diff --git a/Valens-AIO/types/models/eft/common/tables/IBotBase.d.ts b/Valens-AIO/types/models/eft/common/tables/IBotBase.d.ts index 3acd540..0ee468e 100644 --- a/Valens-AIO/types/models/eft/common/tables/IBotBase.d.ts +++ b/Valens-AIO/types/models/eft/common/tables/IBotBase.d.ts @@ -1,5 +1,6 @@ import { HideoutAreas } from "../../../enums/HideoutAreas"; import { MemberCategory } from "../../../enums/MemberCategory"; +import { QuestStatus } from "../../../enums/QuestStatus"; import { IRagfairOffer } from "../../ragfair/IRagfairOffer"; import { Item, Upd } from "./IItem"; import { IPmcDataRepeatableQuest } from "./IRepeatableQuests"; @@ -293,7 +294,9 @@ export interface HideoutArea { lastRecipe: string; } export interface HideoutSlot { - item: HideoutItem[]; + /** SPT specific value to keep track of what index this slot is (0,1,2,3 etc) */ + locationIndex: number; + item?: HideoutItem[]; } export interface HideoutItem { _id: string; @@ -318,13 +321,11 @@ export declare enum SurvivorClass { export interface Quest { qid: string; startTime: number; - status: string; - statusTimers?: StatusTimer; + status: QuestStatus; + statusTimers?: Record; + /** SPT specific property */ completedConditions?: string[]; } -export interface StatusTimer { - AvailableForStart?: number; -} export interface TraderInfo { loyaltyLevel: number; salesSum: number; diff --git a/Valens-AIO/types/models/eft/profile/IAkiProfile.d.ts b/Valens-AIO/types/models/eft/profile/IAkiProfile.d.ts index 3e0b319..eaa66c1 100644 --- a/Valens-AIO/types/models/eft/profile/IAkiProfile.d.ts +++ b/Valens-AIO/types/models/eft/profile/IAkiProfile.d.ts @@ -49,16 +49,16 @@ export interface Message { uid: string; type: MessageType; dt: number; - localDateTime: number; UtcDateTime?: number; Member?: IUpdatableChatMember; templateId: string; text?: string; hasRewards: boolean; rewardCollected: boolean; - items: Items; + items: MessageItems; maxStorageTime?: number; systemData?: ISystemData; + profileChangeEvents?: any[]; } export interface MessagePreview { uid: string; @@ -67,7 +67,7 @@ export interface MessagePreview { templateId: string; text?: string; } -export interface Items { +export interface MessageItems { stash?: string; data?: Item[]; } @@ -153,15 +153,11 @@ export interface MessageContent { templateId: string; type: MessageType; maxStorageTime?: number; - systemData?: MessageContentData; + profileChangeEvents?: any[]; + systemData?: ISystemData; } export interface MessageContentRagfair { offerId: string; count: number; handbookId: string; } -export interface MessageContentData { - date: string; - time: string; - location: string; -} diff --git a/Valens-AIO/types/models/enums/AmmoTypes.d.ts b/Valens-AIO/types/models/enums/AmmoTypes.d.ts new file mode 100644 index 0000000..b52ddcf --- /dev/null +++ b/Valens-AIO/types/models/enums/AmmoTypes.d.ts @@ -0,0 +1,208 @@ +export declare enum Grenade { + M386_HE_GRENADE = "5ede475b549eed7c6d5c18fb", + M576_MP_APERS_GRENADE = "5ede475339ee016e8c534742", + M433_HEDP_GRENADE = "5f0c892565703e5c461894e9", + M406_HE_GRENADE = "5ede4739e0350d05467f73e8", + M381_HE_GRENADE = "5ede474b0c226a66f5402622", + M441_HE_GRENADE = "5ede47405b097655935d7d16" +} +export declare enum Ammo762x51 { + M62_TRACER = "5a608bf24f39f98ffc77720e", + M80 = "58dd3ad986f77403051cba8f", + M61 = "5a6086ea4f39f99cd479502f", + BCP_FMJ = "5e023e53d4353e3302577c4c", + ULTRA_NOSLER = "5e023e88277cce2b522ff2b1", + TCW_SP = "5e023e6e34d52a55c3304f71", + M993 = "5efb0c1bd79ff02a1f5e68d9" +} +export declare enum Ammo762x54 { + SNB_GZH = "560d61e84bdc2da74d8b4571", + LPS_GZH = "5887431f2459777e1612938f", + PS_GZH = "59e77a2386f7742ee578960a", + T46M_GZH = "5e023cf8186a883be655e54f", + BT_GZH = "5e023d34e8a400319a28ed44", + BS_GZH = "5e023d48186a883be655e551" +} +export declare enum Ammo338Lapua { + TAC_X = "5fc382b6d6fa9c00c571bbc3", + UCW = "5fc382c1016cce60e8341b20", + AP = "5fc382a9d724d907e2077dab", + FMJ = "5fc275cf85fd526b824a571a" +} +export declare enum Ammo46x30 { + AP_SX = "5ba26835d4351e0035628ff5", + ACTION_SX = "5ba26812d4351e003201fef1", + FMJ_SX = "5ba2678ad4351e44f824b344", + SUBSONIC_SX = "5ba26844d4351e00334c9475" +} +export declare enum Ammo57x28 { + SS198LF = "5cc80f79e4a949033c7343b2", + R37_F = "5cc86832d7f00c000d3a6e6c", + SS190 = "5cc80f38e4a949001152b560", + R37_X = "5cc86840d7f00c002412c56c", + L191 = "5cc80f53e4a949000e1ea4f8", + SS197SR = "5cc80f8fe4a949033b0224a2", + SB193 = "5cc80f67e4a949035e43bbba" +} +export declare enum Ammo762x25 { + FMJ43 = "5735ff5c245977640e39ba7e", + LRN = "573601b42459776410737435", + P_GL = "5736026a245977644601dc61", + PST_GZH = "573603562459776430731618", + LRNPC = "573602322459776445391df1", + AKBS = "5735fdcd2459776445391d61", + PT_GZH = "573603c924597764442bd9cb" +} +export declare enum Ammo9x18 { + PM_SP8_GZH = "5737218f245977612125ba51", + P_GZH = "573719762459775a626ccbc1", + PSTM_GZH = "57371aab2459775a77142f22", + RG028_GZH = "573720e02459776143012541", + BZHT_GZH = "573718ba2459775a75491131", + PM_PSV = "5737207f24597760ff7b25f2", + SP7_GZH = "57372140245977611f70ee91", + PBM_GZH = "573719df2459775a626ccbc2", + PSO_GZH = "57371f8d24597761006c6a81", + PST_GZH = "5737201124597760fc4431f1", + PS_GS_PPO = "57371f2b24597761224311f1", + PRS_GS = "57371eb62459776125652ac1", + PPT_GZH = "57371e4124597760ff7b25f1", + PPE_GZH = "57371b192459775a9f58a5e0" +} +export declare enum Ammo9x19 { + PSO_GZH = "58864a4f2459770fcc257101", + PST_GZH = "56d59d3ad2720bdb418b4577", + GREEN_TRACER = "5c3df7d588a4501f290594e5", + RIP = "5c0d56a986f774449d5de529", + AP_63 = "5c925fa22e221601da359b7b", + LUGER_CCI = "5a3c16fe86f77452b62de32a", + PBP_GZH = "5efb0da7a29a85116f6ea05f", + QUAKEMAKER = "5efb0e16aeb21837e749c7ff" +} +export declare enum Ammo9x21 { + P_GZH = "5a26abfac4a28232980eabff", + PS_GZH = "5a269f97c4a282000b151807", + PE_GZH = "5a26ac06c4a282000c5a90a8", + BT_GZH = "5a26ac0ec4a28200741e1e18" +} +export declare enum Ammo357Mag { + FMJ = "62330b3ed4dc74626d570b95", + HOLLOW_POINT = "62330bfadc5883093563729b", + SOFT_POINT = "62330c40bdd19b369e1e53d1", + JACKET_HP = "62330c18744e5e31df12f516" +} +export declare enum Ammo45ACP { + MATCH_FMJ = "5e81f423763d9f754677bf2e", + HYDRA_SHOK = "5efb0fc6aeb21837e749c801", + LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3", + AP = "5efb0cabfb3e451d70735af5", + RIP = "5ea2a8e200685063ec28c05a" +} +export declare enum Ammo545x39 { + PS_GS = "56dff3afd2720bba668b4567", + SP = "56dff421d2720b5f5a8b4567", + PPBS_GS_IGOLNIK = "5c0d5e4486f77478390952fe", + BS_7N40 = "61962b617c6c7b169525f168", + PRS_GS = "56dff338d2720bbd668b4569", + BT_GS = "56dff061d2720bb5668b4567", + US_GS = "56dff4ecd2720b5f5a8b4568", + BP_GS = "56dfef82d2720bbd668b4567", + HP = "56dff216d2720bbd668b4568", + BS_GS = "56dff026d2720bb8668b4567", + T_GS = "56dff4a2d2720bbd668b456a", + PP_GS = "56dff2ced2720bb4668b4567", + FMJ = "56dff0bed2720bb0668b4567" +} +export declare enum Ammo556x45 { + M856 = "59e68f6f86f7746c9f75e846", + MK255_MOD_0_RRLP = "59e6918f86f7746c9f75e849", + M995 = "59e690b686f7746c9f75e848", + M855A1 = "54527ac44bdc2d36668b4567", + M856A1 = "59e6906286f7746c9f75e847", + M855 = "54527a984bdc2d4e668b4567", + HP = "59e6927d86f77411da468256", + FMJ = "59e6920f86f77411d82aa167", + WARMAGEDDON = "5c0d5ae286f7741e46554302", + MK_318_MOD_0_SOST = "60194943740c5d77f6705eea", + SSA_AP = "601949593ae8f707c4608daa" +} +export declare enum Ammo300Blackout { + M62_TRACER = "619636be6db0f2477964e710", + BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", + AP = "5fd20ff893a8961fc660a954", + V_MAX = "6196364158ef8c428c287d9f", + WHISPER = "6196365d58ef8c428c287da1" +} +export declare enum Ammo762x39 { + PS_GZH = "5656d7c34bdc2d9d198b4587", + HP = "59e4d3d286f774176a36250a", + US_GZH = "59e4d24686f7741776641ac7", + T45M1_GZH = "59e4cf5286f7741778269d8a", + BP_GZH = "59e0d99486f7744a32234762", + MAI_AP = "601aa3d2b2bcb34913271e6d" +} +export declare enum Ammo9x39 { + SP5_GS = "57a0dfb82459774d3078b56c", + BP_GS = "5c0d688c86f77413ae3407b2", + SP6_GS = "57a0e5022459774d1673f889", + SPP_GS = "5c0d668f86f7747ccb7f13b2", + PAB9_GS = "61962d879bb3d20b0946d385" +} +export declare enum Ammo366TKM { + FMJ = "59e6542b86f77411dc52a77a", + GEKSA = "59e6658b86f77411d949b250", + EKO = "59e655cb86f77411dc52a77b", + APM = "5f0596629e22f464da6bbdd9" +} +export declare enum Ammo127x55 { + PS12 = "5cadf6ddae9215051e1c23b2", + PS12B = "5cadf6eeae921500134b2799", + PS12A = "5cadf6e5ae921500113bb973" +} +export declare enum Ammo12Gauge { + BUCKSHOT_7MM = "560d5e524bdc2d25448b4571", + MAGNUM_85MM = "5d6e6806a4b936088465b17e", + RIP = "5c0d591486f7744c505b416f", + BMG_SLUG_50CAL = "5d6e68c4a4b9361b93413f79", + BUCKSHOT_525MM = "5d6e6772a4b936088465b17c", + EXPRESS_65MM = "5d6e67fba4b9361bc73bc779", + FLECHETTE = "5d6e6911a4b9361bd5780d52", + FTX_CUSTOM_LITE_SLUG = "5d6e68e6a4b9361c140bcfe0", + AP20_ARMOR_PIERCING_SLUG = "5d6e68a8a4b9360b6c0d54e2", + DUAL_SABOT_SLUG = "5d6e68dea4b9361bcc29e659", + POLEVA_6U_SLUG = "5d6e689ca4b9361bc8618956", + POLEVA_3_SLUG = "5d6e6891a4b9361bd473feea", + GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", + SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", + COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", + LEAD_SLUG = "58820d1224597753c90aeb13" +} +export declare enum Ammo20Gauge { + BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", + STAR_SLUG = "5d6e6a05a4b93618084f58d0", + BUCKSHOT_73MM = "5d6e69c7a4b9360b6c0d54e4", + DEVASTATOR_SLUG = "5d6e6a5fa4b93614ec501745", + BUCKSHOT_56MM = "5d6e695fa4b936359b35d852", + POLEVA_6U_SLUG = "5d6e6a42a4b9364f07165f52", + POLEVA_3_SLUG = "5d6e6a53a4b9361bd473feec", + BUCKSHOT_62MM = "5d6e69b9a4b9361bc8618958" +} +export declare enum Ammo23x75 { + SHRAPNEL10_BUCKSHOT = "5e85a9a6eacf8c039e4e2ac1", + SHRAPNEL25_BUCKSHOT = "5f647f31b6238e5dd066e196", + ZVEZDA_FLASHBANG = "5e85a9f4add9fe03027d9bf1", + BARRIKADA_SLUG = "5e85aa1a988a8701445df1f5" +} +export declare enum Ammo30x29 { + VOG_30 = "5d70e500a4b9364de70d38ce" +} +export declare enum Ammo127x108 { + B32 = "5cde8864d7f00c0010373be1", + BZT_44M = "5d2f2ab648f03550091993ca" +} +export declare enum Ammo26x75 { + GREEN_FLARE = "62389aaba63f32501b1b444f", + RED_FLARE = "62389ba9a63f32501b1b4451", + WHITE_FLARE = "62389bc9423ed1685422dc57", + YELLOW_FLARE = "62389be94d5d474bf712e709" +} diff --git a/Valens-AIO/types/models/enums/ContainerTypes.d.ts b/Valens-AIO/types/models/enums/ContainerTypes.d.ts new file mode 100644 index 0000000..e6b330a --- /dev/null +++ b/Valens-AIO/types/models/enums/ContainerTypes.d.ts @@ -0,0 +1,29 @@ +export declare enum CommonContainers { + AMMO_CASE = "5aafbde786f774389d0cbc0f", + DOCUMENTS_CASE = "590c60fc86f77412b13fddcf", + DOGTAG_CASE = "5c093e3486f77430cb02e593", + GRENADE_CASE = "5e2af55f86f7746d4159f07c", + INJECTOR_CASE = "619cbf7d23893217ec30b689", + ITEM_CASE = "59fb042886f7746c5005a7b2", + KEY_TOOL = "59fafd4b86f7745ca07e1232", + KEYCARD_HOLDER = "619cbf9e0a7c3a1a2731940a", + SCAV_JUNKBOX = "5b7c710788a4506dec015957", + MAGAZINE_CASE = "5c127c4486f7745625356c13", + MEDICINE_CASE = "5aafbcd986f7745e590fff23", + MONEY_CASE = "59fb016586f7746d0d4b423a", + HOLODILNICK_THERMAL_BAG = "5c093db286f7740a1b2617e3", + PISTOL_CASE = "567143bf4bdc2d1a0f8b4567", + SICC_ORGANIZATIONAL_POUCH = "5d235bb686f77443f4331278", + SIMPLE_WALLET = "5783c43d2459774bbe137486", + THICC_ITEM_CASE = "5c0a840b86f7742ffa4f2482", + THICC_WEAPON_CASE = "5b6d9ce188a4501afc1b2b25", + WEAPON_CASE = "59fb023c86f7746d0d4b423c", + WZ_WALLET = "60b0f6c058e0b0481a09ad11" +} +export declare enum SecuredContainers { + ALPHA = "544a11ac4bdc2d470e8b456a", + BETA = "5857a8b324597729ab0a0e7d", + EPSILON = "59db794186f77448bc595262", + GAMMA = "5857a8bc2459772bad15db29", + KAPPA = "5c093ca986f7740a1867ab12" +} diff --git a/Valens-AIO/types/models/enums/QuestStatus.d.ts b/Valens-AIO/types/models/enums/QuestStatus.d.ts index 6335c73..ba65933 100644 --- a/Valens-AIO/types/models/enums/QuestStatus.d.ts +++ b/Valens-AIO/types/models/enums/QuestStatus.d.ts @@ -6,5 +6,6 @@ export declare enum QuestStatus { Success = 4, Fail = 5, FailRestartable = 6, - MarkedAsFailed = 7 + MarkedAsFailed = 7, + Expired = 8 } diff --git a/Valens-AIO/types/models/enums/SkillTypes.d.ts b/Valens-AIO/types/models/enums/SkillTypes.d.ts new file mode 100644 index 0000000..4eb90af --- /dev/null +++ b/Valens-AIO/types/models/enums/SkillTypes.d.ts @@ -0,0 +1,52 @@ +export declare enum SkillTypes { + HIDEOUT_MANAGEMENT = "HideoutManagement", + CRAFTING = "Crafting", + METABOLISM = "Metabolism", + IMMUNITY = "Immunity", + ENDURANCE = "Endurance", + STRENGTH = "Strength", + VITALITY = "Vitality", + HEALTH = "Health", + STRESS_RESISTANCE = "StressResistance", + THROWING = "Throwing", + RECOIL_CONTROL = "RecoilControl", + COVERT_MOVEMENT = "CovertMovement", + FIELD_MEDICINE = "FieldMedicine", + SEARCH = "Search", + SNIPING = "Sniping", + PERCEPTION = "Perception", + INTELLECT = "Intellect", + ATTENTION = "Attention", + CHARISMA = "Charisma", + MEMORY = "Memory", + SURGERY = "Surgery", + AIM_DRILLS = "AimDrills", + TROUBLESHOOTING = "TroubleShooting", + PRONE_MOVEMENT = "ProneMovement", + FIRST_AID = "FirstAid", + LIGHT_VESTS = "LightVests", + HEAVY_VESTS = "HeavyVests", + WEAPON_MODDING = "WeaponModding", + ADVANCED_MODDING = "AdvancedModding", + NIGHT_OPS = "NightOps", + SILENT_OPS = "SilentOps", + LOCKPICKING = "Lockpicking", + WEAPON_TREATMENT = "WeaponTreatment", + MAG_DRILLS = "MagDrills", + FREE_TRADING = "Freetrading", + AUCTIONS = "Auctions", + CLEAN_OPS = "Cleanoperations", + BARTER = "Barter", + SHADOW_CONNECTIONS = "Shadowconnections", + TASK_PERFORMANCE = "Taskperformance", + BEAR_ASSAULT_OPS = "BearAssaultoperations", + BEAR_AUTHORITY = "BearAuthority", + BEAR_AK_SYSTEMS = "BearAksystems", + BEAR_HEAVY_CAL = "BearHeavycaliber", + BEAR_RAW_POWER = "BearRawpower", + USEC_AR_SYSTEMS = "UsecArsystems", + USEC_DEEP_WEAPON_MOD = "UsecDeepweaponmodding_Settings", + USEC_LONG_RANGE_OPTICS = "UsecLongrangeoptics_Settings", + USEC_NEGOTIATIONS = "UsecNegotiations", + USEC_TACTICS = "UsecTactics" +} diff --git a/Valens-AIO/types/models/enums/WeaponSkillTypes.d.ts b/Valens-AIO/types/models/enums/WeaponSkillTypes.d.ts new file mode 100644 index 0000000..1e20a2d --- /dev/null +++ b/Valens-AIO/types/models/enums/WeaponSkillTypes.d.ts @@ -0,0 +1,14 @@ +export declare enum WeaponSkillTypes { + PISTOL = "Pistol", + REVOLVER = "Revolver", + SMG = "SMG", + ASSAULT = "Assault", + SHOTGUN = "Shotgun", + SNIPER = "Sniper", + LMG = "LMG", + HMG = "HMG", + DMR = "DMR", + LAUNCHER = "Launcher", + ATTACHED_LAUNCHER = "AttachedLauncher", + MELEE = "Melee" +} diff --git a/Valens-AIO/types/models/spt/bots/GenerateWeaponResult.d.ts b/Valens-AIO/types/models/spt/bots/GenerateWeaponResult.d.ts new file mode 100644 index 0000000..f099752 --- /dev/null +++ b/Valens-AIO/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -0,0 +1,9 @@ +import { Mods } from "../../eft/common/tables/IBotType"; +import { Item } from "../../eft/common/tables/IItem"; +import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"; +export declare class GenerateWeaponResult { + weapon: Item[]; + chosenAmmo: string; + weaponMods: Mods; + weaponTemplate: ITemplateItem; +} diff --git a/Valens-AIO/types/models/spt/config/IBotConfig.d.ts b/Valens-AIO/types/models/spt/config/IBotConfig.d.ts index 82f77b4..e171087 100644 --- a/Valens-AIO/types/models/spt/config/IBotConfig.d.ts +++ b/Valens-AIO/types/models/spt/config/IBotConfig.d.ts @@ -9,6 +9,7 @@ export interface IBotConfig extends IBaseConfig { revenge: Record; pmc: PmcConfig; itemSpawnLimits: Record>; + equipment: Record; showTypeInNickname: boolean; maxBotCap: number; secureContainerAmmoStackCount: number; @@ -94,8 +95,9 @@ export interface LootNvalue { } export interface PmcConfig { dynamicLoot: PmcDynamicLoot; - cartridgeBlacklist: string[]; difficulty: string; + looseWeaponInBackpackChancePercent: number; + looseWeaponInBackpackLootMinMax: MinMax; isUsec: number; chanceSameSideIsHostilePercent: number; usecType: string; @@ -103,7 +105,7 @@ export interface PmcConfig { maxBackpackLootTotalRub: number; maxPocketLootTotalRub: number; maxVestLootTotalRub: number; - convertFromChances: Record; + convertIntoPmcChance: Record; enemyTypes: string[]; } export interface PmcDynamicLoot { @@ -111,3 +113,12 @@ export interface PmcDynamicLoot { blacklist: string[]; moneyStackLimits: Record; } +export interface Equipment { + blacklist: EquipmentFilterDetails[]; + whitelist: EquipmentFilterDetails[]; +} +export interface EquipmentFilterDetails { + levelRange: MinMax; + equipment: Record; + cartridge: Record; +} diff --git a/Valens-AIO/types/models/spt/config/IHideoutConfig.d.ts b/Valens-AIO/types/models/spt/config/IHideoutConfig.d.ts index cf17871..36d6246 100644 --- a/Valens-AIO/types/models/spt/config/IHideoutConfig.d.ts +++ b/Valens-AIO/types/models/spt/config/IHideoutConfig.d.ts @@ -3,4 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; fuelDrainRateMultipler: number; + hoursForSkillCrafting: number; } diff --git a/Valens-AIO/types/models/spt/config/IInsuranceConfig.d.ts b/Valens-AIO/types/models/spt/config/IInsuranceConfig.d.ts index 6e9c744..b27e753 100644 --- a/Valens-AIO/types/models/spt/config/IInsuranceConfig.d.ts +++ b/Valens-AIO/types/models/spt/config/IInsuranceConfig.d.ts @@ -3,5 +3,7 @@ export interface IInsuranceConfig extends IBaseConfig { kind: "aki-insurance"; insuranceMultiplier: Record; returnChancePercent: Record; + blacklistedEquipment: string[]; + slotIdsWithChanceOfNotReturning: string[]; runIntervalSeconds: number; } diff --git a/Valens-AIO/types/models/spt/config/IRepairConfig.d.ts b/Valens-AIO/types/models/spt/config/IRepairConfig.d.ts index 4966eb5..23e6838 100644 --- a/Valens-AIO/types/models/spt/config/IRepairConfig.d.ts +++ b/Valens-AIO/types/models/spt/config/IRepairConfig.d.ts @@ -2,4 +2,6 @@ import { IBaseConfig } from "./IBaseConfig"; export interface IRepairConfig extends IBaseConfig { kind: "aki-repair"; priceMultiplier: number; + applyRandomizeDurabilityLoss: boolean; + weaponSkillRepairGain: number; } diff --git a/Valens-AIO/types/models/spt/mod/NewItemDetails.d.ts b/Valens-AIO/types/models/spt/mod/NewItemDetails.d.ts new file mode 100644 index 0000000..fc69a06 --- /dev/null +++ b/Valens-AIO/types/models/spt/mod/NewItemDetails.d.ts @@ -0,0 +1,39 @@ +import { ITemplateItem, Props } from "../../eft/common/tables/ITemplateItem"; +export declare abstract class NewItemDetailsBase { + /** Price of the item on flea market */ + fleaPriceRoubles: number; + /** Price of the item in the handbook */ + handbookPriceRoubles: number; + /** + * A dictionary for locale settings, key = langauge (e.g. en,cn,es-mx,jp,fr) + * If a language is not included, the first item in the array will be used in its place + */ + locales: Record; +} +export declare class NewItemFromCloneDetails extends NewItemDetailsBase { + /** Id of the item to copy and use as a base */ + itemTplToClone: string; + /** Item properties that should be applied over the top of the cloned base */ + overrideProperties: Props; + /** ParentId for the new item (item type) */ + parentId: string; + /** + * the id the new item should have, leave blank to have one generated for you + * This is often known as the TplId, or TemplateId + */ + newId: string; +} +export declare class NewItemDetails extends NewItemDetailsBase { + newItem: ITemplateItem; +} +export declare class LocaleDetails { + name: string; + shortName: string; + description: string; +} +export declare class CreateItemResult { + constructor(); + success: boolean; + itemId: string; + errors: string[]; +} diff --git a/Valens-AIO/types/services/BotEquipmentFilterService.d.ts b/Valens-AIO/types/services/BotEquipmentFilterService.d.ts new file mode 100644 index 0000000..e49645b --- /dev/null +++ b/Valens-AIO/types/services/BotEquipmentFilterService.d.ts @@ -0,0 +1,50 @@ +import { IBotType } from "../models/eft/common/tables/IBotType"; +import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; +import { ILogger } from "../models/spt/utils/ILogger"; +import { ConfigServer } from "../servers/ConfigServer"; +export declare class BotEquipmentFilterService { + protected logger: ILogger; + protected configServer: ConfigServer; + protected botConfig: IBotConfig; + protected botEquipmentFilterlists: Record; + constructor(logger: ILogger, configServer: ConfigServer); + /** + * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param baseBotNode bots json data to filter + * @param playerLevel Level of the currently playing player + * @param isPmc Is the bot we're filtering a PMC + * @param role Role of the bot we're filtering + */ + filterBotEquipment(baseBotNode: IBotType, playerLevel: number, isPmc: boolean, role: string): void; + /** + * Get an object that contains equipment and cartridge blacklists for a specified bot type + * @param botRole Role of the bot we want the blacklist for + * @param playerLevel Level of the player + * @returns EquipmentBlacklistDetails object + */ + protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Get the whitelist for a specific bot type that's within the players level + * @param botRole Bot type + * @param playerLevel Players level + * @returns EquipmentFilterDetails object + */ + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; + /** + * Filter bot equipment based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored + * @param baseBotNode bot .json file to update + * @param blacklist equipment blacklist + * @returns Filtered bot file + */ + protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; + /** + * Filter bot cartridges based on blacklist and whitelist from config/bot.json + * Prioritises whitelist first, if one is found blacklist is ignored + * @param baseBotNode bot .json file to update + * @param blacklist equipment on this list should be excluded from the bot + * @param whitelist equipment on this list should be used exclusivly + * @returns Filtered bot file + */ + protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; +} diff --git a/Valens-AIO/types/services/InsuranceService.d.ts b/Valens-AIO/types/services/InsuranceService.d.ts index 0219816..171bf10 100644 --- a/Valens-AIO/types/services/InsuranceService.d.ts +++ b/Valens-AIO/types/services/InsuranceService.d.ts @@ -22,7 +22,6 @@ export declare class InsuranceService { protected dialogueHelper: DialogueHelper; protected configServer: ConfigServer; protected insured: Record>; - protected templatesById: {}; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer); insuranceExists(sessionId: string): boolean; @@ -32,9 +31,19 @@ export declare class InsuranceService { resetInsurance(sessionId: string): void; resetInsuranceTraderArray(sessionId: string, traderId: string): void; addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void; - getItemPrice(_tpl: string): number; - generateTemplatesById(): void; - sendInsuredItems(pmcData: IPmcData, sessionID: string): void; + /** + * Get the rouble price for an item by templateId + * @param itemTpl item tpl to get handbook price for + * @returns handbook price in roubles, Return 0 if not found + */ + getItemPrice(itemTpl: string): number; + /** + * Sends stored insured items as message to player + * @param pmcData profile to modify + * @param sessionID SessionId of current player + * @param mapId Id of the map player died/exited that caused the insurance to be issued on + */ + sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; storeLostGear(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string): void; storeInsuredItemsForReturn(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string): void; protected addGearToSend(pmcData: IPmcData, insuredItem: any, actualItem: any, sessionID: string): any; diff --git a/Valens-AIO/types/services/ProfileFixerService.d.ts b/Valens-AIO/types/services/ProfileFixerService.d.ts index 313a907..ed1dec7 100644 --- a/Valens-AIO/types/services/ProfileFixerService.d.ts +++ b/Valens-AIO/types/services/ProfileFixerService.d.ts @@ -1,6 +1,8 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { HideoutSlot } from "../models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { HideoutAreas } from "../models/enums/HideoutAreas"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { Watermark } from "../utils/Watermark"; @@ -29,8 +31,27 @@ export declare class ProfileFixerService { protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; protected addMissingBonusesProperty(pmcProfile: IPmcData): void; + /** + * Adjust profile quest status and statusTimers object values + * quest.status is numeric e.g. 2 + * quest.statusTimers keys are numeric as strings e.g. "2" + * @param pmcProfile profile to update + */ + protected updateProfileQuestDataValues(pmcProfile: IPmcData): void; protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void; + /** + * A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed + * @param pmcProfile Profile to find and remove slots from + */ + protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void; + /** + * add in objects equal to the number of slots + * @param areaType area to check + * @param pmcProfile profile to update + */ + protected addEmptyObjectsToHideoutAreaSlots(areaType: HideoutAreas, emptyItemCount: number, pmcProfile: IPmcData): void; + protected addObjectsToArray(count: number, slots: HideoutSlot[]): HideoutSlot[]; /** * In 18876 bsg changed the pockets tplid to be one that has 3 additional special slots * @param pmcProfile diff --git a/Valens-AIO/types/services/mod/CustomItemService.d.ts b/Valens-AIO/types/services/mod/CustomItemService.d.ts new file mode 100644 index 0000000..87bda40 --- /dev/null +++ b/Valens-AIO/types/services/mod/CustomItemService.d.ts @@ -0,0 +1,80 @@ +import { ITemplateItem, Props } from "../../models/eft/common/tables/ITemplateItem"; +import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "../../models/spt/mod/NewItemDetails"; +import { IDatabaseTables } from "../../models/spt/server/IDatabaseTables"; +import { ILogger } from "../../models/spt/utils/ILogger"; +import { DatabaseServer } from "../../servers/DatabaseServer"; +import { HashUtil } from "../../utils/HashUtil"; +import { JsonUtil } from "../../utils/JsonUtil"; +export declare class CustomItemService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected databaseServer: DatabaseServer; + protected tables: IDatabaseTables; + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); + /** + * Create a new item from a cloned item base + * WARNING - If no item id is supplied, an id will be generated, this id will be random every time you add an item and will not be the same on each subsequent server start + * Add to the items db + * Add to the flea market + * Add to the handbook + * Add to the locales + * @param newItemDetails Item details for the new item to be created + * @returns tplId of the new item created + */ + createItemFromClone(newItemDetails: NewItemFromCloneDetails): CreateItemResult; + /** + * Create a new item without using an existing item as a template + * Add to the items db + * Add to the flea market + * Add to the handbook + * Add to the locales + * @param newItemDetails Details on what the item to be created + * @returns CreateItemResult containing the completed items Id + */ + createItem(newItemDetails: NewItemDetails): CreateItemResult; + /** + * If the id provided is an empty string, return a randomly generated guid, otherwise return the newId parameter + * @param newId id supplied to code + * @returns item id + */ + protected getOrGenerateIdForItem(newId: string): string; + /** + * Iterates through supplied properties and updates the cloned items properties with them + * Complex objects cannot have overrides, they must be fully hydrated with values if they are to be used + * @param overrideProperties new properties to apply + * @param itemClone item to update + */ + protected updateBaseItemPropertiesWithOverrides(overrideProperties: Props, itemClone: ITemplateItem): void; + /** + * Addd a new item object to the in-memory representation of items.json + * @param newItemId id of the item to add to items.json + * @param itemToAdd Item to add against the new id + */ + protected addToItemsDb(newItemId: string, itemToAdd: ITemplateItem): void; + /** + * Add a handbook price for an item + * @param newItemId id of the item being added + * @param parentId parent id of the item being added + * @param priceRoubles price of the item being added + */ + protected addToHandbookDb(newItemId: string, parentId: string, priceRoubles: number): void; + /** + * Iterate through the passed in locale data and add to each locale in turn + * If data is not provided for each langauge eft uses, the first object will be used in its place + * e.g. + * en[0] + * fr[1] + * + * No jp provided, so english will be used as a substitute + * @param localeDetails key is language, value are the new locale details + * @param newItemId id of the item being created + */ + protected addToLocaleDbs(localeDetails: Record, newItemId: string): void; + /** + * Add a price to the in-memory representation of prices.json, used to inform the flea of an items price on the market + * @param newItemId id of the new item + * @param fleaPriceRoubles Price of the new item + */ + protected addToFleaPriceDb(newItemId: string, fleaPriceRoubles: number): void; +} diff --git a/Valens-AIO/types/utils/TimeUtil.d.ts b/Valens-AIO/types/utils/TimeUtil.d.ts index 9733be9..eed4e6d 100644 --- a/Valens-AIO/types/utils/TimeUtil.d.ts +++ b/Valens-AIO/types/utils/TimeUtil.d.ts @@ -5,4 +5,14 @@ export declare class TimeUtil { getDate(): string; getTime(): string; getTimestamp(): number; + /** + * mail in eft requires time be in a specific format + * @returns current time in format: 00:00 (hh:mm) + */ + getTimeMailFormat(): string; + /** + * Mail in eft requires date be in a specific format + * @returns current date in format: 00.00.0000 (dd.mm.yyyy) + */ + getDateMailFormat(): string; }