From 77f8e9d5a3dfb463e505e3f47f82a1c81bf086bc Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 24 Oct 2024 14:26:30 +0200 Subject: [PATCH 01/23] Remove eslint, add biome config from Fika & update package --- .buildignore | 2 - .eslintignore | 10 ----- .eslintrc.json | 98 ---------------------------------------------- biome.json | 43 ++++++++++++++++++++ mod.code-workspace | 2 +- package.json | 20 +++++----- src/mod.ts | 4 -- 7 files changed, 53 insertions(+), 126 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json create mode 100644 biome.json diff --git a/.buildignore b/.buildignore index 2cbde65..96e72a1 100644 --- a/.buildignore +++ b/.buildignore @@ -1,8 +1,6 @@ /.buildignore /.DS_Store /.editorconfig -/.eslintignore -/.eslintrc.json /.git /.github /.gitignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f7dd9e1..0000000 --- a/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -# Exclude these folders from linting -**/node_modules -/tmp -/dist -/types - -# Exclude these filetypes from linting -*.json -*.txt -*.exe diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 757b0bd..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/no-unused-vars": 1, - "@typescript-eslint/no-empty-interface": 0, - "@typescript-eslint/no-namespace": 0, - "@typescript-eslint/comma-dangle": 1, - "@typescript-eslint/func-call-spacing": 2, - "@typescript-eslint/quotes": 1, - "@typescript-eslint/brace-style": [ - "warn", - "allman" - ], - "@typescript-eslint/naming-convention": [ - "warn", - { - "selector": "default", - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - }, - { - "selector": "typeLike", - "format": [ - "PascalCase" - ] - }, - { - "selector": "objectLiteralProperty", - "format": [ - "PascalCase", - "camelCase" - ], - "leadingUnderscore": "allow" - }, - { - "selector": "typeProperty", - "format": [ - "PascalCase", - "camelCase" - ], - "leadingUnderscore": "allow" - }, - { - "selector": "enumMember", - "format": [ - "UPPER_CASE" - ] - } - ], - "@typescript-eslint/indent": [ - "warn", - 4 - ], - "@typescript-eslint/no-unused-expressions": [ - "warn", - { - "allowShortCircuit": false, - "allowTernary": false - } - ], - "@typescript-eslint/keyword-spacing": [ - "warn", - { - "before": true, - "after": true - } - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "warn", - { - "allowArgumentsExplicitlyTypedAsAny": true - } - ] - }, - "overrides": [ - { - "files": [ - "*.mjs", - "*.ts" - ], - "env": { - "node": true - } - } - ] -} diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..2e0f494 --- /dev/null +++ b/biome.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", + "organizeImports": { + "enabled": true + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 4, + "lineWidth": 320 + }, + "javascript": { + "parser": { + "unsafeParameterDecoratorsEnabled": true + } + }, + "linter": { + "enabled": true, + "rules": { + "recommended": false, + "complexity": { + "noStaticOnlyClass": "off" + }, + "correctness": { + "noUndeclaredVariables": "error", + "noUnusedVariables": "error" + }, + "performance": { + "noDelete": "warn" + }, + "style": { + "useImportType": "off", + "noNamespace": "error" + }, + "suspicious": { + "noEmptyBlockStatements": "error" + } + } + }, + "files": { + "ignore": ["**/node_modules", "dist", "types", "build.mjs", "**/package-lock.json"] + } +} \ No newline at end of file diff --git a/mod.code-workspace b/mod.code-workspace index 6732c67..f9f8863 100644 --- a/mod.code-workspace +++ b/mod.code-workspace @@ -6,7 +6,7 @@ ], "extensions": { "recommendations": [ - "dbaeumer.vscode-eslint" + "biomejs.biome" ] } } \ No newline at end of file diff --git a/package.json b/package.json index 8fbbd2b..6d057ed 100644 --- a/package.json +++ b/package.json @@ -12,21 +12,19 @@ "isBundleMod": false, "scripts": { "setup": "npm i", + "lint": "npx @biomejs/biome lint ./", + "format": "npx @biomejs/biome check --write ./", "build": "node ./build.mjs", "buildinfo": "node ./build.mjs --verbose" }, "devDependencies": { - "@types/node": "20.11", - "@typescript-eslint/eslint-plugin": "7.2", - "@typescript-eslint/parser": "7.2", - "archiver": "^6.0", - "eslint": "8.57", - "fs-extra": "11.2", + "@types/node": "~20.11", + "@biomejs/biome": "1.8.3", + "fs-extra": "~11.2", "ignore": "^5.2", - "os": "^0.1", - "tsyringe": "4.8.0", - "typescript": "5.4", - "winston": "3.12", - "json5": "2.2.3" + "tsyringe": "~4.8", + "typescript": "~5.4", + "winston": "~3.13", + "json5": "~2.2" } } diff --git a/src/mod.ts b/src/mod.ts index 215333b..ef81292 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,7 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -/* eslint-disable @typescript-eslint/indent */ -/* eslint-disable no-constant-condition */ -/* eslint-disable prefer-spread */ import JSON5 from "json5"; import path from "path"; import { DependencyContainer } from "tsyringe"; From fd5eefdc6c62246ea4f70be4d712995a2c1a1a88 Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 24 Oct 2024 14:34:11 +0200 Subject: [PATCH 02/23] Formatting fixes --- src/ILotsofLootConfig.ts | 2 +- src/LotsofLootHelper.ts | 74 ++-- src/LotsofLootLogger.ts | 28 +- src/MarkedRoom.ts | 105 +++--- src/mod.ts | 708 ++++++++++++++++----------------------- 5 files changed, 369 insertions(+), 548 deletions(-) diff --git a/src/ILotsofLootConfig.ts b/src/ILotsofLootConfig.ts index 8e5e0b5..66d97ba 100644 --- a/src/ILotsofLootConfig.ts +++ b/src/ILotsofLootConfig.ts @@ -25,4 +25,4 @@ export interface MarkedRoomConfig { multiplier: Record; extraItems: Record; itemGroups: Record; -} \ No newline at end of file +} diff --git a/src/LotsofLootHelper.ts b/src/LotsofLootHelper.ts index 502f129..aa6ff9c 100644 --- a/src/LotsofLootHelper.ts +++ b/src/LotsofLootHelper.ts @@ -1,58 +1,50 @@ +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { ILocation } from "@spt/models/eft/common/ILocation"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { ILotsofLootConfig } from "./ILotsofLootConfig"; import { LotsofLootLogger } from "./LotsofLootLogger"; -import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { ILocation } from "@spt/models/eft/common/ILocation"; - -export class LotsofLootHelper -{ - constructor(private config: ILotsofLootConfig, private databaseServer: DatabaseServer, private itemHelper: ItemHelper, private logger: LotsofLootLogger) - { - } +export class LotsofLootHelper { + constructor( + private config: ILotsofLootConfig, + private databaseServer: DatabaseServer, + private itemHelper: ItemHelper, + private logger: LotsofLootLogger, + ) {} //This function is heavily based off of SVM's 'RemoveBackpacksRestrictions' //Huge credit to GhostFenixx for this - public removeBackpackRestrictions() : void - { + public removeBackpackRestrictions(): void { const items = this.databaseServer.getTables().templates.items; - for (let key in items) - { + for (let key in items) { let value = items[key]; - if(value._parent == "5448e53e4bdc2d60728b4567" && value._props.Grids[0]._props.filters !== undefined) - { + if (value._parent == "5448e53e4bdc2d60728b4567" && value._props.Grids[0]._props.filters !== undefined) { value._props.Grids[0]._props.filters = []; } } } - public changeRelativeProbabilityInPool(itemtpl: string, mult: number) : void - { + public changeRelativeProbabilityInPool(itemtpl: string, mult: number): void { const locations = this.databaseServer.getTables().locations; - for (const locationId in locations) - { - if(locations.hasOwnProperty(locationId)) - { + for (const locationId in locations) { + if (locations.hasOwnProperty(locationId)) { const location: ILocation = locations[locationId]; - if(!location.looseLoot) - { + if (!location.looseLoot) { this.logger.logDebug(`Skipping ${locationId} as it has no loose loot!`); continue; } - location.looseLoot.spawnpoints.forEach(spawnpoint => { - const item = spawnpoint.template.Items.find(i => i._tpl == itemtpl); + location.looseLoot.spawnpoints.forEach((spawnpoint) => { + const item = spawnpoint.template.Items.find((i) => i._tpl == itemtpl); - if(item) - { - const itemDistribution = spawnpoint.itemDistribution.find(i => i.composedKey.key == item._id); + if (item) { + const itemDistribution = spawnpoint.itemDistribution.find((i) => i.composedKey.key == item._id); - if(itemDistribution) - { + if (itemDistribution) { itemDistribution.relativeProbability *= mult; this.logger.logDebug(`${locationId}, ${spawnpoint.template.Id}, ${item._tpl}, ${itemDistribution.relativeProbability}`); @@ -63,32 +55,26 @@ export class LotsofLootHelper } } - public changeProbabilityOfPool(itemtpl: string, mult: number) : void - { + public changeProbabilityOfPool(itemtpl: string, mult: number): void { const locations = this.databaseServer.getTables().locations; - for (const locationId in locations) - { - if(locations.hasOwnProperty(locationId)) - { + for (const locationId in locations) { + if (locations.hasOwnProperty(locationId)) { const location: ILocation = locations[locationId]; - if(!location.looseLoot) - { + if (!location.looseLoot) { this.logger.logDebug(`Skipping ${locationId} as it has no loose loot!`); continue; } - location.looseLoot.spawnpoints.forEach(spawnpoint => { - const item = spawnpoint.template.Items.find(i => i._tpl == itemtpl); + location.looseLoot.spawnpoints.forEach((spawnpoint) => { + const item = spawnpoint.template.Items.find((i) => i._tpl == itemtpl); - if(item) - { + if (item) { spawnpoint.probability *= mult; //Clamp probability back down to 1 - if (spawnpoint.probability > 1) - { + if (spawnpoint.probability > 1) { spawnpoint.probability = 1; } @@ -98,4 +84,4 @@ export class LotsofLootHelper } } } -} \ No newline at end of file +} diff --git a/src/LotsofLootLogger.ts b/src/LotsofLootLogger.ts index 0156c77..b2ccb45 100644 --- a/src/LotsofLootLogger.ts +++ b/src/LotsofLootLogger.ts @@ -1,35 +1,29 @@ import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -export class LotsofLootLogger -{ - constructor(private logger: ILogger, private debugEnabled :boolean) - { - - } +export class LotsofLootLogger { + constructor( + private logger: ILogger, + private debugEnabled: boolean, + ) {} private loggerPrefix = "[Lots of Loot] "; - public logInfo(log : string) : void - { + public logInfo(log: string): void { this.logger.info(this.loggerPrefix + log); } - public logWarning(log: string) : void - { + public logWarning(log: string): void { this.logger.warning(this.loggerPrefix + log); } - public logError(log : string) : void - { + public logError(log: string): void { this.logger.error(this.loggerPrefix + log); } - public logDebug(log: string) : void - { - if (this.debugEnabled) - { + public logDebug(log: string): void { + if (this.debugEnabled) { this.logger.logWithColor(this.loggerPrefix + log, LogTextColor.YELLOW); } } -} \ No newline at end of file +} diff --git a/src/MarkedRoom.ts b/src/MarkedRoom.ts index 3a47567..f34f3ba 100644 --- a/src/MarkedRoom.ts +++ b/src/MarkedRoom.ts @@ -1,29 +1,28 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { Spawnpoint } from "@spt/models/eft/common/ILooseLoot"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { HashUtil } from "@spt/utils/HashUtil"; -import { LotsofLootLogger } from "./LotsofLootLogger"; import { MarkedRoomConfig } from "./ILotsofLootConfig"; +import { LotsofLootLogger } from "./LotsofLootLogger"; -export class MarkedRoom -{ - constructor(private markedRoomConfig: MarkedRoomConfig, private databaseServer: DatabaseServer, private itemHelper: ItemHelper, private hashUtil: HashUtil, private logger: LotsofLootLogger) - { - - } +export class MarkedRoom { + constructor( + private markedRoomConfig: MarkedRoomConfig, + private databaseServer: DatabaseServer, + private itemHelper: ItemHelper, + private hashUtil: HashUtil, + private logger: LotsofLootLogger, + ) {} - public doMarkedRoomChanges() : void - { + public doMarkedRoomChanges(): void { const spawnPointscustoms = this.databaseServer.getTables().locations.bigmap.looseLoot.spawnpoints; const spawnPointsreserve = this.databaseServer.getTables().locations.rezervbase.looseLoot.spawnpoints; const spawnPointsstreets = this.databaseServer.getTables().locations.tarkovstreets.looseLoot.spawnpoints; const spawnPointsLighthouse = this.databaseServer.getTables().locations.lighthouse.looseLoot.spawnpoints; - - for (const spawnpoint of spawnPointscustoms) - { + + for (const spawnpoint of spawnPointscustoms) { //Dorms 314 Marked Room - if ((spawnpoint.template.Position.x > 180) && (spawnpoint.template.Position.x < 185) && (spawnpoint.template.Position.z > 180) && (spawnpoint.template.Position.z < 185) && (spawnpoint.template.Position.y > 6) && (spawnpoint.template.Position.y < 7)) - { + if (spawnpoint.template.Position.x > 180 && spawnpoint.template.Position.x < 185 && spawnpoint.template.Position.z > 180 && spawnpoint.template.Position.z < 185 && spawnpoint.template.Position.y > 6 && spawnpoint.template.Position.y < 7) { this.logger.logDebug(`Marked room (Customs) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.customs; this.markedAddExtraItems(spawnpoint); @@ -31,25 +30,18 @@ export class MarkedRoom } } - for (const spawnpoint of spawnPointsreserve) - { - if ((spawnpoint.template.Position.x > -125) && (spawnpoint.template.Position.x < -120) && (spawnpoint.template.Position.z > 25) && (spawnpoint.template.Position.z < 30) && (spawnpoint.template.Position.y > -15) && (spawnpoint.template.Position.y < -14)) - { + for (const spawnpoint of spawnPointsreserve) { + if (spawnpoint.template.Position.x > -125 && spawnpoint.template.Position.x < -120 && spawnpoint.template.Position.z > 25 && spawnpoint.template.Position.z < 30 && spawnpoint.template.Position.y > -15 && spawnpoint.template.Position.y < -14) { this.logger.logDebug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); - - } - else if ((spawnpoint.template.Position.x > -155) && (spawnpoint.template.Position.x < -150) && (spawnpoint.template.Position.z > 70) && (spawnpoint.template.Position.z < 75) && (spawnpoint.template.Position.y > -9) && (spawnpoint.template.Position.y < -8)) - { + } else if (spawnpoint.template.Position.x > -155 && spawnpoint.template.Position.x < -150 && spawnpoint.template.Position.z > 70 && spawnpoint.template.Position.z < 75 && spawnpoint.template.Position.y > -9 && spawnpoint.template.Position.y < -8) { this.logger.logDebug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); - } - else if ((spawnpoint.template.Position.x > 190) && (spawnpoint.template.Position.x < 195) && (spawnpoint.template.Position.z > -230) && (spawnpoint.template.Position.z < -225) && (spawnpoint.template.Position.y > -6) && (spawnpoint.template.Position.y < -5)) - { + } else if (spawnpoint.template.Position.x > 190 && spawnpoint.template.Position.x < 195 && spawnpoint.template.Position.z > -230 && spawnpoint.template.Position.z < -225 && spawnpoint.template.Position.y > -6 && spawnpoint.template.Position.y < -5) { this.logger.logDebug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; this.markedAddExtraItems(spawnpoint); @@ -57,76 +49,61 @@ export class MarkedRoom } } - for (const spawnpoint of spawnPointsstreets) - { + for (const spawnpoint of spawnPointsstreets) { //Abandoned Factory Marked Room - if ((spawnpoint.template.Position.x > -133) && (spawnpoint.template.Position.x < -129) && (spawnpoint.template.Position.z > 265) && (spawnpoint.template.Position.z < 275) && (spawnpoint.template.Position.y > 8.5) && (spawnpoint.template.Position.y < 11)) - { + if (spawnpoint.template.Position.x > -133 && spawnpoint.template.Position.x < -129 && spawnpoint.template.Position.z > 265 && spawnpoint.template.Position.z < 275 && spawnpoint.template.Position.y > 8.5 && spawnpoint.template.Position.y < 11) { this.logger.logDebug(`Marked room (Streets) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.streets; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } //Chek 13 Marked Room - else if ((spawnpoint.template.Position.x > 186) && (spawnpoint.template.Position.x < 191) && (spawnpoint.template.Position.z > 224) && (spawnpoint.template.Position.z < 229) && (spawnpoint.template.Position.y > -0.5) && (spawnpoint.template.Position.y < 1.5)) - { + else if (spawnpoint.template.Position.x > 186 && spawnpoint.template.Position.x < 191 && spawnpoint.template.Position.z > 224 && spawnpoint.template.Position.z < 229 && spawnpoint.template.Position.y > -0.5 && spawnpoint.template.Position.y < 1.5) { this.logger.logDebug(`Marked room (Streets) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.streets; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } } - - for (const spawnpoint of spawnPointsLighthouse) - { - if ((spawnpoint.template.Position.x > 319) && (spawnpoint.template.Position.x < 330) && (spawnpoint.template.Position.z > 482) && (spawnpoint.template.Position.z < 489) && (spawnpoint.template.Position.y > 5) && (spawnpoint.template.Position.y < 6.5)) - { + + for (const spawnpoint of spawnPointsLighthouse) { + if (spawnpoint.template.Position.x > 319 && spawnpoint.template.Position.x < 330 && spawnpoint.template.Position.z > 482 && spawnpoint.template.Position.z < 489 && spawnpoint.template.Position.y > 5 && spawnpoint.template.Position.y < 6.5) { this.logger.logDebug(`Marked room (Lighthouse) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.lighthouse; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } } - } - private markedAddExtraItems(spawnpoint: Spawnpoint) : void - { - for (const item of Object.entries(this.markedRoomConfig.extraItems)) - { - if (spawnpoint.template.Items.find(x => x._tpl === item[0])) - { + private markedAddExtraItems(spawnpoint: Spawnpoint): void { + for (const item of Object.entries(this.markedRoomConfig.extraItems)) { + if (spawnpoint.template.Items.find((x) => x._tpl === item[0])) { continue; } - const id = Math.random()*10000; - + const id = Math.random() * 10000; + spawnpoint.template.Items.push({ - "_id": id.toString(), - "_tpl": item[0] - }) + _id: id.toString(), + _tpl: item[0], + }); spawnpoint.itemDistribution.push({ - "composedKey":{"key":id.toString()}, - "relativeProbability": item[1] + composedKey: { key: id.toString() }, + relativeProbability: item[1], }); this.logger.logDebug(`Added ${item[0]} to ${spawnpoint.template.Id}`); } } - private markedItemGroups(spawnpoint: Spawnpoint) : void - { - for (const item of spawnpoint.template.Items) - { - for (const group in this.markedRoomConfig.itemGroups) - { - if (this.itemHelper.isOfBaseclass(item._tpl, group)) - { - for (const dist of spawnpoint.itemDistribution) - { - if (dist.composedKey.key == item._id) - { + private markedItemGroups(spawnpoint: Spawnpoint): void { + for (const item of spawnpoint.template.Items) { + for (const group in this.markedRoomConfig.itemGroups) { + if (this.itemHelper.isOfBaseclass(item._tpl, group)) { + for (const dist of spawnpoint.itemDistribution) { + if (dist.composedKey.key == item._id) { dist.relativeProbability *= this.markedRoomConfig.itemGroups[group]; this.logger.logDebug(`markedItemGroups: Changed ${item._tpl} to ${dist.relativeProbability}`); } @@ -135,4 +112,4 @@ export class MarkedRoom } } } -} \ No newline at end of file +} diff --git a/src/mod.ts b/src/mod.ts index ef81292..0d3869e 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,52 +1,50 @@ -import JSON5 from "json5"; import path from "path"; -import { DependencyContainer } from "tsyringe"; -import { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod"; -import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod"; import { IContainerItem, LocationGenerator } from "@spt/generators/LocationGenerator"; -import { ProbabilityObject, ProbabilityObjectArray } from "@spt/utils/RandomUtil"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { ObjectId } from "@spt/utils/ObjectId"; -import { JsonUtil } from "@spt/utils/JsonUtil"; import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { BaseClasses } from "@spt/models/enums/BaseClasses"; +import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; +import { ILocation, IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; +import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { MathUtil } from "@spt/utils/MathUtil"; -import { LocalisationService } from "@spt/services/LocalisationService"; -import { ILooseLoot, Spawnpoint, SpawnpointsForced, SpawnpointTemplate } from "@spt/models/eft/common/ILooseLoot"; -import { ConfigServer } from "@spt/servers/ConfigServer"; -import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { BaseClasses } from "@spt/models/enums/BaseClasses"; +import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; +import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod"; +import { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ILocation, IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; -import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; -import { VFS } from "@spt/utils/VFS"; -import { MarkedRoom } from "./MarkedRoom"; import { HashUtil } from "@spt/utils/HashUtil"; +import { JsonUtil } from "@spt/utils/JsonUtil"; +import { MathUtil } from "@spt/utils/MathUtil"; +import { ObjectId } from "@spt/utils/ObjectId"; +import { ProbabilityObject, ProbabilityObjectArray } from "@spt/utils/RandomUtil"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { VFS } from "@spt/utils/VFS"; import { ICloner } from "@spt/utils/cloners/ICloner"; +import JSON5 from "json5"; +import { DependencyContainer } from "tsyringe"; import { ILotsofLootConfig } from "./ILotsofLootConfig"; -import { LotsofLootLogger } from "./LotsofLootLogger"; import { LotsofLootHelper } from "./LotsofLootHelper"; +import { LotsofLootLogger } from "./LotsofLootLogger"; +import { MarkedRoom } from "./MarkedRoom"; -class Mod implements IPreSptLoadMod, IPostDBLoadMod -{ +class Mod implements IPreSptLoadMod, IPostDBLoadMod { private static config: ILotsofLootConfig = null; private static container: DependencyContainer; private logger: LotsofLootLogger; - private databaseServer: DatabaseServer + private databaseServer: DatabaseServer; private itemHelper: ItemHelper; private cloner: ICloner; private markedRoom: MarkedRoom; private lotsoflootHelper: LotsofLootHelper; - public preSptLoad(container: DependencyContainer): void - { + public preSptLoad(container: DependencyContainer): void { Mod.container = container; // Get VFS to read in configs @@ -55,27 +53,27 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod // Load config statically so that we don't have to keep reloading this across the entire file. Mod.config = JSON5.parse(vfs.readFile(path.join(preSptModLoader.getModPath("archangelwtf-lotsoflootredux"), "config/config.json5"))); - this.logger = new LotsofLootLogger(container.resolve("WinstonLogger"), Mod.config.general.debug) + this.logger = new LotsofLootLogger(container.resolve("WinstonLogger"), Mod.config.general.debug); this.markedRoom = new MarkedRoom(Mod.config.markedRoom, container.resolve("DatabaseServer"), container.resolve("ItemHelper"), container.resolve("HashUtil"), this.logger); this.lotsoflootHelper = new LotsofLootHelper(Mod.config, container.resolve("DatabaseServer"), container.resolve("ItemHelper"), this.logger); - - container.afterResolution("LocationGenerator", (_t, result: LocationGenerator) => - { - //Temporary cast to get rid of protected error - (result as any).createStaticLootItem = (tpl, staticAmmoDist, parentId) => - { - return this.createStaticLootItem(tpl, staticAmmoDist, parentId); - } - result.generateDynamicLoot = (dynamicLootDist, staticAmmoDist, locationName) => - { - return this.generateDynamicLoot(dynamicLootDist, staticAmmoDist, locationName); - } - }, {frequency: "Always"}); + container.afterResolution( + "LocationGenerator", + (_t, result: LocationGenerator) => { + //Temporary cast to get rid of protected error + (result as any).createStaticLootItem = (tpl, staticAmmoDist, parentId) => { + return this.createStaticLootItem(tpl, staticAmmoDist, parentId); + }; + + result.generateDynamicLoot = (dynamicLootDist, staticAmmoDist, locationName) => { + return this.generateDynamicLoot(dynamicLootDist, staticAmmoDist, locationName); + }; + }, + { frequency: "Always" }, + ); } - public postDBLoad(container: DependencyContainer): void - { + public postDBLoad(container: DependencyContainer): void { this.databaseServer = Mod.container.resolve("DatabaseServer"); this.itemHelper = Mod.container.resolve("ItemHelper"); this.cloner = Mod.container.resolve("PrimaryCloner"); @@ -88,27 +86,22 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod this.markedRoom.doMarkedRoomChanges(); this.addToRustedKeyRoom(); - if(Mod.config.general.removeBackpackRestrictions) - { + if (Mod.config.general.removeBackpackRestrictions) { this.lotsoflootHelper.removeBackpackRestrictions(); } - - for (const map in Mod.config.looseLootMultiplier) - { + + for (const map in Mod.config.looseLootMultiplier) { LocationConfig.looseLootMultiplier[map] = Mod.config.looseLootMultiplier[map]; this.logger.logDebug(`${map}: ${LocationConfig.looseLootMultiplier[map]}`); LocationConfig.staticLootMultiplier[map] = Mod.config.staticLootMultiplier[map]; - this.logger.logDebug(`${map}: ${LocationConfig.staticLootMultiplier[map]}`) + this.logger.logDebug(`${map}: ${LocationConfig.staticLootMultiplier[map]}`); } - for(const locationId in locations) - { - if(locations.hasOwnProperty(locationId)) - { + for (const locationId in locations) { + if (locations.hasOwnProperty(locationId)) { const location: ILocation = locations[locationId]; //Location does not have any static loot pools, skip this map. - if(!location.staticLoot) - { + if (!location.staticLoot) { this.logger.logDebug(`Skipping ${locationId} as it has no static loot`); continue; @@ -116,53 +109,43 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod const staticLoot = location.staticLoot; - for (const container in staticLoot) - { - for (const possItemCount in staticLoot[container].itemcountDistribution) - { - if (staticLoot[container].itemcountDistribution[possItemCount].count == 0) - { + for (const container in staticLoot) { + for (const possItemCount in staticLoot[container].itemcountDistribution) { + if (staticLoot[container].itemcountDistribution[possItemCount].count == 0) { staticLoot[container].itemcountDistribution[possItemCount].relativeProbability = Math.round(staticLoot[container].itemcountDistribution[possItemCount].relativeProbability * Mod.config.containers[container]); - - this.logger.logDebug(`Changed container ${container} chance to ${staticLoot[container].itemcountDistribution[possItemCount].relativeProbability}`) + + this.logger.logDebug(`Changed container ${container} chance to ${staticLoot[container].itemcountDistribution[possItemCount].relativeProbability}`); } } } } } - - for (const itemId in Mod.config.changeRelativeProbabilityInPool) - { + + for (const itemId in Mod.config.changeRelativeProbabilityInPool) { this.lotsoflootHelper.changeRelativeProbabilityInPool(itemId, Mod.config.changeRelativeProbabilityInPool[itemId]); } - for (const itemId in Mod.config.changeProbabilityOfPool) - { + for (const itemId in Mod.config.changeProbabilityOfPool) { this.lotsoflootHelper.changeProbabilityOfPool(itemId, Mod.config.changeProbabilityOfPool[itemId]); } - if (Mod.config.general.disableFleaRestrictions) - { - for (const item in tables.templates.items) - { - if (this.itemHelper.isValidItem(tables.templates.items[item]._id)) - { + if (Mod.config.general.disableFleaRestrictions) { + for (const item in tables.templates.items) { + if (this.itemHelper.isValidItem(tables.templates.items[item]._id)) { tables.templates.items[item]._props.CanRequireOnRagfair = true; tables.templates.items[item]._props.CanSellOnRagfair = true; } } } - for (const id in Mod.config.general.priceCorrection) - { + for (const id in Mod.config.general.priceCorrection) { tables.templates.prices[id] = Mod.config.general.priceCorrection[id]; } this.logger.logInfo(`Finished loading`); } - private generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): SpawnpointTemplate[] - { + private generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): SpawnpointTemplate[] { const locationGenerator = Mod.container.resolve("LocationGenerator"); const jsonUtil = Mod.container.resolve("JsonUtil"); const randomUtil = Mod.container.resolve("RandomUtil"); @@ -187,8 +170,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod // Temporary cast to get rid of protected, draw from random distribution let desiredSpawnpointCount = Math.round((locationGenerator as any).getLooseLootMultiplerForLocation(locationName) * randomUtil.getNormallyDistributedRandomNumber(dynamicLootDist.spawnpointCount.mean, dynamicLootDist.spawnpointCount.std)); - if (desiredSpawnpointCount > Mod.config.limits[locationName]) - { + if (desiredSpawnpointCount > Mod.config.limits[locationName]) { desiredSpawnpointCount = Mod.config.limits[locationName]; } @@ -198,22 +180,18 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod const blacklistedSpawnpoints = LocationConfig.looseLootBlacklist[locationName]; const spawnpointArray = new ProbabilityObjectArray(mathUtil, jsonUtil); - for (const spawnpoint of allDynamicSpawnpoints) - { - if (blacklistedSpawnpoints?.includes(spawnpoint.template.Id)) - { + for (const spawnpoint of allDynamicSpawnpoints) { + if (blacklistedSpawnpoints?.includes(spawnpoint.template.Id)) { this.logger.logDebug(`Ignoring loose loot location: ${spawnpoint.template.Id}`); continue; } // We've handled IsAlwaysSpawn above, so skip them - if (spawnpoint.template.IsAlwaysSpawn) - { + if (spawnpoint.template.IsAlwaysSpawn) { continue; } - if (spawnpoint.probability === 1) - { + if (spawnpoint.probability === 1) { guaranteedLoosePoints.push(spawnpoint); } @@ -226,29 +204,25 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod const randomSpawnpointCount = desiredSpawnpointCount - chosenSpawnpoints.length; // Add randomly chosen spawn points - if(randomSpawnpointCount) - { - for (const si of spawnpointArray.draw(randomSpawnpointCount, true)) - { + if (randomSpawnpointCount) { + for (const si of spawnpointArray.draw(randomSpawnpointCount, true)) { chosenSpawnpoints.push(spawnpointArray.data(si)); } } - - if (!Mod.config.general.allowLootOverlay) - { + + if (!Mod.config.general.allowLootOverlay) { // Filter out duplicate locationIds chosenSpawnpoints = [...new Map(chosenSpawnpoints.map((x) => [x.locationId, x])).values()]; // Do we have enough items in pool to fulfill requirement - const tooManySpawnPointsRequested = (desiredSpawnpointCount - chosenSpawnpoints.length) > 0; - if (tooManySpawnPointsRequested) - { + const tooManySpawnPointsRequested = desiredSpawnpointCount - chosenSpawnpoints.length > 0; + if (tooManySpawnPointsRequested) { this.logger.logDebug( localisationService.getText("location-spawn_point_count_requested_vs_found", { requested: desiredSpawnpointCount + guaranteedLoosePoints.length, found: chosenSpawnpoints.length, - mapName: locationName - }) + mapName: locationName, + }), ); } } @@ -256,25 +230,20 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod // Iterate over spawnpoints const seasonalEventActive = seasonalEventService.seasonalEventEnabled(); const seasonalItemTplBlacklist = seasonalEventService.getInactiveSeasonalEventItems(); - for (const spawnPoint of chosenSpawnpoints) - { - if (!spawnPoint.template) - { + for (const spawnPoint of chosenSpawnpoints) { + if (!spawnPoint.template) { this.logger.logWarning(localisationService.getText("location-missing_dynamic_template", spawnPoint.locationId)); continue; } - if (!spawnPoint.template.Items || spawnPoint.template.Items.length === 0) - { + if (!spawnPoint.template.Items || spawnPoint.template.Items.length === 0) { this.logger.logError(localisationService.getText("location-spawnpoint_missing_items", spawnPoint.template.Id)); continue; } const itemArray = new ProbabilityObjectArray(mathUtil, jsonUtil); - for (const itemDist of spawnPoint.itemDistribution) - { - if (!seasonalEventActive && seasonalItemTplBlacklist.includes(spawnPoint.template.Items.find((x) => x._id === itemDist.composedKey.key)._tpl)) - { + for (const itemDist of spawnPoint.itemDistribution) { + if (!seasonalEventActive && seasonalItemTplBlacklist.includes(spawnPoint.template.Items.find((x) => x._id === itemDist.composedKey.key)._tpl)) { // Skip seasonal event items if they're not enabled continue; } @@ -282,8 +251,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod itemArray.push(new ProbabilityObject(itemDist.composedKey.key, itemDist.relativeProbability)); } - if (itemArray.length === 0) - { + if (itemArray.length === 0) { this.logger.logWarning(`Loot pool for position: ${spawnPoint.template.Id} is empty. Skipping`); continue; @@ -292,7 +260,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod // Draw a random item from spawn points possible items const spawnPointClone = this.cloner.clone(spawnPoint); const chosenComposedKey = itemArray.draw(1)[0]; - const chosenItem = spawnPointClone.template.Items.find(x => x._id === chosenComposedKey); + const chosenItem = spawnPointClone.template.Items.find((x) => x._id === chosenComposedKey); const chosenTpl = chosenItem._tpl; const createItemResult = this.createStaticLootItem(chosenTpl, staticAmmoDist, undefined, spawnPointClone); @@ -306,8 +274,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod return loot; } - private createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: Spawnpoint = undefined): IContainerItem - { + private createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: Spawnpoint = undefined): IContainerItem { const objectId = Mod.container.resolve("ObjectId"); const presetHelper = Mod.container.resolve("PresetHelper"); const locationGenerator = Mod.container.resolve("LocationGenerator"); @@ -315,89 +282,72 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod const localisationService = Mod.container.resolve("LocalisationService"); const configServer = Mod.container.resolve("ConfigServer"); const LocationConfig = configServer.getConfig(ConfigTypes.LOCATION); - + const gotItem = this.itemHelper.getItem(tpl); - let itemTemplate:ITemplateItem; - if (gotItem[0]) - { + let itemTemplate: ITemplateItem; + if (gotItem[0]) { itemTemplate = gotItem[1]; - } - else - { + } else { return { - "items": [], - "width": 0, - "height": 0 + items: [], + width: 0, + height: 0, }; } let width = itemTemplate._props.Width; let height = itemTemplate._props.Height; - let items: Item[] = [{ - _id: objectId.generate(), - _tpl: tpl - }]; + let items: Item[] = [ + { + _id: objectId.generate(), + _tpl: tpl, + }, + ]; // container item has container's id as parentId - if (parentId) - { - items[0].parentId = parentId + if (parentId) { + items[0].parentId = parentId; } - if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.WEAPON)) - { - if (spawnPoint != undefined) - { - const chosenItem = spawnPoint.template.Items.find(x => x._tpl === tpl); + if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.WEAPON)) { + if (spawnPoint != undefined) { + const chosenItem = spawnPoint.template.Items.find((x) => x._tpl === tpl); // Get item + children and add into array we return const itemWithChildren = this.itemHelper.findAndReturnChildrenAsItems(spawnPoint.template.Items, chosenItem._id); // Temporary cast to get rid of protected error, we need to reparent to ensure ids are unique (locationGenerator as any).reparentItemAndChildren(itemWithChildren); - items.splice(0,1); + items.splice(0, 1); items.push(...itemWithChildren); - } - else - { + } else { let children: Item[] = []; const defaultPreset = this.cloner.clone(presetHelper.getDefaultPreset(tpl)); - if (defaultPreset) - { - try - { + if (defaultPreset) { + try { children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); - } - catch (error) - { + } catch (error) { // this item already broke it once without being reproducible tpl = "5839a40f24597726f856b511"; AKS-74UB Default // 5ea03f7400685063ec28bfa8 // ppsh default // 5ba26383d4351e00334c93d9 //mp7_devgru this.logger.logWarning(localisationService.getText("location-preset_not_found", { tpl: tpl, defaultId: defaultPreset._id, defaultName: defaultPreset._name, parentId: parentId })); throw error; } - } - else - { + } else { // RSP30 (62178be9d0050232da3485d9/624c0b3340357b5f566e8766) doesnt have any default presets and kills this code below as it has no chidren to reparent this.logger.logDebug(`createItem() No preset found for weapon: ${tpl}`); } const rootItem = items[0]; - if (!rootItem) - { + if (!rootItem) { this.logger.logError(localisationService.getText("location-missing_root_item", { tpl: tpl, parentId: parentId })); throw new Error(localisationService.getText("location-critical_error_see_log")); } - try - { - if (children?.length > 0) - { + try { + if (children?.length > 0) { items = this.itemHelper.reparentItemAndChildren(rootItem, children); } - } - catch (error) - { + } catch (error) { this.logger.logError(localisationService.getText("location-unable_to_reparent_item", { tpl: tpl, parentId: parentId })); throw error; @@ -407,10 +357,9 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod // it can handle revolver ammo (it's not restructured to be used here yet.) // General: Make a WeaponController for Ragfair preset stuff and the generating weapons and ammo stuff from // BotGenerator - const magazine = items.filter(x => x.slotId === "mod_magazine")[0]; + const magazine = items.filter((x) => x.slotId === "mod_magazine")[0]; // some weapon presets come without magazine; only fill the mag if it exists - if (magazine) - { + if (magazine) { const magTemplate = this.itemHelper.getItem(magazine._tpl)[1]; const weaponTemplate = this.itemHelper.getItem(tpl)[1]; @@ -426,94 +375,61 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod width = size.width; height = size.height; } - - } - else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MONEY) || this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO)) - { + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MONEY) || this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO)) { const stackCount = randomUtil.getInt(itemTemplate._props.StackMinRandom, itemTemplate._props.StackMaxRandom); - items[0].upd = { "StackObjectsCount": stackCount }; - } - else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO_BOX)) - { + items[0].upd = { StackObjectsCount: stackCount }; + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO_BOX)) { this.itemHelper.addCartridgesToAmmoBox(items, itemTemplate); - } - else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MAGAZINE)) - { - if (randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) - { + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MAGAZINE)) { + if (randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { // Create array with just magazine const magazineWithCartridges = [items[0]]; - this.itemHelper.fillMagazineWithRandomCartridge( - magazineWithCartridges, - itemTemplate, - staticAmmoDist, - null, - LocationConfig.minFillStaticMagazinePercent / 100, - ); + this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, itemTemplate, staticAmmoDist, null, LocationConfig.minFillStaticMagazinePercent / 100); // Replace existing magazine with above array items.splice(items.indexOf(items[0]), 1, ...magazineWithCartridges); } - - } - else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.SIMPLE_CONTAINER) && (tpl != "5c093e3486f77430cb02e593")) - { + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.SIMPLE_CONTAINER) && tpl != "5c093e3486f77430cb02e593") { const contloot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, Mod.config.general.looseContainerModifier); this.logger.logDebug(`Container ${tpl} with`); - for (const cont of contloot) - { + for (const cont of contloot) { this.logger.logDebug(`${cont._tpl}`); items.push(cont); } - } - else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.BACKPACK)) - { + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.BACKPACK)) { const contloot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, Mod.config.general.looseBackpackModifier); this.logger.logDebug(`Backpack ${tpl} with`); - for (const cont of contloot) - { + for (const cont of contloot) { this.logger.logDebug(`${cont._tpl}`); items.push(cont); } - } - else if (this.itemHelper.armorItemCanHoldMods(tpl)) - { + } else if (this.itemHelper.armorItemCanHoldMods(tpl)) { const defaultPreset = presetHelper.getDefaultPreset(tpl); - if (defaultPreset) - { + if (defaultPreset) { const presetAndMods: Item[] = this.itemHelper.replaceIDs(defaultPreset._items); this.itemHelper.remapRootItemId(presetAndMods); // Use original items parentId otherwise item doesnt get added to container correctly presetAndMods[0].parentId = items[0].parentId; items = presetAndMods; - } - else - { + } else { // We make base item above, at start of function, no need to do it here - if (itemTemplate._props.Slots?.length > 0) - { - items = this.itemHelper.addChildSlotItems( - items, - itemTemplate, - LocationConfig.equipmentLootSettings.modSpawnChancePercent, - ); + if (itemTemplate._props.Slots?.length > 0) { + items = this.itemHelper.addChildSlotItems(items, itemTemplate, LocationConfig.equipmentLootSettings.modSpawnChancePercent); } } } return { - "items": items, - "width": width, - "height": height + items: items, + width: width, + height: height, }; - } private looseContainerItemFilterIndex: Record = {}; - - private createLooseContainerLoot(tpl: string, id: string, staticAmmoDist: Record, modifier = 0.5): Item[] - { + + private createLooseContainerLoot(tpl: string, id: string, staticAmmoDist: Record, modifier = 0.5): Item[] { const randomUtil = Mod.container.resolve("RandomUtil"); const mathUtil = Mod.container.resolve("MathUtil"); const jsonUtil = Mod.container.resolve("JsonUtil"); @@ -523,15 +439,13 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod const items = tables.templates.items; const item = items[tpl]; - if (item._props.Grids[0]._props.filters[0] === undefined) - { + if (item._props.Grids[0]._props.filters[0] === undefined) { this.logger.logWarning(`${item._name} doesn't have a filter, setting default filter!`); - item._props.Grids[0]._props.filters = - [ + item._props.Grids[0]._props.filters = [ { Filter: ["54009119af1c881c07000029"], - ExcludedFilter: [] - } + ExcludedFilter: [], + }, ]; } @@ -540,20 +454,16 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod const amount = randomUtil.getInt(1, item._props.Grids[0]._props.cellsH * item._props.Grids[0]._props.cellsV * modifier); let fill = 0; - if(this.looseContainerItemFilterIndex[tpl]) - { + if (this.looseContainerItemFilterIndex[tpl]) { whitelist = this.looseContainerItemFilterIndex[tpl]; - } - else - { + } else { this.logger.logDebug(`${tpl} is new, generating whitelist`); const newWhiteList: string[] = []; const newBlackList: string[] = []; //If whitelist contains a parent instead of items, replace the parent by all its children. - for (const content of whitelist) - { + for (const content of whitelist) { const childItems = this.findAndReturnChildrenByItems(items, content); newWhiteList.push(...childItems); } @@ -561,37 +471,31 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod whitelist = newWhiteList; //If blacklist contains a parent instead of items, replace the parent by all its children. - for (const content of blacklist) - { + for (const content of blacklist) { const childItems = this.findAndReturnChildrenByItems(items, content); newBlackList.push(...childItems); } blacklist = newBlackList; - for (const whitelistEntry in whitelist) - { + for (const whitelistEntry in whitelist) { //If whitelist contains entries that are in the blacklist, remove them. - if(blacklist[whitelistEntry]) - { + if (blacklist[whitelistEntry]) { whitelist.splice(whitelist.indexOf(whitelistEntry), 1); } } //Extra restrictions to avoid errors - for (let white = 0; white < whitelist.length; white++) - { - if (!this.itemHelper.isValidItem(whitelist[white])) //Checks if the Item can be in your Stash - { - if (whitelist[white] == "5449016a4bdc2d6f028b456f") - { + for (let white = 0; white < whitelist.length; white++) { + if (!this.itemHelper.isValidItem(whitelist[white])) { + //Checks if the Item can be in your Stash + if (whitelist[white] == "5449016a4bdc2d6f028b456f") { continue; } whitelist.splice(white, 1); white--; - } - else if (items[whitelist[white]]._props.Prefab.path == "") //If the Item has no model it cant be valid - { + } else if (items[whitelist[white]]._props.Prefab.path == "") { + //If the Item has no model it cant be valid whitelist.splice(white, 1); white--; } @@ -600,69 +504,51 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod //Write new entry for later re-use. this.looseContainerItemFilterIndex[tpl] = whitelist; } - - if (whitelist.length == 0) - { + + if (whitelist.length == 0) { this.logger.logWarning(`${tpl} whitelist is empty`); return []; } const weight: number[] = []; - for (let i = 0; i < whitelist.length; i++) - { - if (tables.templates.prices[whitelist[i]]) - { - weight.push(Math.round(1000/Math.pow(tables.templates.prices[whitelist[i]],(1/3)))); - } - else if (whitelist[i] == "5449016a4bdc2d6f028b456f") - { + for (let i = 0; i < whitelist.length; i++) { + if (tables.templates.prices[whitelist[i]]) { + weight.push(Math.round(1000 / Math.pow(tables.templates.prices[whitelist[i]], 1 / 3))); + } else if (whitelist[i] == "5449016a4bdc2d6f028b456f") { weight.push(500); - } - else if (whitelist[i] == "5696686a4bdc2da3298b456a") - { + } else if (whitelist[i] == "5696686a4bdc2da3298b456a") { weight.push(100); - } - else if (whitelist[i] == "569668774bdc2da2298b4568") - { + } else if (whitelist[i] == "569668774bdc2da2298b4568") { weight.push(100); - } - else - { + } else { weight.push(1); } } const itemArray = new ProbabilityObjectArray(mathUtil, jsonUtil); - for (let i = 0; i < whitelist.length; i++) - { + for (let i = 0; i < whitelist.length; i++) { itemArray.push(new ProbabilityObject(whitelist[i], weight[i])); } - const generatedItems:Item[] = []; + const generatedItems: Item[] = []; - while (true) - { + while (true) { let cont: string; - if (Mod.config.general.itemWeights) - { - cont = itemArray.draw(1,true)[0]; - } - else - { - cont = whitelist[randomUtil.getInt(0,whitelist.length-1)]; + if (Mod.config.general.itemWeights) { + cont = itemArray.draw(1, true)[0]; + } else { + cont = whitelist[randomUtil.getInt(0, whitelist.length - 1)]; } const positem = this.createStaticLootItem(cont, staticAmmoDist, id); positem.items[0].slotId = "main"; - fill += (positem.height * positem.width); + fill += positem.height * positem.width; - if (fill > amount) - { + if (fill > amount) { break; } - - for (const itm of positem.items) - { + + for (const itm of positem.items) { generatedItems.push(itm); } } @@ -670,243 +556,221 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod return generatedItems; } - private findAndReturnChildrenByItems(items: Record, itemID: string): string[] - { + private findAndReturnChildrenByItems(items: Record, itemID: string): string[] { const stack: string[] = [itemID]; const result: string[] = []; let i = 0; - - if (itemID == "54009119af1c881c07000029") - { - for (const childItem of Object.keys(items)) - { + + if (itemID == "54009119af1c881c07000029") { + for (const childItem of Object.keys(items)) { result.push(childItem); } return result; } - - while (stack.length > 0) - { + + while (stack.length > 0) { i = 0; const currentItemId = stack.pop(); - for (const childItem of Object.keys(items)) - { - if (items[childItem]._parent === currentItemId) - { + for (const childItem of Object.keys(items)) { + if (items[childItem]._parent === currentItemId) { stack.push(childItem); i++; } } - if (i == 0) - { + if (i == 0) { result.push(currentItemId); } } return result; } - - private addToRustedKeyRoom() : void - { + + private addToRustedKeyRoom(): void { const objectId = Mod.container.resolve("ObjectId"); const tables = this.databaseServer.getTables(); const streetsloot = tables.locations.tarkovstreets.looseLoot; const items = tables.templates.items; - let keys:string[] = []; - let valuables:string[] = []; - - for (const item in items) - { - try { - if(Mod.config.general.rustedKeyRoomIncludesKeycards) - { - if(this.itemHelper.isOfBaseclass(item,BaseClasses.KEY)) - { - keys.push(item); - } - } - else - { - if(this.itemHelper.isOfBaseclass(item,BaseClasses.KEY_MECHANICAL)) - { - keys.push(item); - } + let keys: string[] = []; + let valuables: string[] = []; + + for (const item in items) { + if (Mod.config.general.rustedKeyRoomIncludesKeycards) { + if (this.itemHelper.isOfBaseclass(item, BaseClasses.KEY)) { + keys.push(item); } - if(this.itemHelper.isOfBaseclass(item,BaseClasses.JEWELRY)) - { - valuables.push(item); + } else { + if (this.itemHelper.isOfBaseclass(item, BaseClasses.KEY_MECHANICAL)) { + keys.push(item); } - } - catch (error) { - + } + if (this.itemHelper.isOfBaseclass(item, BaseClasses.JEWELRY)) { + valuables.push(item); } } let point: Spawnpoint = { - "locationId":"(185.087, 6.554, 63.721)", - "probability": 0.25, - "template": { - "Id": "Keys1", - "IsContainer":false, - "useGravity": true, - "randomRotation": true, - "Position": { - "x": 185.087, - "y": 6.554, - "z": 63.721 + locationId: "(185.087, 6.554, 63.721)", + probability: 0.25, + template: { + Id: "Keys1", + IsContainer: false, + useGravity: true, + randomRotation: true, + Position: { + x: 185.087, + y: 6.554, + z: 63.721, }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 + Rotation: { + x: 0, + y: 0, + z: 0, }, - "IsGroupPosition": false, - "GroupPositions": [], - "IsAlwaysSpawn": false, - "Root": objectId.generate(), - "Items": [] + IsGroupPosition: false, + GroupPositions: [], + IsAlwaysSpawn: false, + Root: objectId.generate(), + Items: [], }, - "itemDistribution":[] + itemDistribution: [], }; - for(let i = 0;i Date: Thu, 24 Oct 2024 15:28:56 +0200 Subject: [PATCH 03/23] Remove seemingly unecessary code, allow static weapons to generate magazines with same parameters as static magazines --- src/mod.ts | 46 +++++++++++++++------------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/src/mod.ts b/src/mod.ts index 0d3869e..8d0daba 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -277,7 +277,6 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { private createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: Spawnpoint = undefined): IContainerItem { const objectId = Mod.container.resolve("ObjectId"); const presetHelper = Mod.container.resolve("PresetHelper"); - const locationGenerator = Mod.container.resolve("LocationGenerator"); const randomUtil = Mod.container.resolve("RandomUtil"); const localisationService = Mod.container.resolve("LocalisationService"); const configServer = Mod.container.resolve("ConfigServer"); @@ -304,7 +303,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { }, ]; - // container item has container's id as parentId + // container item has the container's id as the parentId if (parentId) { items[0].parentId = parentId; } @@ -314,23 +313,14 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { const chosenItem = spawnPoint.template.Items.find((x) => x._tpl === tpl); // Get item + children and add into array we return const itemWithChildren = this.itemHelper.findAndReturnChildrenAsItems(spawnPoint.template.Items, chosenItem._id); - // Temporary cast to get rid of protected error, we need to reparent to ensure ids are unique - (locationGenerator as any).reparentItemAndChildren(itemWithChildren); + items.splice(0, 1); items.push(...itemWithChildren); } else { let children: Item[] = []; const defaultPreset = this.cloner.clone(presetHelper.getDefaultPreset(tpl)); if (defaultPreset) { - try { - children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); - } catch (error) { - // this item already broke it once without being reproducible tpl = "5839a40f24597726f856b511"; AKS-74UB Default - // 5ea03f7400685063ec28bfa8 // ppsh default - // 5ba26383d4351e00334c93d9 //mp7_devgru - this.logger.logWarning(localisationService.getText("location-preset_not_found", { tpl: tpl, defaultId: defaultPreset._id, defaultName: defaultPreset._name, parentId: parentId })); - throw error; - } + children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); } else { // RSP30 (62178be9d0050232da3485d9/624c0b3340357b5f566e8766) doesnt have any default presets and kills this code below as it has no chidren to reparent this.logger.logDebug(`createItem() No preset found for weapon: ${tpl}`); @@ -343,29 +333,21 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { throw new Error(localisationService.getText("location-critical_error_see_log")); } - try { - if (children?.length > 0) { - items = this.itemHelper.reparentItemAndChildren(rootItem, children); - } - } catch (error) { - this.logger.logError(localisationService.getText("location-unable_to_reparent_item", { tpl: tpl, parentId: parentId })); - - throw error; + if (children?.length > 0) { + items = this.itemHelper.reparentItemAndChildren(rootItem, children); } - - // Here we should use generalized BotGenerators functions e.g. fillExistingMagazines in the future since - // it can handle revolver ammo (it's not restructured to be used here yet.) - // General: Make a WeaponController for Ragfair preset stuff and the generating weapons and ammo stuff from - // BotGenerator + const magazine = items.filter((x) => x.slotId === "mod_magazine")[0]; - // some weapon presets come without magazine; only fill the mag if it exists - if (magazine) { + // some weapon presets come without magazine; only fill the mag if it exists and if it has a good roll. + if (magazine && randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { const magTemplate = this.itemHelper.getItem(magazine._tpl)[1]; const weaponTemplate = this.itemHelper.getItem(tpl)[1]; // Create array with just magazine - const magazineWithCartridges = [magazine]; - this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, magTemplate, staticAmmoDist, weaponTemplate._props.ammoCaliber); + const magazineWithCartridges: Item[] = []; + magazineWithCartridges.push(magazine); + + this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, magTemplate, staticAmmoDist, weaponTemplate._props.ammoCaliber, LocationConfig.minFillStaticMagazinePercent / 100); // Replace existing magazine with above array items.splice(items.indexOf(magazine), 1, ...magazineWithCartridges); @@ -383,7 +365,9 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MAGAZINE)) { if (randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { // Create array with just magazine - const magazineWithCartridges = [items[0]]; + const magazineWithCartridges: Item[] = []; + magazineWithCartridges.push(items[0]); + this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, itemTemplate, staticAmmoDist, null, LocationConfig.minFillStaticMagazinePercent / 100); // Replace existing magazine with above array From 4898d77927dbaeef121e2d3ba4551948bf60d43f Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 24 Oct 2024 15:36:07 +0200 Subject: [PATCH 04/23] Move over to 3.10 types --- src/MarkedRoom.ts | 6 +- src/mod.ts | 48 +- types/callbacks/BotCallbacks.d.ts | 10 +- types/callbacks/DataCallbacks.d.ts | 11 +- types/callbacks/DialogueCallbacks.d.ts | 6 +- types/callbacks/GameCallbacks.d.ts | 9 + types/callbacks/HideoutCallbacks.d.ts | 10 + types/callbacks/InraidCallbacks.d.ts | 29 +- types/callbacks/LocationCallbacks.d.ts | 10 +- types/callbacks/MatchCallbacks.d.ts | 14 +- types/callbacks/ProfileCallbacks.d.ts | 4 +- types/callbacks/TraderCallbacks.d.ts | 7 +- types/callbacks/WeatherCallbacks.d.ts | 3 + types/callbacks/WishlistCallbacks.d.ts | 10 +- types/context/ContextVariableType.d.ts | 4 +- types/controllers/BotController.d.ts | 36 +- types/controllers/BuildController.d.ts | 2 +- .../controllers/CustomizationController.d.ts | 10 +- types/controllers/DialogueController.d.ts | 18 +- types/controllers/GameController.d.ts | 7 +- types/controllers/HealthController.d.ts | 2 +- types/controllers/HideoutController.d.ts | 64 ++- types/controllers/InraidController.d.ts | 158 +----- types/controllers/InsuranceController.d.ts | 44 +- types/controllers/InventoryController.d.ts | 2 +- types/controllers/LauncherController.d.ts | 4 +- types/controllers/LocationController.d.ts | 67 +-- types/controllers/MatchController.d.ts | 78 +-- types/controllers/ProfileController.d.ts | 6 +- types/controllers/QuestController.d.ts | 15 +- types/controllers/RagfairController.d.ts | 17 +- .../RepeatableQuestController.d.ts | 2 +- types/controllers/TradeController.d.ts | 17 +- types/controllers/TraderController.d.ts | 9 +- types/controllers/WeatherController.d.ts | 11 +- types/controllers/WishlistController.d.ts | 10 +- types/di/Serializer.d.ts | 1 - .../generators/BotEquipmentModGenerator.d.ts | 89 ++-- types/generators/BotGenerator.d.ts | 45 +- types/generators/BotInventoryGenerator.d.ts | 38 +- types/generators/BotLevelGenerator.d.ts | 23 +- types/generators/BotLootGenerator.d.ts | 26 +- types/generators/BotWeaponGenerator.d.ts | 56 ++- .../generators/FenceBaseAssortGenerator.d.ts | 4 +- ...erator.d.ts => LocationLootGenerator.d.ts} | 26 +- types/generators/LootGenerator.d.ts | 51 +- types/generators/PlayerScavGenerator.d.ts | 14 +- types/generators/RagfairAssortGenerator.d.ts | 10 +- types/generators/RagfairOfferGenerator.d.ts | 47 +- .../generators/RepeatableQuestGenerator.d.ts | 13 +- .../RepeatableQuestRewardGenerator.d.ts | 28 +- types/generators/ScavCaseRewardGenerator.d.ts | 14 +- types/generators/WeatherGenerator.d.ts | 25 +- .../generators/weapongen/InventoryMagGen.d.ts | 10 +- types/helpers/BotDifficultyHelper.d.ts | 32 +- types/helpers/BotGeneratorHelper.d.ts | 19 +- types/helpers/BotHelper.d.ts | 27 +- types/helpers/BotWeaponGeneratorHelper.d.ts | 14 +- .../GiveCommand/GiveSptCommand.d.ts | 2 +- types/helpers/DialogueHelper.d.ts | 10 +- types/helpers/HandbookHelper.d.ts | 8 +- types/helpers/HealthHelper.d.ts | 24 +- types/helpers/HideoutHelper.d.ts | 60 ++- types/helpers/InRaidHelper.d.ts | 148 ++---- types/helpers/InventoryHelper.d.ts | 57 ++- types/helpers/ItemHelper.d.ts | 116 +++-- types/helpers/NotificationSendHelper.d.ts | 4 +- types/helpers/NotifierHelper.d.ts | 6 +- types/helpers/PresetHelper.d.ts | 6 +- types/helpers/ProfileHelper.d.ts | 40 +- types/helpers/QuestHelper.d.ts | 34 +- types/helpers/RagfairHelper.d.ts | 4 +- types/helpers/RagfairOfferHelper.d.ts | 17 +- types/helpers/RagfairSellHelper.d.ts | 4 +- types/helpers/RagfairServerHelper.d.ts | 10 +- types/helpers/RepairHelper.d.ts | 10 +- types/helpers/RepeatableQuestHelper.d.ts | 2 +- types/helpers/SecureContainerHelper.d.ts | 10 +- types/helpers/TradeHelper.d.ts | 11 +- types/helpers/TraderAssortHelper.d.ts | 8 +- types/helpers/TraderHelper.d.ts | 14 +- types/helpers/WeatherHelper.d.ts | 25 + types/helpers/WeightedRandomHelper.d.ts | 9 - types/loaders/BundleLoader.d.ts | 10 +- types/loaders/PostDBModLoader.d.ts | 2 +- types/loaders/PostSptModLoader.d.ts | 2 +- types/loaders/PreSptModLoader.d.ts | 6 +- .../eft/bot/IGenerateBotsRequestData.d.ts | 4 +- .../models/eft/common/IEmptyRequestData.d.ts | 3 +- types/models/eft/common/IGlobals.d.ts | 203 +++++++- types/models/eft/common/ILocation.d.ts | 18 +- types/models/eft/common/ILocationBase.d.ts | 110 +++-- .../ILocationsSourceDestinationBase.d.ts | 4 +- types/models/eft/common/ILooseLoot.d.ts | 34 +- types/models/eft/common/tables/IBotBase.d.ts | 244 ++++----- types/models/eft/common/tables/IBotType.d.ts | 101 ++-- .../eft/common/tables/ICustomizationItem.d.ts | 10 +- .../eft/common/tables/IHandbookBase.d.ts | 8 +- types/models/eft/common/tables/IItem.d.ts | 104 ++-- .../eft/common/tables/ILocationServices.d.ts | 71 +++ .../eft/common/tables/ILocationsBase.d.ts | 9 +- types/models/eft/common/tables/IMatch.d.ts | 4 +- .../eft/common/tables/IProfileTemplate.d.ts | 14 +- types/models/eft/common/tables/IQuest.d.ts | 47 +- .../eft/common/tables/IRepeatableQuests.d.ts | 8 +- .../eft/common/tables/ITemplateItem.d.ts | 83 ++-- types/models/eft/common/tables/ITrader.d.ts | 25 +- .../IBuyClothingRequestData.d.ts | 4 +- .../dialog/IGetAllAttachmentsResponse.d.ts | 4 +- .../IGetMailDialogViewResponseData.d.ts | 4 +- .../models/eft/game/IGameConfigResponse.d.ts | 4 +- .../eft/game/IVersionValidateRequestData.d.ts | 4 +- .../health/IHealthTreatmentRequestData.d.ts | 28 +- .../eft/health/ISyncHealthRequestData.d.ts | 20 +- types/models/eft/health/IWorkoutData.d.ts | 36 +- .../HideoutUpgradeCompleteRequestData.d.ts | 5 - types/models/eft/hideout/IHideoutArea.d.ts | 14 +- ...leOfCultistProductionStartRequestData.d.ts | 4 + .../IHideoutDeleteProductionRequestData.d.ts | 5 + .../IHideoutImproveAreaRequestData.d.ts | 4 +- .../eft/hideout/IHideoutProduction.d.ts | 28 +- .../models/eft/hideout/IHideoutScavCase.d.ts | 8 +- .../IHideoutScavCaseStartRequestData.d.ts | 8 +- .../eft/hideout/IHideoutSettingsBase.d.ts | 1 + ...deoutSingleProductionStartRequestData.d.ts | 6 +- .../hideout/IHideoutUpgradeRequestData.d.ts | 4 +- types/models/eft/hideout/IQteData.d.ts | 6 +- .../eft/inRaid/IItemDeliveryRequestData.d.ts | 4 +- .../eft/inRaid/ISaveProgressRequestData.d.ts | 11 - .../eft/inRaid/IScavSaveRequestData.d.ts | 4 + .../eft/inventory/IAddItemDirectRequest.d.ts | 4 +- .../eft/inventory/IAddItemRequestData.d.ts | 4 +- .../eft/inventory/IAddItemTempObject.d.ts | 6 +- .../eft/inventory/IAddItemsDirectRequest.d.ts | 4 +- .../inventory/IInventoryAddRequestData.d.ts | 4 +- .../IInventoryBaseActionRequestData.d.ts | 18 +- .../IInventoryCreateMarkerRequestData.d.ts | 4 +- .../IInventoryEditMarkerRequestData.d.ts | 4 +- .../inventory/IInventoryMoveRequestData.d.ts | 4 +- .../inventory/IInventorySortRequestData.d.ts | 18 +- .../inventory/IInventorySplitRequestData.d.ts | 4 +- .../inventory/IInventorySwapRequestData.d.ts | 6 +- .../IOpenRandomLootContainerRequestData.d.ts | 4 +- .../eft/itemEvent/IItemEventRouterBase.d.ts | 55 +-- .../itemEvent/IItemEventRouterRequest.d.ts | 12 +- types/models/eft/launcher/IMiniProfile.d.ts | 8 +- .../eft/location/IAirdropLootResult.d.ts | 4 +- .../eft/location/IGetAirdropLootRequest.d.ts | 3 + .../eft/location/IGetAirdropLootResponse.d.ts | 6 + .../eft/match/IEndLocalRaidRequestData.d.ts | 41 ++ .../IGetRaidConfigurationRequestData.d.ts | 1 - types/models/eft/match/IGroupCharacter.d.ts | 4 +- .../eft/match/IPutMetricsRequestData.d.ts | 53 +- types/models/eft/match/IRaidSettings.d.ts | 19 +- .../eft/match/IStartLocalRaidRequestData.d.ts | 17 + .../match/IStartLocalRaidResponseData.d.ts | 19 + ...IPlayerIncrementSkillLevelRequestData.d.ts | 10 +- .../IPresetBuildActionRequestData.d.ts | 4 +- .../profile/GetProfileStatusResponseData.d.ts | 6 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 12 +- types/models/eft/profile/ISptProfile.d.ts | 113 ++--- .../eft/quests/IHandoverQuestRequestData.d.ts | 4 +- .../eft/ragfair/IAddOfferRequestData.d.ts | 4 +- types/models/eft/ragfair/IRagfairOffer.d.ts | 34 +- .../eft/ragfair/ISearchRequestData.d.ts | 3 +- .../eft/repair/IRepairActionDataRequest.d.ts | 4 +- .../ITraderRepairActionDataRequest.d.ts | 4 +- .../trade/IProcessBuyTradeRequestData.d.ts | 4 +- .../trade/IProcessSellTradeRequestData.d.ts | 4 +- types/models/eft/weather/IWeatherData.d.ts | 3 + .../eft/wishlist/IAddToWishlistRequest.d.ts | 4 + .../IChangeWishlistItemCategoryRequest.d.ts | 5 + .../wishlist/IRemoveFromWishlistRequest.d.ts | 4 + .../eft/wishlist/IWishlistActionData.d.ts | 4 - .../models/eft/ws/IWsChatMessageReceived.d.ts | 4 +- types/models/enums/AirdropType.d.ts | 15 +- types/models/enums/ConfigTypes.d.ts | 3 +- types/models/enums/DogtagExchangeSide.d.ts | 5 + types/models/enums/HideoutAreas.d.ts | 4 +- types/models/enums/HideoutEventActions.d.ts | 4 +- types/models/enums/ItemTpl.d.ts | 461 +++++++++++++----- types/models/enums/QuestRewardType.d.ts | 3 +- types/models/enums/TraderServiceType.d.ts | 3 +- types/models/enums/Weapons.d.ts | 14 + types/models/enums/WildSpawnTypeNumber.d.ts | 18 +- types/models/enums/hideout/QteEffectType.d.ts | 6 +- types/models/external/HttpFramework.d.ts | 5 +- .../models/spt/bots/BotGenerationDetails.d.ts | 2 +- .../models/spt/bots/GenerateWeaponResult.d.ts | 10 - .../bots/IGenerateEquipmentProperties.d.ts | 20 +- .../spt/bots/IGenerateWeaponRequest.d.ts | 12 +- .../spt/bots/IGenerateWeaponResult.d.ts | 10 + types/models/spt/bots/IModToSpawnRequest.d.ts | 13 +- .../spt/callbacks/IDialogueCallbacks.d.ts | 4 +- .../spt/callbacks/IInraidCallbacks.d.ts | 14 - .../spt/callbacks/IWishlistCallbacks.d.ts | 7 - types/models/spt/config/IAirdropConfig.d.ts | 31 +- types/models/spt/config/IBTRConfig.d.ts | 13 - types/models/spt/config/IBotConfig.d.ts | 38 +- types/models/spt/config/IBotDurability.d.ts | 54 +- types/models/spt/config/ICoreConfig.d.ts | 1 + types/models/spt/config/IGiftsConfig.d.ts | 8 +- types/models/spt/config/IHealthConfig.d.ts | 8 +- types/models/spt/config/IHideoutConfig.d.ts | 25 + types/models/spt/config/IInRaidConfig.d.ts | 13 +- types/models/spt/config/IInsuranceConfig.d.ts | 1 + types/models/spt/config/IInventoryConfig.d.ts | 6 +- types/models/spt/config/ILocationConfig.d.ts | 18 +- types/models/spt/config/ILootConfig.d.ts | 4 +- .../models/spt/config/ILostOnDeathConfig.d.ts | 4 +- .../models/spt/config/IPlayerScavConfig.d.ts | 22 +- types/models/spt/config/IPmcConfig.d.ts | 36 +- types/models/spt/config/IQuestConfig.d.ts | 5 + types/models/spt/config/IRagfairConfig.d.ts | 26 +- types/models/spt/config/IRepairConfig.d.ts | 16 +- types/models/spt/config/IScavCaseConfig.d.ts | 18 +- .../spt/config/ISeasonalEventConfig.d.ts | 8 +- types/models/spt/config/ITraderConfig.d.ts | 24 +- types/models/spt/config/IWeatherConfig.d.ts | 14 +- .../spt/controllers/IBotController.d.ts | 4 +- .../spt/dialog/ISendMessageDetails.d.ts | 8 +- .../spt/fence/ICreateFenceAssortsResult.d.ts | 4 +- .../models/spt/generators/IBotGenerator.d.ts | 6 +- .../spt/generators/ILocationGenerator.d.ts | 4 +- .../generators/IRagfairAssortGenerator.d.ts | 4 +- .../generators/IRagfairOfferGenerator.d.ts | 4 +- types/models/spt/hideout/IHideout.d.ts | 4 +- .../ScavCaseRewardCountsAndPrices.d.ts | 10 +- .../spt/inventory/IOwnerInventoryItems.d.ts | 6 +- types/models/spt/mod/NewItemDetails.d.ts | 4 +- .../models/spt/ragfair/ITplWithFleaPrice.d.ts | 5 + types/models/spt/server/ExhaustableArray.d.ts | 2 +- types/models/spt/server/ISettingsBase.d.ts | 16 +- types/models/spt/services/CustomPreset.d.ts | 5 - .../spt/services/CustomTraderAssortData.d.ts | 6 - .../spt/services/IInsuranceEquipmentPkg.d.ts | 4 +- types/models/spt/services/ILootRequest.d.ts | 33 ++ types/models/spt/services/LootItem.d.ts | 2 +- types/models/spt/services/LootRequest.d.ts | 15 - types/models/spt/templates/ITemplates.d.ts | 3 + types/models/spt/utils/ILogger.d.ts | 4 +- .../weather/IGetLocalWeatherResponseData.d.ts | 5 + types/routers/EventOutputHolder.d.ts | 15 +- types/routers/HttpRouter.d.ts | 1 - types/routers/ImageRouter.d.ts | 1 - .../item_events/WishlistItemEventRouter.d.ts | 2 +- .../routers/serializers/BundleSerializer.d.ts | 1 - .../routers/serializers/ImageSerializer.d.ts | 1 - .../routers/serializers/NotifySerializer.d.ts | 1 - types/routers/static/GameStaticRouter.d.ts | 4 +- types/servers/HttpServer.d.ts | 5 +- types/servers/WebSocketServer.d.ts | 3 +- types/servers/http/IHttpListener.d.ts | 1 - types/servers/http/SptHttpListener.d.ts | 18 +- .../ws/IWebSocketConnectionHandler.d.ts | 1 - .../ws/SptWebSocketConnectionHandler.d.ts | 6 +- .../DefaultSptWebSocketMessageHandler.d.ts | 2 +- types/services/AirdropService.d.ts | 56 +++ types/services/BotEquipmentFilterService.d.ts | 24 +- .../services/BotEquipmentModPoolService.d.ts | 6 +- types/services/BotGenerationCacheService.d.ts | 4 +- types/services/BotLootCacheService.d.ts | 10 +- types/services/BotNameService.d.ts | 47 ++ types/services/BotWeaponModLimitService.d.ts | 4 +- types/services/CircleOfCultistService.d.ts | 132 +++++ types/services/CustomLocationWaveService.d.ts | 6 +- types/services/DatabaseService.d.ts | 5 + types/services/FenceService.d.ts | 40 +- types/services/GiftService.d.ts | 10 +- types/services/InMemoryCacheService.d.ts | 29 ++ types/services/InsuranceService.d.ts | 90 +--- .../LegacyLocationLifecycleService.d.ts | 105 ++++ types/services/LocalisationService.d.ts | 2 +- types/services/LocationLifecycleService.d.ts | 199 ++++++++ types/services/MailSendService.d.ts | 24 +- types/services/MapMarkerService.d.ts | 8 +- types/services/PaymentService.d.ts | 8 +- types/services/PmcChatResponseService.d.ts | 10 +- types/services/ProfileFixerService.d.ts | 120 +---- types/services/ProfileSnapshotService.d.ts | 30 -- types/services/RagfairLinkedItemService.d.ts | 4 +- types/services/RagfairOfferService.d.ts | 12 +- types/services/RagfairPriceService.d.ts | 16 +- types/services/RagfairTaxService.d.ts | 12 +- types/services/RaidTimeAdjustmentService.d.ts | 4 +- types/services/RaidWeatherService.d.ts | 43 ++ types/services/RepairService.d.ts | 18 +- types/services/SeasonalEventService.d.ts | 20 +- .../TraderPurchasePersisterService.d.ts | 6 +- types/services/TraderServicesService.d.ts | 13 - types/services/mod/CustomItemService.d.ts | 6 +- .../DynamicRouterModService.d.ts | 2 +- .../mod/httpListener/HttpListenerMod.d.ts | 1 - .../httpListener/HttpListenerModService.d.ts | 1 - .../staticRouter/StaticRouterModService.d.ts | 2 +- .../tools/ItemTplGenerator/itemOverrides.d.ts | 5 + types/utils/HashUtil.d.ts | 8 +- types/utils/HttpFileUtil.d.ts | 1 - types/utils/JsonUtil.d.ts | 2 +- types/utils/ObjectId.d.ts | 1 - types/utils/RandomUtil.d.ts | 2 +- types/utils/TimeUtil.d.ts | 12 + types/utils/VFS.d.ts | 2 - .../utils/logging/AbstractWinstonLogger.d.ts | 7 +- 304 files changed, 3789 insertions(+), 2533 deletions(-) rename types/generators/{LocationGenerator.d.ts => LocationLootGenerator.d.ts} (89%) create mode 100644 types/helpers/WeatherHelper.d.ts create mode 100644 types/models/eft/common/tables/ILocationServices.d.ts delete mode 100644 types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts create mode 100644 types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts create mode 100644 types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts delete mode 100644 types/models/eft/inRaid/ISaveProgressRequestData.d.ts create mode 100644 types/models/eft/inRaid/IScavSaveRequestData.d.ts create mode 100644 types/models/eft/location/IGetAirdropLootRequest.d.ts create mode 100644 types/models/eft/location/IGetAirdropLootResponse.d.ts create mode 100644 types/models/eft/match/IEndLocalRaidRequestData.d.ts create mode 100644 types/models/eft/match/IStartLocalRaidRequestData.d.ts create mode 100644 types/models/eft/match/IStartLocalRaidResponseData.d.ts create mode 100644 types/models/eft/wishlist/IAddToWishlistRequest.d.ts create mode 100644 types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts create mode 100644 types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts delete mode 100644 types/models/eft/wishlist/IWishlistActionData.d.ts create mode 100644 types/models/enums/DogtagExchangeSide.d.ts delete mode 100644 types/models/spt/bots/GenerateWeaponResult.d.ts create mode 100644 types/models/spt/bots/IGenerateWeaponResult.d.ts delete mode 100644 types/models/spt/callbacks/IInraidCallbacks.d.ts delete mode 100644 types/models/spt/callbacks/IWishlistCallbacks.d.ts delete mode 100644 types/models/spt/config/IBTRConfig.d.ts create mode 100644 types/models/spt/ragfair/ITplWithFleaPrice.d.ts delete mode 100644 types/models/spt/services/CustomPreset.d.ts delete mode 100644 types/models/spt/services/CustomTraderAssortData.d.ts create mode 100644 types/models/spt/services/ILootRequest.d.ts delete mode 100644 types/models/spt/services/LootRequest.d.ts create mode 100644 types/models/spt/weather/IGetLocalWeatherResponseData.d.ts create mode 100644 types/services/AirdropService.d.ts create mode 100644 types/services/BotNameService.d.ts create mode 100644 types/services/CircleOfCultistService.d.ts create mode 100644 types/services/InMemoryCacheService.d.ts create mode 100644 types/services/LegacyLocationLifecycleService.d.ts create mode 100644 types/services/LocationLifecycleService.d.ts delete mode 100644 types/services/ProfileSnapshotService.d.ts create mode 100644 types/services/RaidWeatherService.d.ts delete mode 100644 types/services/TraderServicesService.d.ts diff --git a/src/MarkedRoom.ts b/src/MarkedRoom.ts index f34f3ba..3b9b4fa 100644 --- a/src/MarkedRoom.ts +++ b/src/MarkedRoom.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Spawnpoint } from "@spt/models/eft/common/ILooseLoot"; +import { ISpawnpoint } from "@spt/models/eft/common/ILooseLoot"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { HashUtil } from "@spt/utils/HashUtil"; import { MarkedRoomConfig } from "./ILotsofLootConfig"; @@ -76,7 +76,7 @@ export class MarkedRoom { } } - private markedAddExtraItems(spawnpoint: Spawnpoint): void { + private markedAddExtraItems(spawnpoint: ISpawnpoint): void { for (const item of Object.entries(this.markedRoomConfig.extraItems)) { if (spawnpoint.template.Items.find((x) => x._tpl === item[0])) { continue; @@ -98,7 +98,7 @@ export class MarkedRoom { } } - private markedItemGroups(spawnpoint: Spawnpoint): void { + private markedItemGroups(spawnpoint: ISpawnpoint): void { for (const item of spawnpoint.template.Items) { for (const group in this.markedRoomConfig.itemGroups) { if (this.itemHelper.isOfBaseclass(item._tpl, group)) { diff --git a/src/mod.ts b/src/mod.ts index 8d0daba..b606fbd 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,11 +1,11 @@ import path from "path"; -import { IContainerItem, LocationGenerator } from "@spt/generators/LocationGenerator"; +import { IContainerItem, LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; import { ILocation, IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; -import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { ILooseLoot, ISpawnpoint, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; @@ -58,8 +58,8 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { this.lotsoflootHelper = new LotsofLootHelper(Mod.config, container.resolve("DatabaseServer"), container.resolve("ItemHelper"), this.logger); container.afterResolution( - "LocationGenerator", - (_t, result: LocationGenerator) => { + "LocationLootGenerator", + (_t, result: LocationLootGenerator) => { //Temporary cast to get rid of protected error (result as any).createStaticLootItem = (tpl, staticAmmoDist, parentId) => { return this.createStaticLootItem(tpl, staticAmmoDist, parentId); @@ -145,8 +145,8 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { this.logger.logInfo(`Finished loading`); } - private generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): SpawnpointTemplate[] { - const locationGenerator = Mod.container.resolve("LocationGenerator"); + private generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[] { + const LocationLootGenerator = Mod.container.resolve("LocationLootGenerator"); const jsonUtil = Mod.container.resolve("JsonUtil"); const randomUtil = Mod.container.resolve("RandomUtil"); const mathUtil = Mod.container.resolve("MathUtil"); @@ -155,30 +155,30 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { const configServer = Mod.container.resolve("ConfigServer"); const LocationConfig = configServer.getConfig(ConfigTypes.LOCATION); - const loot: SpawnpointTemplate[] = []; - const dynamicForcedSpawnPoints: SpawnpointsForced[] = []; + const loot: ISpawnpointTemplate[] = []; + const dynamicForcedSpawnPoints: ISpawnpointsForced[] = []; - // Build the list of forced loot from both `spawnpointsForced` and any point marked `IsAlwaysSpawn` + // Build the list of forced loot from both `ISpawnpointsForced` and any point marked `IsAlwaysSpawn` dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpointsForced); dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpoints.filter((point) => point.template.IsAlwaysSpawn)); // Temporary cast to get rid of protected, add all forced loot to return array - (locationGenerator as any).addForcedLoot(loot, dynamicLootDist.spawnpointsForced, locationName); + (LocationLootGenerator as any).addForcedLoot(loot, dynamicLootDist.spawnpointsForced, locationName); const allDynamicSpawnpoints = dynamicLootDist.spawnpoints; // Temporary cast to get rid of protected, draw from random distribution - let desiredSpawnpointCount = Math.round((locationGenerator as any).getLooseLootMultiplerForLocation(locationName) * randomUtil.getNormallyDistributedRandomNumber(dynamicLootDist.spawnpointCount.mean, dynamicLootDist.spawnpointCount.std)); + let desiredSpawnpointCount = Math.round((LocationLootGenerator as any).getLooseLootMultiplerForLocation(locationName) * randomUtil.getNormallyDistributedRandomNumber(dynamicLootDist.spawnpointCount.mean, dynamicLootDist.spawnpointCount.std)); if (desiredSpawnpointCount > Mod.config.limits[locationName]) { desiredSpawnpointCount = Mod.config.limits[locationName]; } // Positions not in forced but have 100% chance to spawn - const guaranteedLoosePoints: Spawnpoint[] = []; + const guaranteedLoosePoints: ISpawnpoint[] = []; const blacklistedSpawnpoints = LocationConfig.looseLootBlacklist[locationName]; - const spawnpointArray = new ProbabilityObjectArray(mathUtil, jsonUtil); + const spawnpointArray = new ProbabilityObjectArray(mathUtil, jsonUtil); for (const spawnpoint of allDynamicSpawnpoints) { if (blacklistedSpawnpoints?.includes(spawnpoint.template.Id)) { @@ -200,7 +200,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { // Select a number of spawn points to add loot to // Add ALL loose loot with 100% chance to pool - let chosenSpawnpoints: Spawnpoint[] = [...guaranteedLoosePoints]; + let chosenSpawnpoints: ISpawnpoint[] = [...guaranteedLoosePoints]; const randomSpawnpointCount = desiredSpawnpointCount - chosenSpawnpoints.length; // Add randomly chosen spawn points @@ -274,7 +274,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { return loot; } - private createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: Spawnpoint = undefined): IContainerItem { + private createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: ISpawnpoint = undefined): IContainerItem { const objectId = Mod.container.resolve("ObjectId"); const presetHelper = Mod.container.resolve("PresetHelper"); const randomUtil = Mod.container.resolve("RandomUtil"); @@ -296,7 +296,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { let width = itemTemplate._props.Width; let height = itemTemplate._props.Height; - let items: Item[] = [ + let items: IItem[] = [ { _id: objectId.generate(), _tpl: tpl, @@ -317,7 +317,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { items.splice(0, 1); items.push(...itemWithChildren); } else { - let children: Item[] = []; + let children: IItem[] = []; const defaultPreset = this.cloner.clone(presetHelper.getDefaultPreset(tpl)); if (defaultPreset) { children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); @@ -344,7 +344,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { const weaponTemplate = this.itemHelper.getItem(tpl)[1]; // Create array with just magazine - const magazineWithCartridges: Item[] = []; + const magazineWithCartridges: IItem[] = []; magazineWithCartridges.push(magazine); this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, magTemplate, staticAmmoDist, weaponTemplate._props.ammoCaliber, LocationConfig.minFillStaticMagazinePercent / 100); @@ -365,7 +365,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MAGAZINE)) { if (randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { // Create array with just magazine - const magazineWithCartridges: Item[] = []; + const magazineWithCartridges: IItem[] = []; magazineWithCartridges.push(items[0]); this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, itemTemplate, staticAmmoDist, null, LocationConfig.minFillStaticMagazinePercent / 100); @@ -390,7 +390,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { } else if (this.itemHelper.armorItemCanHoldMods(tpl)) { const defaultPreset = presetHelper.getDefaultPreset(tpl); if (defaultPreset) { - const presetAndMods: Item[] = this.itemHelper.replaceIDs(defaultPreset._items); + const presetAndMods: IItem[] = this.itemHelper.replaceIDs(defaultPreset._items); this.itemHelper.remapRootItemId(presetAndMods); // Use original items parentId otherwise item doesnt get added to container correctly @@ -413,7 +413,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { private looseContainerItemFilterIndex: Record = {}; - private createLooseContainerLoot(tpl: string, id: string, staticAmmoDist: Record, modifier = 0.5): Item[] { + private createLooseContainerLoot(tpl: string, id: string, staticAmmoDist: Record, modifier = 0.5): IItem[] { const randomUtil = Mod.container.resolve("RandomUtil"); const mathUtil = Mod.container.resolve("MathUtil"); const jsonUtil = Mod.container.resolve("JsonUtil"); @@ -514,7 +514,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { itemArray.push(new ProbabilityObject(whitelist[i], weight[i])); } - const generatedItems: Item[] = []; + const generatedItems: IItem[] = []; while (true) { let cont: string; @@ -590,7 +590,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { valuables.push(item); } } - let point: Spawnpoint = { + let point: ISpawnpoint = { locationId: "(185.087, 6.554, 63.721)", probability: 0.25, template: { diff --git a/types/callbacks/BotCallbacks.d.ts b/types/callbacks/BotCallbacks.d.ts index 7d22dcf..909e93e 100644 --- a/types/callbacks/BotCallbacks.d.ts +++ b/types/callbacks/BotCallbacks.d.ts @@ -1,14 +1,16 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; import { BotController } from "@spt/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { Difficulties } from "@spt/models/eft/common/tables/IBotType"; +import { IDifficulties } from "@spt/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class BotCallbacks { protected botController: BotController; protected httpResponse: HttpResponseUtil; - constructor(botController: BotController, httpResponse: HttpResponseUtil); + protected applicationContext: ApplicationContext; + constructor(botController: BotController, httpResponse: HttpResponseUtil, applicationContext: ApplicationContext); /** * Handle singleplayer/settings/bot/limit * Is called by client to define each bot roles wave limit @@ -24,7 +26,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/difficulties * @returns dictionary of every bot and its diffiulty settings */ - getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData @@ -34,7 +36,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(url: string, info: any, sessionID: string): string; + getBotCap(url: string, info: IEmptyRequestData, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/types/callbacks/DataCallbacks.d.ts b/types/callbacks/DataCallbacks.d.ts index 41f1d0c..d92be66 100644 --- a/types/callbacks/DataCallbacks.d.ts +++ b/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,5 @@ import { HideoutController } from "@spt/controllers/HideoutController"; -import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderController } from "@spt/controllers/TraderController"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; @@ -7,7 +7,7 @@ import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomization import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IGetItemPricesResponse } from "@spt/models/eft/game/IGetItemPricesResponse"; import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutProductionData } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; @@ -23,9 +23,9 @@ export declare class DataCallbacks { protected timeUtil: TimeUtil; protected traderHelper: TraderHelper; protected databaseService: DatabaseService; - protected ragfairController: RagfairController; + protected traderController: TraderController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, traderController: TraderController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase @@ -62,7 +62,7 @@ export declare class DataCallbacks { */ getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getHideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/languages @@ -83,7 +83,6 @@ export declare class DataCallbacks { /** * Handle client/items/prices/ * Called when viewing a traders assorts - * TODO - fully implement this */ getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/DialogueCallbacks.d.ts b/types/callbacks/DialogueCallbacks.d.ts index baee279..e65749f 100644 --- a/types/callbacks/DialogueCallbacks.d.ts +++ b/types/callbacks/DialogueCallbacks.d.ts @@ -27,7 +27,7 @@ import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest" import { ISetDialogReadRequestData } from "@spt/models/eft/dialog/ISetDialogReadRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { DialogueInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile"; import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -48,11 +48,11 @@ export declare class DialogueCallbacks implements OnUpdate { */ getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/list */ - getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; + getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/view */ getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/info */ - getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; + getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/remove */ removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/pin */ diff --git a/types/callbacks/GameCallbacks.d.ts b/types/callbacks/GameCallbacks.d.ts index b41454f..e34bc41 100644 --- a/types/callbacks/GameCallbacks.d.ts +++ b/types/callbacks/GameCallbacks.d.ts @@ -76,10 +76,19 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle /client/report/send & /client/reports/lobby/send + * @returns INullResponseData + */ reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; + /** + * Handle /client/survey + * @returns INullResponseData + */ + getSurvey(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; } diff --git a/types/callbacks/HideoutCallbacks.d.ts b/types/callbacks/HideoutCallbacks.d.ts index fadab9b..d63bcd6 100644 --- a/types/callbacks/HideoutCallbacks.d.ts +++ b/types/callbacks/HideoutCallbacks.d.ts @@ -3,7 +3,9 @@ import { OnUpdate } from "@spt/di/OnUpdate"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData"; import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; +import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutDeleteProductionRequestData } from "@spt/models/eft/hideout/IHideoutDeleteProductionRequestData"; import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutPutItemInRequestData } from "@spt/models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "@spt/models/eft/hideout/IHideoutScavCaseStartRequestData"; @@ -75,6 +77,14 @@ export declare class HideoutCallbacks implements OnUpdate { * Handle client/game/profile/items/moving - HideoutCancelProductionCommand */ cancelProduction(pmcData: IPmcData, request: IHideoutCancelProductionRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart + */ + circleOfCultistProductionStart(pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutDeleteProductionCommand + */ + hideoutDeleteProductionCommand(pmcData: IPmcData, request: IHideoutDeleteProductionRequestData, sessionId: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/types/callbacks/InraidCallbacks.d.ts b/types/callbacks/InraidCallbacks.d.ts index dc6ede4..675403f 100644 --- a/types/callbacks/InraidCallbacks.d.ts +++ b/types/callbacks/InraidCallbacks.d.ts @@ -1,9 +1,8 @@ import { InraidController } from "@spt/controllers/InraidController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { IItemDeliveryRequestData } from "@spt/models/eft/inRaid/IItemDeliveryRequestData"; import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; +import { IScavSaveRequestData } from "@spt/models/eft/inRaid/IScavSaveRequestData"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests @@ -28,36 +27,12 @@ export declare class InraidCallbacks { * @param sessionID Session id * @returns Null http response */ - saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData; - /** - * Handle singleplayer/settings/raid/endstate - * @returns - */ - getRaidEndState(): string; + saveProgress(url: string, info: IScavSaveRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/raid/menu * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/airdrop/config - * @returns JSON as string - */ - getAirdropConfig(): string; - /** - * Handle singleplayer/btr/config - * @returns JSON as string - */ - getBTRConfig(): string; - /** - * Handle singleplayer/traderServices/getTraderServices - */ - getTraderServices(url: string, info: IEmptyRequestData, sessionId: string): string; - /** - * Handle singleplayer/traderServices/itemDelivery - */ - itemDelivery(url: string, request: IItemDeliveryRequestData, sessionId: string): INullResponseData; getTraitorScavHostileChance(url: string, info: IEmptyRequestData, sessionId: string): string; - getSandboxMaxPatrolValue(url: string, info: IEmptyRequestData, sessionId: string): string; getBossConvertSettings(url: string, info: IEmptyRequestData, sessionId: string): string; } diff --git a/types/callbacks/LocationCallbacks.d.ts b/types/callbacks/LocationCallbacks.d.ts index 2825050..f3ffea3 100644 --- a/types/callbacks/LocationCallbacks.d.ts +++ b/types/callbacks/LocationCallbacks.d.ts @@ -1,9 +1,9 @@ import { LocationController } from "@spt/controllers/LocationController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; -import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; -import { IGetLocationRequestData } from "@spt/models/eft/location/IGetLocationRequestData"; +import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class LocationCallbacks { protected httpResponse: HttpResponseUtil; @@ -11,8 +11,6 @@ export declare class LocationCallbacks { constructor(httpResponse: HttpResponseUtil, locationController: LocationController); /** Handle client/locations */ getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle client/location/getLocalloot */ - getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData; - /** Handle client/location/getAirdropLoot */ - getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string; + /** Handle client/airdrop/loot */ + getAirdropLoot(url: string, info: IGetAirdropLootRequest, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/MatchCallbacks.d.ts b/types/callbacks/MatchCallbacks.d.ts index 73f7564..b63c920 100644 --- a/types/callbacks/MatchCallbacks.d.ts +++ b/types/callbacks/MatchCallbacks.d.ts @@ -2,7 +2,7 @@ import { MatchController } from "@spt/controllers/MatchController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { IEndOfflineRaidRequestData } from "@spt/models/eft/match/IEndOfflineRaidRequestData"; +import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { IGroupCharacter } from "@spt/models/eft/match/IGroupCharacter"; import { IMatchGroupCurrentResponse } from "@spt/models/eft/match/IMatchGroupCurrentResponse"; @@ -15,6 +15,8 @@ import { IMatchGroupTransferRequest } from "@spt/models/eft/match/IMatchGroupTra import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResponse"; import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; @@ -45,8 +47,8 @@ export declare class MatchCallbacks { transferGroup(url: string, info: IMatchGroupTransferRequest, sessionId: string): IGetBodyResponseData; /** Handle client/match/group/invite/cancel-all */ cancelAllGroupInvite(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; - /** @deprecated - not called on raid start/end or game start/exit */ - putMetrics(url: string, info: IPutMetricsRequestData, sessionId: string): INullResponseData; + putMetrics(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData; + eventDisconnect(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; /** Handle match/group/start_game */ joinMatch(url: string, info: IMatchGroupStartGameRequest, sessionID: string): IGetBodyResponseData; @@ -63,8 +65,10 @@ export declare class MatchCallbacks { leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/player/remove */ removePlayerFromGroup(url: string, info: IMatchGroupPlayerRemoveRequest, sessionID: string): IGetBodyResponseData; - /** Handle client/match/offline/end */ - endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; + /** Handle client/match/local/start */ + startLocalRaid(url: string, info: IStartLocalRaidRequestData, sessionID: string): IGetBodyResponseData; + /** Handle client/match/local/end */ + endLocalRaid(url: string, info: IEndLocalRaidRequestData, sessionID: string): INullResponseData; /** Handle client/raid/configuration */ getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData; /** Handle client/raid/configuration-by-profile */ diff --git a/types/callbacks/ProfileCallbacks.d.ts b/types/callbacks/ProfileCallbacks.d.ts index ba35f5e..3824a8c 100644 --- a/types/callbacks/ProfileCallbacks.d.ts +++ b/types/callbacks/ProfileCallbacks.d.ts @@ -5,7 +5,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt/models/eft/launcher/IGetMiniProfileRequestData"; -import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; +import { IGetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { ICreateProfileResponse } from "@spt/models/eft/profile/ICreateProfileResponse"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; @@ -65,7 +65,7 @@ export declare class ProfileCallbacks { * Handle client/profile/status * Called when creating a character when choosing a character face/voice */ - getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/profile/view * Called when viewing another players profile diff --git a/types/callbacks/TraderCallbacks.d.ts b/types/callbacks/TraderCallbacks.d.ts index c081a9b..7bebe55 100644 --- a/types/callbacks/TraderCallbacks.d.ts +++ b/types/callbacks/TraderCallbacks.d.ts @@ -4,12 +4,15 @@ import { OnUpdate } from "@spt/di/OnUpdate"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { IModdedTraders } from "@spt/models/spt/config/ITraderConfig"; +import { ConfigServer } from "@spt/servers/ConfigServer"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; protected traderController: TraderController; + protected configServer: ConfigServer; constructor(httpResponse: HttpResponseUtil, // TODO: delay required - traderController: TraderController); + traderController: TraderController, configServer: ConfigServer); onLoad(): Promise; onUpdate(): Promise; getRoute(): string; @@ -19,4 +22,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/trading/api/getTraderAssort */ getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle /singleplayer/moddedTraders */ + getModdedTraderData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/WeatherCallbacks.d.ts b/types/callbacks/WeatherCallbacks.d.ts index 5ba5aab..ef5808f 100644 --- a/types/callbacks/WeatherCallbacks.d.ts +++ b/types/callbacks/WeatherCallbacks.d.ts @@ -2,6 +2,7 @@ import { WeatherController } from "@spt/controllers/WeatherController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { IWeatherData } from "@spt/models/eft/weather/IWeatherData"; +import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class WeatherCallbacks { protected httpResponse: HttpResponseUtil; @@ -12,4 +13,6 @@ export declare class WeatherCallbacks { * @returns IWeatherData */ getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle client/localGame/weather */ + getLocalWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/WishlistCallbacks.d.ts b/types/callbacks/WishlistCallbacks.d.ts index f5b500f..414eb91 100644 --- a/types/callbacks/WishlistCallbacks.d.ts +++ b/types/callbacks/WishlistCallbacks.d.ts @@ -1,12 +1,16 @@ import { WishlistController } from "@spt/controllers/WishlistController"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IWishlistActionData } from "@spt/models/eft/wishlist/IWishlistActionData"; +import { IAddToWishlistRequest } from "@spt/models/eft/wishlist/IAddToWishlistRequest"; +import { IChangeWishlistItemCategoryRequest } from "@spt/models/eft/wishlist/IChangeWishlistItemCategoryRequest"; +import { IRemoveFromWishlistRequest } from "@spt/models/eft/wishlist/IRemoveFromWishlistRequest"; export declare class WishlistCallbacks { protected wishlistController: WishlistController; constructor(wishlistController: WishlistController); /** Handle AddToWishList event */ - addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + addToWishlist(pmcData: IPmcData, request: IAddToWishlistRequest, sessionID: string): IItemEventRouterResponse; /** Handle RemoveFromWishList event */ - removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + removeFromWishlist(pmcData: IPmcData, request: IRemoveFromWishlistRequest, sessionID: string): IItemEventRouterResponse; + /** Handle ChangeWishlistItemCategory */ + changeWishlistItemCategory(pmcData: IPmcData, request: IChangeWishlistItemCategoryRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/types/context/ContextVariableType.d.ts b/types/context/ContextVariableType.d.ts index 0722a98..38facc6 100644 --- a/types/context/ContextVariableType.d.ts +++ b/types/context/ContextVariableType.d.ts @@ -7,5 +7,7 @@ export declare enum ContextVariableType { CLIENT_START_TIMESTAMP = 2, /** When player is loading into map and loot is requested */ REGISTER_PLAYER_REQUEST = 3, - RAID_ADJUSTMENTS = 4 + RAID_ADJUSTMENTS = 4, + /** Data returned from client request object from endLocalRaid() */ + TRANSIT_INFO = 5 } diff --git a/types/controllers/BotController.d.ts b/types/controllers/BotController.d.ts index 6431fca..a7cb6ae 100644 --- a/types/controllers/BotController.d.ts +++ b/types/controllers/BotController.d.ts @@ -5,12 +5,13 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { MinMax } from "@spt/models/common/MinMax"; -import { Condition, IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; +import { ICondition, IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; +import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -20,8 +21,8 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BotController { protected logger: ILogger; protected databaseService: DatabaseService; @@ -58,10 +59,11 @@ export declare class BotController { * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for + * @param raidConfig OPTIONAL - applicationContext Data stored at start of raid * @param ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getBotDifficulty(type: string, diffLevel: string, raidConfig?: IGetRaidConfigurationRequestData, ignoreRaidSettings?: boolean): IDifficultyCategories; getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache @@ -75,20 +77,27 @@ export declare class BotController { * @param request Bot generation request object * @param pmcProfile Player profile * @param sessionId Session id - * @returns + * @returns IBotBase[] + */ + protected generateMultipleBotsAndCache(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise; + protected getMostRecentRaidSettings(): IGetRaidConfigurationRequestData; + /** + * Get min/max level range values for a specific map + * @param location Map name e.g. factory4_day + * @returns MinMax */ - generateBotsFirstTime(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise; + protected getPmcLevelRangeForMap(location: string): MinMax; /** * Create a BotGenerationDetails for the bot generator to use * @param condition Client data defining bot type and difficulty * @param pmcProfile Player who is generating bots * @param allPmcsHaveSameNameAsPlayer Should all PMCs have same name as player - * @param pmcLevelRangeForMap Min/max levels for PMCs to generate within + * @param raidSettings Settings chosen pre-raid by player * @param botCountToGenerate How many bots to generate * @param generateAsPmc Force bot being generated a PMC * @returns BotGenerationDetails */ - protected getBotGenerationDetailsForWave(condition: Condition, pmcProfile: IPmcData, allPmcsHaveSameNameAsPlayer: boolean, pmcLevelRangeForMap: MinMax, botCountToGenerate: number, generateAsPmc: boolean): BotGenerationDetails; + protected getBotGenerationDetailsForWave(condition: ICondition, pmcProfile: IPmcData, allPmcsHaveSameNameAsPlayer: boolean, raidSettings: IGetRaidConfigurationRequestData, botCountToGenerate: number, generateAsPmc: boolean): IBotGenerationDetails; /** * Get players profile level * @param pmcProfile Profile to get level from @@ -102,7 +111,7 @@ export declare class BotController { * @param sessionId Session id * @returns A promise for the bots to be done generating */ - protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; + protected generateWithBotDetails(condition: ICondition, botGenerationDetails: IBotGenerationDetails, sessionId: string): Promise; /** * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with @@ -110,15 +119,16 @@ export declare class BotController { * @param cacheKey the cache key to store the bot with * @returns A promise for the bot to be stored */ - protected generateSingleBotAndStoreInCache(botGenerationDetails: BotGenerationDetails, sessionId: string, cacheKey: string): Promise; + protected generateSingleBotAndStoreInCache(botGenerationDetails: IBotGenerationDetails, sessionId: string, cacheKey: string): Promise; /** * Pull a single bot out of cache and return, if cache is empty add bots to it and then return * @param sessionId Session id * @param request Bot generation request object * @returns Single IBotBase object */ - returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): Promise; - protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: BotGenerationDetails, possibleBossTypeWeights: Record): void; + protected returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): Promise; + protected getPmcConversionMinMaxForLocation(requestedBotRole: string, location: string): MinMax; + protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: IBotGenerationDetails, possibleBossTypeWeights: Record): void; /** * Get the difficulty passed in, if its not "asonline", get selected difficulty from config * @param requestedDifficulty diff --git a/types/controllers/BuildController.d.ts b/types/controllers/BuildController.d.ts index ed8adf6..2cb9c59 100644 --- a/types/controllers/BuildController.d.ts +++ b/types/controllers/BuildController.d.ts @@ -9,8 +9,8 @@ import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BuildController { protected logger: ILogger; protected hashUtil: HashUtil; diff --git a/types/controllers/CustomizationController.d.ts b/types/controllers/CustomizationController.d.ts index 028341a..8aef9e9 100644 --- a/types/controllers/CustomizationController.d.ts +++ b/types/controllers/CustomizationController.d.ts @@ -1,7 +1,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { ISuit } from "@spt/models/eft/common/tables/ITrader"; -import { ClothingItem, IBuyClothingRequestData } from "@spt/models/eft/customization/IBuyClothingRequestData"; +import { IBuyClothingRequestData, IPaymentItemForClothing } from "@spt/models/eft/customization/IBuyClothingRequestData"; import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -54,17 +54,17 @@ export declare class CustomizationController { * Update output object and player profile with purchase details * @param sessionId Session id * @param pmcData Player profile - * @param clothingItems Clothing purchased + * @param itemsToPayForClothingWith Clothing purchased * @param output Client response */ - protected payForClothingItems(sessionId: string, pmcData: IPmcData, clothingItems: ClothingItem[], output: IItemEventRouterResponse): void; + protected payForClothingItems(sessionId: string, pmcData: IPmcData, itemsToPayForClothingWith: IPaymentItemForClothing[], output: IItemEventRouterResponse): void; /** * Update output object and player profile with purchase details for single piece of clothing * @param sessionId Session id * @param pmcData Player profile - * @param clothingItem Clothing item purchased + * @param paymentItemDetails Payment details * @param output Client response */ - protected payForClothingItem(sessionId: string, pmcData: IPmcData, clothingItem: ClothingItem, output: IItemEventRouterResponse): void; + protected payForClothingItem(sessionId: string, pmcData: IPmcData, paymentItemDetails: IPaymentItemForClothing, output: IItemEventRouterResponse): void; protected getAllTraderSuits(sessionID: string): ISuit[]; } diff --git a/types/controllers/DialogueController.d.ts b/types/controllers/DialogueController.d.ts index c15d724..2f00b13 100644 --- a/types/controllers/DialogueController.d.ts +++ b/types/controllers/DialogueController.d.ts @@ -7,7 +7,7 @@ import { IGetFriendListDataResponse } from "@spt/models/eft/dialog/IGetFriendLis import { IGetMailDialogViewRequestData } from "@spt/models/eft/dialog/IGetMailDialogViewRequestData"; import { IGetMailDialogViewResponseData } from "@spt/models/eft/dialog/IGetMailDialogViewResponseData"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; -import { Dialogue, DialogueInfo, ISptProfile, IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IDialogueInfo, IMessage, ISptProfile, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -40,14 +40,14 @@ export declare class DialogueController { * @param sessionID Session Id * @returns array of dialogs */ - generateDialogueList(sessionID: string): DialogueInfo[]; + generateDialogueList(sessionID: string): IDialogueInfo[]; /** * Get the content of a dialogue * @param dialogueID Dialog id * @param sessionID Session Id * @returns DialogueInfo */ - getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; + getDialogueInfo(dialogueID: string, sessionID: string): IDialogueInfo; /** * Get the users involved in a dialog (player + other party) * @param dialog The dialog to check for users @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; + getDialogueUsers(dialog: IDialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -72,7 +72,7 @@ export declare class DialogueController { * @param request get dialog request (params used when dialog doesnt exist in profile) * @returns Dialogue */ - protected getDialogByIdFromProfile(profile: ISptProfile, request: IGetMailDialogViewRequestData): Dialogue; + protected getDialogByIdFromProfile(profile: ISptProfile, request: IGetMailDialogViewRequestData): IDialogue; /** * Get the users involved in a mail between two entities * @param fullProfile Player profile @@ -92,7 +92,7 @@ export declare class DialogueController { * @param messages Messages to check * @returns true if uncollected rewards found */ - protected messagesHaveUncollectedRewards(messages: Message[]): boolean; + protected messagesHaveUncollectedRewards(messages: IMessage[]): boolean; /** * Handle client/mail/dialog/remove * Remove an entire dialog with an entity (trader/user) @@ -125,13 +125,13 @@ export declare class DialogueController { * @param dialogueId Dialog to get mail attachments from * @returns Message array */ - protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[]; + protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): IMessage[]; /** * Return array of messages with uncollected items (includes expired) * @param messages Messages to parse * @returns messages with items to collect */ - protected getMessagesWithAttachments(messages: Message[]): Message[]; + protected getMessagesWithAttachments(messages: IMessage[]): IMessage[]; /** * Delete expired items from all messages in player profile. triggers when updating traders. * @param sessionId Session id @@ -148,7 +148,7 @@ export declare class DialogueController { * @param message Message to check expiry of * @returns true or false */ - protected messageHasExpired(message: Message): boolean; + protected messageHasExpired(message: IMessage): boolean; /** Handle client/friend/request/send */ sendFriendRequest(sessionID: string, request: IFriendRequestData): IFriendRequestSendResponse; } diff --git a/types/controllers/GameController.d.ts b/types/controllers/GameController.d.ts index 533a81c..dbcbce2 100644 --- a/types/controllers/GameController.d.ts +++ b/types/controllers/GameController.d.ts @@ -1,6 +1,7 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; import { HideoutHelper } from "@spt/helpers/HideoutHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; +import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; @@ -34,10 +35,10 @@ import { ProfileActivityService } from "@spt/services/ProfileActivityService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class GameController { protected logger: ILogger; protected databaseService: DatabaseService; @@ -45,6 +46,7 @@ export declare class GameController { protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; protected httpServerHelper: HttpServerHelper; + protected inventoryHelper: InventoryHelper; protected randomUtil: RandomUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -68,12 +70,13 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, inventoryHelper: InventoryHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected migrate39xProfile(fullProfile: ISptProfile): void; protected adjustHideoutCraftTimes(overrideSeconds: number): void; /** * Adjust all hideout craft times to be no higher than the override diff --git a/types/controllers/HealthController.d.ts b/types/controllers/HealthController.d.ts index 5482283..5a0a0a6 100644 --- a/types/controllers/HealthController.d.ts +++ b/types/controllers/HealthController.d.ts @@ -12,8 +12,8 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class HealthController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; diff --git a/types/controllers/HideoutController.d.ts b/types/controllers/HideoutController.d.ts index e9d1ed9..4a92504 100644 --- a/types/controllers/HideoutController.d.ts +++ b/types/controllers/HideoutController.d.ts @@ -6,12 +6,13 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { HideoutArea, ITaskConditionCounter, Product } from "@spt/models/eft/common/tables/IBotBase"; -import { HideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/HideoutUpgradeCompleteRequestData"; +import { IBotHideoutArea, IProduct, ITaskConditionCounter } from "@spt/models/eft/common/tables/IBotBase"; import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData"; -import { IHideoutArea, Stage } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutArea, IStage } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; +import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutDeleteProductionRequestData } from "@spt/models/eft/hideout/IHideoutDeleteProductionRequestData"; import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutPutItemInRequestData } from "@spt/models/eft/hideout/IHideoutPutItemInRequestData"; @@ -20,8 +21,9 @@ import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideou import { IHideoutTakeItemOutRequestData } from "@spt/models/eft/hideout/IHideoutTakeItemOutRequestData"; import { IHideoutTakeProductionRequestData } from "@spt/models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutToggleAreaRequestData } from "@spt/models/eft/hideout/IHideoutToggleAreaRequestData"; +import { IHideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeCompleteRequestData"; import { IHideoutUpgradeRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeRequestData"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; +import { IQteData, IQteResult } from "@spt/models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "@spt/models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; @@ -30,16 +32,17 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { CircleOfCultistService } from "@spt/services/CircleOfCultistService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; import { ProfileActivityService } from "@spt/services/ProfileActivityService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class HideoutController { protected logger: ILogger; protected hashUtil: HashUtil; @@ -61,11 +64,12 @@ export declare class HideoutController { protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected fenceService: FenceService; + protected circleOfCultistService: CircleOfCultistService; protected cloner: ICloner; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, circleOfCultistService: CircleOfCultistService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade @@ -83,12 +87,12 @@ export declare class HideoutController { * @param sessionID Session id * @param output Client response */ - upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): void; + upgradeComplete(pmcData: IPmcData, request: IHideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): void; /** * Upgrade wall status to visible in profile if medstation/water collector are both level 1 * @param pmcData Player profile */ - protected checkAndUpgradeWall(pmcData: IPmcData): void; + protected SetWallVisibleIfPrereqsMet(pmcData: IPmcData): void; /** * @param pmcData Profile to edit * @param output Object to send back to client @@ -97,14 +101,23 @@ export declare class HideoutController { * @param dbHideoutArea Hideout area being upgraded * @param hideoutStage Stage hideout area is being upgraded to */ - protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: IBotHideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: IStage): void; + /** + * Add stand1/stand2/stand3 inventory items to profile, depending on passed in hideout stage + * @param sessionId Session id + * @param equipmentPresetStage Current EQUIPMENT_PRESETS_STAND stage data + * @param pmcData Player profile + * @param equipmentPresetHideoutArea + * @param output Response to send back to client + */ + protected addMissingPresetStandItemsToProfile(sessionId: string, equipmentPresetStage: IStage, pmcData: IPmcData, equipmentPresetHideoutArea: IHideoutArea, output: IItemEventRouterResponse): void; /** * Add an inventory item to profile from a hideout area stage data * @param pmcData Profile to update - * @param dbHideoutData Hideout area from db being upgraded + * @param dbHideoutArea Hideout area from db being upgraded * @param hideoutStage Stage area upgraded to */ - protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + protected addUpdateInventoryItemToProfile(sessionId: string, pmcData: IPmcData, dbHideoutArea: IHideoutArea, hideoutStage: IStage): void; /** * @param output Object to send to client * @param sessionID Session/player id @@ -112,7 +125,7 @@ export declare class HideoutController { * @param hideoutDbData Hideout area that caused addition of stash * @param hideoutStage Hideout area upgraded to this */ - protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; + protected addContainerUpgradeToClientOutput(sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: IStage, output: IItemEventRouterResponse): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory @@ -140,7 +153,7 @@ export declare class HideoutController { * @param hideoutArea Area fuel is being removed from * @returns IItemEventRouterResponse response */ - protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; + protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: IBotHideoutArea): IItemEventRouterResponse; /** * Handle HideoutToggleArea event * Toggle area on/off @@ -182,7 +195,7 @@ export declare class HideoutController { * @param rewards reward items to add to profile * @param recipeId recipe id to save into Production dict */ - protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipeId: string): void; + protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: IProduct[], recipeId: string): void; /** * Start production of continuously created item * @param pmcData Player profile @@ -239,6 +252,12 @@ export declare class HideoutController { * @param request QTE result object */ handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData, output: IItemEventRouterResponse): void; + /** + * Apply mild/severe muscle pain after gym use + * @param pmcData Profile to apply effect to + * @param finishEffect Effect data to apply after completing QTE gym event + */ + protected handleMusclePain(pmcData: IPmcData, finishEffect: IQteResult): void; /** * Record a high score from the shooting range into a player profiles overallcounters * @param sessionId Session id @@ -263,7 +282,22 @@ export declare class HideoutController { */ cancelProduction(sessionId: string, pmcData: IPmcData, request: IHideoutCancelProductionRequestData): IItemEventRouterResponse; /** - * Function called every x seconds as part of onUpdate event + * Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart + * @param sessionId Session id + * @param pmcData Profile of crafter + * @param request Request data + */ + circleOfCultistProductionStart(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse; + /** + * Handle HideoutDeleteProductionCommand event + * @param sessionId Session id + * @param pmcData Player profile + * @param request Client request data + * @returns IItemEventRouterResponse + */ + hideoutDeleteProductionCommand(sessionId: string, pmcData: IPmcData, request: IHideoutDeleteProductionRequestData): IItemEventRouterResponse; + /** + * Function called every `hideoutConfig.runIntervalSeconds` seconds as part of onUpdate event */ update(): void; } diff --git a/types/controllers/InraidController.d.ts b/types/controllers/InraidController.d.ts index 87f419b..8f0bfc1 100644 --- a/types/controllers/InraidController.d.ts +++ b/types/controllers/InraidController.d.ts @@ -1,70 +1,26 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; -import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; -import { HealthHelper } from "@spt/helpers/HealthHelper"; -import { InRaidHelper } from "@spt/helpers/InRaidHelper"; -import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { QuestHelper } from "@spt/helpers/QuestHelper"; -import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; -import { PlayerRaidEndState } from "@spt/models/enums/PlayerRaidEndState"; -import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; -import { IBTRConfig } from "@spt/models/spt/config/IBTRConfig"; -import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { IScavSaveRequestData } from "@spt/models/eft/inRaid/IScavSaveRequestData"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; -import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; -import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; -import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; -import { DatabaseService } from "@spt/services/DatabaseService"; -import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { MailSendService } from "@spt/services/MailSendService"; -import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; -import { PmcChatResponseService } from "@spt/services/PmcChatResponseService"; -import { TraderServicesService } from "@spt/services/TraderServicesService"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; -import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; /** * Logic for handling In Raid callbacks */ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; - protected timeUtil: TimeUtil; - protected databaseService: DatabaseService; - protected pmcChatResponseService: PmcChatResponseService; - protected matchBotDetailsCacheService: MatchBotDetailsCacheService; - protected questHelper: QuestHelper; - protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; - protected playerScavGenerator: PlayerScavGenerator; - protected healthHelper: HealthHelper; - protected traderHelper: TraderHelper; - protected traderServicesService: TraderServicesService; protected localisationService: LocalisationService; - protected insuranceService: InsuranceService; - protected inRaidHelper: InRaidHelper; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; - protected mailSendService: MailSendService; - protected randomUtil: RandomUtil; - protected airdropConfig: IAirdropConfig; - protected btrConfig: IBTRConfig; protected inRaidConfig: IInRaidConfig; - protected traderConfig: ITraderConfig; - protected locationConfig: ILocationConfig; - protected ragfairConfig: IRagfairConfig; - protected hideoutConfig: IHideoutConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, localisationService: LocalisationService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id @@ -78,118 +34,12 @@ export declare class InraidController { * @param offraidData post-raid request data * @param sessionID Session id */ - savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void; - /** - * Handle updating player profile post-pmc raid - * @param sessionID Session id - * @param postRaidRequest Post-raid data - */ - protected savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void; - /** - * Make changes to PMC profile after they've died in raid, - * Alter body part hp, handle insurance, delete inventory items, remove carried quest items - * @param postRaidSaveRequest Post-raid save request - * @param pmcData Pmc profile - * @param sessionID Session id - * @returns Updated profile object - */ - protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, sessionID: string): IPmcData; - /** - * Adjust player characters body part hp post-raid - * @param postRaidSaveRequest post raid data - * @param pmcData player profile - */ - protected updatePmcHealthPostRaid(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData): void; - /** - * Reduce body part hp to % of max - * @param pmcData profile to edit - * @param multiplier multiplier to apply to max health - */ - protected reducePmcHealthToPercent(pmcData: IPmcData, multiplier: number): void; - /** - * Handle updating the profile post-pscav raid - * @param sessionID Session id - * @param postRaidRequest Post-raid data of raid - */ - protected savePlayerScavProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void; - /** - * merge two dictionaries together - * Prioritise pair that has true as a value - * @param primary main dictionary - * @param secondary Secondary dictionary - */ - protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void; - /** - * Post-scav-raid any charisma increase must be propigated into PMC profile - * @param postRaidServerScavProfile Scav profile after adjustments made from raid - * @param postRaidServerPmcProfile Pmc profile after raid - * @param preRaidScavCharismaProgress charisma progress value pre-raid - */ - protected updatePmcCharismaSkillPostScavRaid(postRaidServerScavProfile: IPmcData, postRaidServerPmcProfile: IPmcData, preRaidScavCharismaProgress: number): void; - /** - * Does provided profile contain any condition counters - * @param profile Profile to check for condition counters - * @returns Profile has condition counters - */ - protected profileHasConditionCounters(profile: IPmcData): boolean; - /** - * Scav quest progress isnt transferred automatically from scav to pmc, we do this manually - * @param scavProfile Scav profile with quest progress post-raid - * @param pmcProfile Server pmc profile to copy scav quest progress into - */ - protected migrateScavQuestProgressToPmcProfile(scavProfile: IPmcData, pmcProfile: IPmcData): void; - /** - * Is the player dead after a raid - dead is anything other than "survived" / "runner" - * @param statusOnExit exit value from offraidData object - * @returns true if dead - */ - protected isPlayerDead(statusOnExit: PlayerRaidEndState): boolean; - /** - * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them - * @param offraidData Save Progress Request - */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; - /** - * Update profile after player completes scav raid - * @param scavData Scav profile - * @param sessionID Session id - * @param offraidData Post-raid save request - * @param pmcData Pmc profile - * @param isDead Is player dead - */ - protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; - /** - * Update profile with scav karma values based on in-raid actions - * @param pmcData Pmc profile - * @param offraidData Post-raid save request - * @param scavData Scav profile - */ - protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData): void; + savePostRaidProfileForScav(offraidData: IScavSaveRequestData, sessionID: string): void; /** * Get the inraid config from configs/inraid.json * @returns InRaid Config */ getInraidConfig(): IInRaidConfig; - /** - * Get airdrop config from configs/airdrop.json - * @returns Airdrop config - */ - getAirdropConfig(): IAirdropConfig; - /** - * Get BTR config from configs/btr.json - * @returns Airdrop config - */ - getBTRConfig(): IBTRConfig; - /** - * Handle singleplayer/traderServices/getTraderServices - * @returns Trader services data - */ - getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[]; - /** - * Handle singleplayer/traderServices/itemDelivery - */ - itemDelivery(sessionId: string, traderId: string, items: Item[]): void; getTraitorScavHostileChance(url: string, sessionID: string): number; - getSandboxMaxPatrolValue(url: string, sessionID: string): number; getBossConvertSettings(url: string, sessionId: string): string[]; } diff --git a/types/controllers/InsuranceController.d.ts b/types/controllers/InsuranceController.d.ts index f921b83..2701622 100644 --- a/types/controllers/InsuranceController.d.ts +++ b/types/controllers/InsuranceController.d.ts @@ -4,12 +4,12 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt/models/eft/insurance/IGetInsuranceCostRequestData"; import { IGetInsuranceCostResponseData } from "@spt/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance } from "@spt/models/eft/profile/ISptProfile"; +import { IInsurance } from "@spt/models/eft/profile/ISptProfile"; import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; @@ -21,11 +21,11 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PaymentService } from "@spt/services/PaymentService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { MathUtil } from "@spt/utils/MathUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -68,7 +68,7 @@ export declare class InsuranceController { * @param time The time to check ready status against. Current time by default. * @returns All insured items that are ready to be processed. */ - protected filterInsuredItems(sessionID: string, time?: number): Insurance[]; + protected filterInsuredItems(sessionID: string, time?: number): IInsurance[]; /** * This method orchestrates the processing of insured items in a profile. * @@ -76,13 +76,13 @@ export declare class InsuranceController { * @param sessionID The session ID that should receive the processed items. * @returns void */ - protected processInsuredItems(insuranceDetails: Insurance[], sessionID: string): void; + protected processInsuredItems(insuranceDetails: IInsurance[], sessionID: string): void; /** * Count all items in all insurance packages. * @param insurance * @returns */ - protected countAllInsuranceItems(insurance: Insurance[]): number; + protected countAllInsuranceItems(insurance: IInsurance[]): number; /** * Remove an insurance package from a profile using the package's system data information. * @@ -90,7 +90,7 @@ export declare class InsuranceController { * @param index The array index of the insurance package to remove. * @returns void */ - protected removeInsurancePackageFromProfile(sessionID: string, insPackage: Insurance): void; + protected removeInsurancePackageFromProfile(sessionID: string, insPackage: IInsurance): void; /** * Finds the items that should be deleted based on the given Insurance object. * @@ -98,7 +98,7 @@ export declare class InsuranceController { * @param insured - The insurance object containing the items to evaluate for deletion. * @returns A Set containing the IDs of items that should be deleted. */ - protected findItemsToDelete(rootItemParentID: string, insured: Insurance): Set; + protected findItemsToDelete(rootItemParentID: string, insured: IInsurance): Set; /** * Initialize a Map object that holds main-parents to all of their attachments. Note that "main-parent" in this * context refers to the parent item that an attachment is attached to. For example, a suppressor attached to a gun, @@ -109,7 +109,7 @@ export declare class InsuranceController { * @param itemsMap - A Map object for quick item look-up by item ID. * @returns A Map object containing parent item IDs to arrays of their attachment items. */ - protected populateParentAttachmentsMap(rootItemParentID: string, insured: Insurance, itemsMap: Map): Map; + protected populateParentAttachmentsMap(rootItemParentID: string, insured: IInsurance, itemsMap: Map): Map; /** * Remove attachments that can not be moddable in-raid from the parentAttachmentsMap. If no moddable attachments * remain, the parent is removed from the map as well. @@ -118,7 +118,7 @@ export declare class InsuranceController { * @param itemsMap - A Map object for quick item look-up by item ID. * @returns A Map object containing parent item IDs to arrays of their attachment items which are not moddable in-raid. */ - protected removeNonModdableAttachments(parentAttachmentsMap: Map, itemsMap: Map): Map; + protected removeNonModdableAttachments(parentAttachmentsMap: Map, itemsMap: Map): Map; /** * Process "regular" insurance items. Any insured item that is not an attached, attachment is considered a "regular" * item. This method iterates over them, preforming item deletion rolls to see if they should be deleted. If so, @@ -129,7 +129,7 @@ export declare class InsuranceController { * @param parentAttachmentsMap A Map object containing parent item IDs to arrays of their attachment items. * @returns void */ - protected processRegularItems(insured: Insurance, toDelete: Set, parentAttachmentsMap: Map): void; + protected processRegularItems(insured: IInsurance, toDelete: Set, parentAttachmentsMap: Map): void; /** * Process parent items and their attachments, updating the toDelete Set accordingly. * @@ -138,7 +138,7 @@ export declare class InsuranceController { * @param traderId The trader ID from the Insurance object. * @param toDelete A Set object to keep track of items marked for deletion. */ - protected processAttachments(mainParentToAttachmentsMap: Map, itemsMap: Map, traderId: string, toDelete: Set): void; + protected processAttachments(mainParentToAttachmentsMap: Map, itemsMap: Map, traderId: string, toDelete: Set): void; /** * Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by * their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the @@ -150,9 +150,9 @@ export declare class InsuranceController { * @param toDelete The array that accumulates the IDs of the items to be deleted. * @returns void */ - protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; - protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; - protected weightAttachmentsByPrice(attachments: Item[]): Record; + protected processAttachmentByParent(attachments: IItem[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: IItem[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: IItem[]): Record; /** * Get count of items to remove from weapon (take into account trader + price of attachment) * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price @@ -167,7 +167,7 @@ export declare class InsuranceController { * @param toDelete The items that should be deleted. * @returns void */ - protected removeItemsFromInsurance(insured: Insurance, toDelete: Set): void; + protected removeItemsFromInsurance(insured: IInsurance, toDelete: Set): void; /** * Handle sending the insurance message to the user that potentially contains the valid insurance items. * @@ -175,7 +175,7 @@ export declare class InsuranceController { * @param insurance The context of insurance to use. * @returns void */ - protected sendMail(sessionID: string, insurance: Insurance): void; + protected sendMail(sessionID: string, insurance: IInsurance): void; /** * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. @@ -184,7 +184,7 @@ export declare class InsuranceController { * @param insuredItem Optional. The item to roll for. Only used for logging. * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; + protected rollForDelete(traderId: string, insuredItem?: IItem): boolean | undefined; /** * Handle Insure event * Add insurance to an item @@ -195,6 +195,14 @@ export declare class InsuranceController { * @returns IItemEventRouterResponse object to send to client */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Insure softinserts of Armor that has softinsert slots + * Allows armors to come back after being lost correctly + * @param item Armor item to be insured + * @param pmcData Player profile + * @param body Insurance request data + */ + insureSoftInserts(item: IItem, pmcData: IPmcData, body: IInsureRequestData): void; /** * Handle client/insurance/items/list/cost * Calculate insurance cost diff --git a/types/controllers/InventoryController.d.ts b/types/controllers/InventoryController.d.ts index 40bb084..c986ce8 100644 --- a/types/controllers/InventoryController.d.ts +++ b/types/controllers/InventoryController.d.ts @@ -37,10 +37,10 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MapMarkerService } from "@spt/services/MapMarkerService"; import { PlayerService } from "@spt/services/PlayerService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class InventoryController { protected logger: ILogger; protected hashUtil: HashUtil; diff --git a/types/controllers/LauncherController.d.ts b/types/controllers/LauncherController.d.ts index 789fc00..3a715da 100644 --- a/types/controllers/LauncherController.d.ts +++ b/types/controllers/LauncherController.d.ts @@ -5,7 +5,7 @@ import { IChangeRequestData } from "@spt/models/eft/launcher/IChangeRequestData" import { ILoginRequestData } from "@spt/models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "@spt/models/eft/launcher/IRegisterData"; import { IConnectResponse } from "@spt/models/eft/profile/IConnectResponse"; -import { Info, ModDetails } from "@spt/models/eft/profile/ISptProfile"; +import { IModDetails, Info } from "@spt/models/eft/profile/ISptProfile"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -61,5 +61,5 @@ export declare class LauncherController { * @param sessionId Player id * @returns Array of mod details */ - getServerModsProfileUsed(sessionId: string): ModDetails[]; + getServerModsProfileUsed(sessionId: string): IModDetails[]; } diff --git a/types/controllers/LocationController.d.ts b/types/controllers/LocationController.d.ts index 727a8c8..1321d63 100644 --- a/types/controllers/LocationController.d.ts +++ b/types/controllers/LocationController.d.ts @@ -1,57 +1,20 @@ -import { ApplicationContext } from "@spt/context/ApplicationContext"; -import { LocationGenerator } from "@spt/generators/LocationGenerator"; -import { LootGenerator } from "@spt/generators/LootGenerator"; -import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; -import { IAirdropLootResult } from "@spt/models/eft/location/IAirdropLootResult"; -import { IGetLocationRequestData } from "@spt/models/eft/location/IGetLocationRequestData"; -import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; -import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; +import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { AirdropService } from "@spt/services/AirdropService"; import { DatabaseService } from "@spt/services/DatabaseService"; -import { ItemFilterService } from "@spt/services/ItemFilterService"; -import { LocalisationService } from "@spt/services/LocalisationService"; -import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; import { ICloner } from "@spt/utils/cloners/ICloner"; -import { HashUtil } from "@spt/utils/HashUtil"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class LocationController { - protected hashUtil: HashUtil; - protected randomUtil: RandomUtil; - protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; - protected locationGenerator: LocationGenerator; - protected localisationService: LocalisationService; - protected raidTimeAdjustmentService: RaidTimeAdjustmentService; - protected itemFilterService: ItemFilterService; - protected lootGenerator: LootGenerator; protected databaseService: DatabaseService; - protected timeUtil: TimeUtil; + protected airdropService: AirdropService; protected configServer: ConfigServer; - protected applicationContext: ApplicationContext; protected cloner: ICloner; - protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); - /** - * Handle client/location/getLocalloot - * Get a location (map) with generated loot data - * @param sessionId Player id - * @param request Map request to generate - * @returns ILocationBase - */ - get(sessionId: string, request: IGetLocationRequestData): ILocationBase; - /** - * Generate a maps base location and loot - * @param name Map name - * @returns ILocationBase - */ - protected generate(name: string): ILocationBase; + constructor(logger: ILogger, databaseService: DatabaseService, airdropService: AirdropService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/locations * Get all maps base location properties without loot data @@ -59,22 +22,6 @@ export declare class LocationController { * @returns ILocationsGenerateAllResponse */ generateAll(sessionId: string): ILocationsGenerateAllResponse; - /** - * Handle client/location/getAirdropLoot - * Get loot for an airdrop container - * Generates it randomly based on config/airdrop.json values - * @returns Array of LootItem objects - */ - getAirdropLoot(): IAirdropLootResult; - /** - * Randomly pick a type of airdrop loot using weighted values from config - * @returns airdrop type value - */ - protected chooseAirdropType(): AirdropTypeEnum; - /** - * Get the configuration for a specific type of airdrop - * @param airdropType Type of airdrop to get settings for - * @returns LootRequest - */ - protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest; + /** Handle client/airdrop/loot */ + getAirdropLoot(request: IGetAirdropLootRequest): IGetAirdropLootResponse; } diff --git a/types/controllers/MatchController.d.ts b/types/controllers/MatchController.d.ts index c08ebb0..7e6a34e 100644 --- a/types/controllers/MatchController.d.ts +++ b/types/controllers/MatchController.d.ts @@ -1,50 +1,31 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; -import { LootGenerator } from "@spt/generators/LootGenerator"; -import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IEndOfflineRaidRequestData } from "@spt/models/eft/match/IEndOfflineRaidRequestData"; +import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { IMatchGroupStartGameRequest } from "@spt/models/eft/match/IMatchGroupStartGameRequest"; import { IMatchGroupStatusRequest } from "@spt/models/eft/match/IMatchGroupStatusRequest"; import { IMatchGroupStatusResponse } from "@spt/models/eft/match/IMatchGroupStatusResponse"; import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResponse"; -import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { IMatchConfig } from "@spt/models/spt/config/IMatchConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; -import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; -import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; -import { BotLootCacheService } from "@spt/services/BotLootCacheService"; -import { MailSendService } from "@spt/services/MailSendService"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { MatchLocationService } from "@spt/services/MatchLocationService"; -import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; -import { HashUtil } from "@spt/utils/HashUtil"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class MatchController { protected logger: ILogger; protected saveServer: SaveServer; - protected timeUtil: TimeUtil; - protected randomUtil: RandomUtil; - protected hashUtil: HashUtil; - protected profileHelper: ProfileHelper; protected matchLocationService: MatchLocationService; - protected traderHelper: TraderHelper; - protected botLootCacheService: BotLootCacheService; protected configServer: ConfigServer; - protected profileSnapshotService: ProfileSnapshotService; - protected botGenerationCacheService: BotGenerationCacheService; - protected mailSendService: MailSendService; - protected lootGenerator: LootGenerator; protected applicationContext: ApplicationContext; + protected locationLifecycleService: LocationLifecycleService; + protected cloner: ICloner; protected matchConfig: IMatchConfig; - protected inRaidConfig: IInRaidConfig; - protected traderConfig: ITraderConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, lootGenerator: LootGenerator, applicationContext: ApplicationContext); + constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); getEnabled(): boolean; /** Handle client/match/group/delete */ deleteGroup(info: any): void; @@ -57,48 +38,15 @@ export declare class MatchController { * @param request Raid config request * @param sessionID Session id */ - startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; + configureOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; /** * Convert a difficulty value from pre-raid screen to a bot difficulty * @param botDifficulty dropdown difficulty value * @returns bot difficulty */ protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string; - /** Handle client/match/offline/end */ - endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void; - /** - * Did player take a COOP extract - * @param extractName Name of extract player took - * @returns True if coop extract - */ - protected extractWasViaCoop(extractName: string): boolean; - protected sendCoopTakenFenceMessage(sessionId: string): void; - /** - * Handle when a player extracts using a coop extract - add rep to fence - * @param sessionId Session/player id - * @param pmcData Profile - * @param extractName Name of extract taken - */ - protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; - /** - * Was extract by car - * @param extractName name of extract - * @returns true if car extract - */ - protected extractWasViaCar(extractName: string): boolean; - /** - * Handle when a player extracts using a car - Add rep to fence - * @param extractName name of the extract used - * @param pmcData Player profile - * @param sessionId Session id - */ - protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void; - /** - * Get the fence rep gain from using a car or coop extract - * @param pmcData Profile - * @param baseGain amount gained for the first extract - * @param extractCount Number of times extract was taken - * @returns Fence standing after taking extract - */ - protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number; + /** Handle client/match/local/start */ + startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData; + /** Handle client/match/local/end */ + endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void; } diff --git a/types/controllers/ProfileController.d.ts b/types/controllers/ProfileController.d.ts index e8dae73..71fd9e6 100644 --- a/types/controllers/ProfileController.d.ts +++ b/types/controllers/ProfileController.d.ts @@ -7,7 +7,7 @@ import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; -import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; +import { IGetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; @@ -26,9 +26,9 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; @@ -117,7 +117,7 @@ export declare class ProfileController { /** * Handle client/profile/status */ - getProfileStatus(sessionId: string): GetProfileStatusResponseData; + getProfileStatus(sessionId: string): IGetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; /** * Handle client/profile/settings diff --git a/types/controllers/QuestController.d.ts b/types/controllers/QuestController.d.ts index 3cdce00..270a70a 100644 --- a/types/controllers/QuestController.d.ts +++ b/types/controllers/QuestController.d.ts @@ -6,7 +6,7 @@ import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IQuestStatus } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -23,9 +23,9 @@ import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { PlayerService } from "@spt/services/PlayerService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class QuestController { protected logger: ILogger; protected timeUtil: TimeUtil; @@ -72,6 +72,13 @@ export declare class QuestController { * @returns Client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param questConditions Conditions to iterate over and possibly add to profile + * @param pmcData Profile to add to + * @param questId Quest conditions came from + */ + protected addTaskConditionCountersToProfile(questConditions: IQuestCondition[], pmcData: IPmcData, questId: string): void; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -127,7 +134,7 @@ export declare class QuestController { * @param completedQuestId Completed quest id * @param questRewards Rewards given to player */ - protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Item[]): void; + protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: IItem[]): void; /** * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile * @param pmcData Player profile to update @@ -167,7 +174,7 @@ export declare class QuestController { * @param output Response to send to user * @returns IItemEventRouterResponse */ - protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: IQuestCondition, output: IItemEventRouterResponse): IItemEventRouterResponse; + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: IItem, handoverRequirements: IQuestCondition, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/types/controllers/RagfairController.d.ts b/types/controllers/RagfairController.d.ts index fbd25e0..978558b 100644 --- a/types/controllers/RagfairController.d.ts +++ b/types/controllers/RagfairController.d.ts @@ -10,11 +10,11 @@ import { RagfairSellHelper } from "@spt/helpers/RagfairSellHelper"; import { RagfairSortHelper } from "@spt/helpers/RagfairSortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -import { IAddOfferRequestData, Requirement } from "@spt/models/eft/ragfair/IAddOfferRequestData"; +import { IAddOfferRequestData, IRequirement } from "@spt/models/eft/ragfair/IAddOfferRequestData"; import { IExtendOfferRequestData } from "@spt/models/eft/ragfair/IExtendOfferRequestData"; import { IGetItemPriceResult } from "@spt/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt/models/eft/ragfair/IGetMarketPriceRequestData"; @@ -137,10 +137,11 @@ export declare class RagfairController { update(): void; /** * Called when creating an offer on flea, fills values in top right corner - * @param getPriceRequest + * @param getPriceRequest Client request object + * @param ignoreTraderOffers Should trader offers be ignored in the calcualtion * @returns min/avg/max values for an item based on flea offers available */ - getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData): IGetItemPriceResult; + getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData, ignoreTraderOffers?: boolean): IGetItemPriceResult; /** * List item(s) on flea for sale * @param pmcData Player profile @@ -199,7 +200,7 @@ export declare class RagfairController { * @param output IItemEventRouterResponse * @returns True if charging tax to player failed */ - protected chargePlayerTaxFee(sessionID: string, rootItem: Item, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean; + protected chargePlayerTaxFee(sessionID: string, rootItem: IItem, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean; /** * Is the item to be listed on the flea valid * @param offerRequest Client offer request @@ -212,7 +213,7 @@ export declare class RagfairController { * @param requirements * @returns Rouble price */ - protected calculateRequirementsPriceInRub(requirements: Requirement[]): number; + protected calculateRequirementsPriceInRub(requirements: IRequirement[]): number; /** * Using item ids from flea offer request, find corresponding items from player inventory and return as array * @param pmcData Player profile @@ -220,10 +221,10 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[][] | undefined; + items: IItem[][] | undefined; errorMessage: string | undefined; }; - createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; + createPlayerOffer(sessionId: string, requirements: IRequirement[], items: IItem[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; /** diff --git a/types/controllers/RepeatableQuestController.d.ts b/types/controllers/RepeatableQuestController.d.ts index 74f39eb..016f8c6 100644 --- a/types/controllers/RepeatableQuestController.d.ts +++ b/types/controllers/RepeatableQuestController.d.ts @@ -18,11 +18,11 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { ObjectId } from "@spt/utils/ObjectId"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RepeatableQuestController { protected logger: ILogger; protected databaseService: DatabaseService; diff --git a/types/controllers/TradeController.d.ts b/types/controllers/TradeController.d.ts index bc72e92..517446a 100644 --- a/types/controllers/TradeController.d.ts +++ b/types/controllers/TradeController.d.ts @@ -1,9 +1,10 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { RagfairOfferHelper } from "@spt/helpers/RagfairOfferHelper"; import { TradeHelper } from "@spt/helpers/TradeHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; @@ -35,6 +36,7 @@ export declare class TradeController { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; + protected ragfairOfferHelper: RagfairOfferHelper; protected traderHelper: TraderHelper; protected ragfairServer: RagfairServer; protected httpResponse: HttpResponseUtil; @@ -44,7 +46,7 @@ export declare class TradeController { protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairOfferHelper: RagfairOfferHelper, traderHelper: TraderHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, mailSendService: MailSendService, configServer: ConfigServer); /** Handle TradingConfirm event */ confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse; /** Handle RagFairBuyOffer event */ @@ -67,10 +69,17 @@ export declare class TradeController { * @param output Output to send back to client */ protected buyPmcItemFromRagfair(sessionId: string, pmcData: IPmcData, fleaOffer: IRagfairOffer, requestOffer: IOfferRequest, output: IItemEventRouterResponse): void; + /** + * Is the provided offerid and ownerid from a player made offer + * @param offerId Id of the offer + * @param offerOwnerId Owner id + * @returns true if offer was made by a player + */ + protected isPlayerOffer(offerId: string, offerOwnerId: string): boolean; /** * Does Player have necessary trader loyalty to purchase flea offer * @param sellerIsTrader is seller trader - * @param fleaOffer FLea offer being bought + * @param fleaOffer Flea offer being bought * @param pmcData Player profile * @returns True if player can buy offer */ @@ -92,5 +101,5 @@ export declare class TradeController { * @param traderDetails Trader being sold to to perform buy category check against * @returns Rouble price */ - protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; + protected getPriceOfItemAndChildren(parentItemId: string, items: IItem[], handbookPrices: Record, traderDetails: ITraderBase): number; } diff --git a/types/controllers/TraderController.d.ts b/types/controllers/TraderController.d.ts index 7fc6d78..bdc9b51 100644 --- a/types/controllers/TraderController.d.ts +++ b/types/controllers/TraderController.d.ts @@ -3,15 +3,17 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader"; +import { IGetItemPricesResponse } from "@spt/models/eft/game/IGetItemPricesResponse"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; +import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class TraderController { protected logger: ILogger; protected timeUtil: TimeUtil; @@ -20,13 +22,14 @@ export declare class TraderController { protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; protected traderAssortService: TraderAssortService; + protected ragfairPriceService: RagfairPriceService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, ragfairPriceService: RagfairPriceService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService @@ -58,4 +61,6 @@ export declare class TraderController { getTrader(sessionID: string, traderID: string): ITraderBase; /** Handle client/trading/api/getTraderAssort */ getAssort(sessionId: string, traderId: string): ITraderAssort; + /** Handle client/items/prices/TRADERID */ + getItemPrices(sessionId: string, traderId: string): IGetItemPricesResponse; } diff --git a/types/controllers/WeatherController.d.ts b/types/controllers/WeatherController.d.ts index 7d24954..493cb8f 100644 --- a/types/controllers/WeatherController.d.ts +++ b/types/controllers/WeatherController.d.ts @@ -1,14 +1,21 @@ import { WeatherGenerator } from "@spt/generators/WeatherGenerator"; +import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { IWeatherData } from "@spt/models/eft/weather/IWeatherData"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { RaidWeatherService } from "@spt/services/RaidWeatherService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; export declare class WeatherController { protected weatherGenerator: WeatherGenerator; protected logger: ILogger; protected configServer: ConfigServer; + protected seasonalEventService: SeasonalEventService; + protected raidWeatherService: RaidWeatherService; + protected weatherHelper: WeatherHelper; protected weatherConfig: IWeatherConfig; - constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer); + constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService, raidWeatherService: RaidWeatherService, weatherHelper: WeatherHelper); /** Handle client/weather */ generate(): IWeatherData; /** @@ -16,4 +23,6 @@ export declare class WeatherController { * @returns Date object */ getCurrentInRaidTime(): Date; + /** Handle client/localGame/weather */ + generateLocal(sesssionId: string): IGetLocalWeatherResponseData; } diff --git a/types/controllers/WishlistController.d.ts b/types/controllers/WishlistController.d.ts index ee4d970..7559dc6 100644 --- a/types/controllers/WishlistController.d.ts +++ b/types/controllers/WishlistController.d.ts @@ -1,12 +1,16 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IWishlistActionData } from "@spt/models/eft/wishlist/IWishlistActionData"; +import { IAddToWishlistRequest } from "@spt/models/eft/wishlist/IAddToWishlistRequest"; +import { IChangeWishlistItemCategoryRequest } from "@spt/models/eft/wishlist/IChangeWishlistItemCategoryRequest"; +import { IRemoveFromWishlistRequest } from "@spt/models/eft/wishlist/IRemoveFromWishlistRequest"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; export declare class WishlistController { protected eventOutputHolder: EventOutputHolder; constructor(eventOutputHolder: EventOutputHolder); /** Handle AddToWishList */ - addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + addToWishList(pmcData: IPmcData, request: IAddToWishlistRequest, sessionID: string): IItemEventRouterResponse; /** Handle RemoveFromWishList event */ - removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + removeFromWishList(pmcData: IPmcData, request: IRemoveFromWishlistRequest, sessionID: string): IItemEventRouterResponse; + /** Handle changeWishlistItemCategory event */ + changeWishlistItemCategory(pmcData: IPmcData, request: IChangeWishlistItemCategoryRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/types/di/Serializer.d.ts b/types/di/Serializer.d.ts index b760b8b..56db477 100644 --- a/types/di/Serializer.d.ts +++ b/types/di/Serializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; export declare class Serializer { serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index 419120f..c2b531c 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -7,16 +7,17 @@ import { ProbabilityHelper } from "@spt/helpers/ProbabilityHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IMods, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { ISlot, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IFilterPlateModsForSlotByLevelResult } from "@spt/models/spt/bots/IFilterPlateModsForSlotByLevelResult"; import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest"; import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; -import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentFilters, IBotConfig, IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; +import { ExhaustableArray } from "@spt/models/spt/server/ExhaustableArray"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; @@ -25,9 +26,9 @@ import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BotEquipmentModGenerator { protected logger: ILogger; protected hashUtil: HashUtil; @@ -55,17 +56,18 @@ export declare class BotEquipmentModGenerator { * @param equipment Equipment item to add mods to * @param modPool Mod list to choose frm * @param parentId parentid of item to add mod to - * @param parentTemplate template objet of item to add mods to + * @param parentTemplate Template object of item to add mods to + * @param specificBlacklist The relevant blacklist from bot.json equipment dictionary * @param forceSpawn should this mod be forced to spawn * @returns Item + compatible mods as an array */ - generateModsForEquipment(equipment: Item[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, shouldForceSpawn?: boolean): Item[]; + generateModsForEquipment(equipment: IItem[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, specificBlacklist: IEquipmentFilterDetails, shouldForceSpawn?: boolean): IItem[]; /** * Filter a bots plate pool based on its current level * @param settings Bot equipment generation settings * @param modSlot Armor slot being filtered * @param existingPlateTplPool Plates tpls to choose from - * @param armorItem + * @param armorItem The armor items db template * @returns Array of plate tpls to choose from */ protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; @@ -75,7 +77,15 @@ export declare class BotEquipmentModGenerator { * @param request Data used to generate the weapon * @returns Weapon + mods array */ - generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[]; + generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): IItem[]; + /** + * Should the provided bot have its stock chance values altered to 100% + * @param modSlot Slot to check + * @param botEquipConfig Bots equipment config/chance values + * @param modToAddTemplate Mod being added to bots weapon + * @returns True if it should + */ + protected shouldForceSubStockSlots(modSlot: string, botEquipConfig: EquipmentFilters, modToAddTemplate: ITemplateItem): boolean; /** * Is this modslot a front or rear sight * @param modSlot Slot to check @@ -93,7 +103,7 @@ export declare class BotEquipmentModGenerator { * Set mod spawn chances to defined amount * @param modSpawnChances Chance dictionary to update */ - protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void; + protected adjustSlotSpawnChances(modSpawnChances: IModsChances, modSlotsToAdjust: string[], newChancePercent: number): void; /** * Does the provided modSlot allow muzzle-related items * @param modSlot Slot id to check @@ -113,16 +123,16 @@ export declare class BotEquipmentModGenerator { * @param parentTemplate item template * @returns Slot item */ - protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): Slot; + protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): ISlot; /** * Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot - * @param itemSlot slot the item sits in - * @param modSlot slot the mod sits in + * @param itemSlot slot the item sits in from db + * @param modSlotName Name of slot the mod sits in * @param modSpawnChances Chances for various mod spawns * @param botEquipConfig Various config settings for generating this type of bot * @returns ModSpawn.SPAWN when mod should be spawned, ModSpawn.DEFAULT_MOD when default mod should spawn, ModSpawn.SKIP when mod is skipped */ - protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; + protected shouldModBeSpawned(itemSlot: ISlot, modSlotName: string, modSpawnChances: IModsChances, botEquipConfig: EquipmentFilters): ModSpawn; /** * Choose a mod to fit into the desired slot * @param request Data used to choose an appropriate mod with @@ -130,7 +140,8 @@ export declare class BotEquipmentModGenerator { */ protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; /** - * + * Choose a weapon mod tpl for a given slot from a pool of choices + * Checks chosen tpl is compatible with all existing weapon items * @param modPool Pool of mods that can be picked from * @param parentSlot Slot the picked mod will have as a parent * @param choiceTypeEnum How should chosen tpl be treated: DEFAULT_MOD/SPAWN/SKIP @@ -138,22 +149,36 @@ export declare class BotEquipmentModGenerator { * @param modSlotName Name of slot picked mod will be placed into * @returns Chosen weapon details */ - protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, choiceTypeEnum: ModSpawn, weapon: Item[], modSlotName: string): IChooseRandomCompatibleModResult; + protected getCompatibleWeaponModTplForSlotFromPool(request: IModToSpawnRequest, modPool: string[], parentSlot: ISlot, choiceTypeEnum: ModSpawn, weapon: IItem[], modSlotName: string): IChooseRandomCompatibleModResult; + /** + * + * @param modPool Pool of item Tpls to choose from + * @param modSpawnType How should the slot choice be handled - forced/normal etc + * @param weapon Weapon mods at current time + * @param modSlotName Name of mod slot being filled + * @returns IChooseRandomCompatibleModResult + */ + protected getCompatibleModFromPool(modPool: string[], modSpawnType: ModSpawn, weapon: IItem[]): IChooseRandomCompatibleModResult; + protected createExhaustableArray(itemsToAddToArray: T[]): ExhaustableArray; + /** + * Get a list of mod tpls that are compatible with the current weapon + * @param modPool + * @param tplBlacklist Tpls that are incompatible and should not be used + * @returns string array of compatible mod tpls with weapon + */ + protected getFilteredModPool(modPool: string[], tplBlacklist: Set): string[]; /** * Filter mod pool down based on various criteria: * Is slot flagged as randomisable * Is slot required * Is slot flagged as default mod only - * @param itemModPool Existing pool of mods to choose - * @param itemSpawnCategory How should slot be handled - * @param parentTemplate Mods parent + * @param request * @param weaponTemplate Mods root parent (weapon/equipment) - * @param modSlot name of mod slot to choose for - * @param botEquipBlacklist A blacklist of items not allowed to be picked - * @param isRandomisableSlot Slot is flagged as a randomisable slot * @returns Array of mod tpls */ - protected getModPoolForSlot(itemModPool: Record, itemSpawnCategory: ModSpawn, parentTemplate: ITemplateItem, weaponTemplate: ITemplateItem, modSlot: string, botEquipBlacklist: EquipmentFilterDetails, isRandomisableSlot: boolean): string[]; + protected getModPoolForSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[]; + protected getModPoolForDefaultSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[]; + protected getMatchingModFromPreset(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): IItem; /** * Get default preset for weapon OR get specific weapon presets for edge cases (mp5/silenced dvl) * @param weaponTemplate Weapons db template @@ -167,7 +192,7 @@ export declare class BotEquipmentModGenerator { * @param modTpl Mod to check compatibility with weapon * @returns True if incompatible */ - protected weaponModComboIsIncompatible(weapon: Item[], modTpl: string): boolean; + protected weaponModComboIsIncompatible(weapon: IItem[], modTpl: string): boolean; /** * Create a mod item with provided parameters as properties + add upd property * @param modId _id @@ -178,7 +203,7 @@ export declare class BotEquipmentModGenerator { * @param botRole The bots role mod is being created for * @returns Item object */ - protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; + protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): IItem; /** * Get a list of containers that hold ammo * e.g. mod_magazine / patron_in_weapon_000 @@ -193,7 +218,7 @@ export declare class BotEquipmentModGenerator { * @param items Items to ensure picked mod is compatible with * @returns Item tpl */ - protected getRandomModTplFromItemDb(fallbackModTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; + protected getRandomModTplFromItemDb(fallbackModTpl: string, parentSlot: ISlot, modSlot: string, items: IItem[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check @@ -203,7 +228,7 @@ export declare class BotEquipmentModGenerator { * @param botRole Bots wildspawntype (assault/pmcBot/exUsec etc) * @returns True if valid for slot */ - protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; + protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: ISlot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; /** * Find mod tpls of a provided type and add to modPool * @param desiredSlotName Slot to look up and add we are adding tpls for (e.g mod_scope) @@ -211,7 +236,7 @@ export declare class BotEquipmentModGenerator { * @param modPool Pool of mods we are adding to * @param botEquipBlacklist A blacklist of items that cannot be picked */ - protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; + protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: IMods, botEquipBlacklist: IEquipmentFilterDetails): void; /** * Get the possible items that fit a slot * @param parentItemId item tpl to get compatible items for @@ -219,7 +244,7 @@ export declare class BotEquipmentModGenerator { * @param botEquipBlacklist Equipment that should not be picked * @returns Array of compatible items for that slot */ - protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[]; + protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: IEquipmentFilterDetails): string[]; /** * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist * @param allowedMods Base mods to filter @@ -227,7 +252,7 @@ export declare class BotEquipmentModGenerator { * @param modSlot Slot mods belong to * @returns Filtered array of mod tpls */ - protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; + protected filterModsByBlacklist(allowedMods: string[], botEquipBlacklist: IEquipmentFilterDetails, modSlot: string): string[]; /** * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. @@ -238,7 +263,7 @@ export declare class BotEquipmentModGenerator { * @param cylinderMagParentId The CylinderMagazine's UID * @param cylinderMagTemplate The CylinderMagazine's template */ - protected fillCamora(items: Item[], modPool: Mods, cylinderMagParentId: string, cylinderMagTemplate: ITemplateItem): void; + protected fillCamora(items: IItem[], modPool: IMods, cylinderMagParentId: string, cylinderMagTemplate: ITemplateItem): void; /** * Take a record of camoras and merge the compatible shells into one array * @param camorasWithShells Dictionary of camoras we want to merge into one array @@ -254,5 +279,5 @@ export declare class BotEquipmentModGenerator { * @param botWeaponSightWhitelist Whitelist of scope types by weapon base type * @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type */ - protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record): string[]; + protected filterSightsByWeaponType(weapon: IItem, scopes: string[], botWeaponSightWhitelist: Record): string[]; } diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index 8ab4371..6f76b37 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -1,25 +1,24 @@ import { BotInventoryGenerator } from "@spt/generators/BotInventoryGenerator"; import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator"; -import { BotDifficultyHelper } from "@spt/helpers/BotDifficultyHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBaseJsonSkills, IBaseSkill, IBotBase, IInfo, IHealth as PmcHealth, ISkills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; +import { IAppearance, IBodyPart, IBotType, IHealth, IInventory } from "@spt/models/eft/common/tables/IBotType"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { BotNameService } from "@spt/services/BotNameService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; -import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; @@ -32,15 +31,14 @@ export declare class BotGenerator { protected botEquipmentFilterService: BotEquipmentFilterService; protected weightedRandomHelper: WeightedRandomHelper; protected botHelper: BotHelper; - protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; - protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; + protected botNameService: BotNameService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -55,7 +53,7 @@ export declare class BotGenerator { * @param botGenerationDetails details on how to generate bots * @returns constructed bot */ - prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + prepareAndGenerateBot(sessionId: string, botGenerationDetails: IBotGenerationDetails): IBotBase; /** * Get a clone of the default bot base object and adjust its role/side/difficulty values * @param botRole Role bot should have @@ -77,31 +75,20 @@ export declare class BotGenerator { * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ - protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): IBotBase; protected addAdditionalPocketLootWeightsForUnheardBot(botJsonTemplate: IBotType): void; /** * Remove items from item.json/lootableItemBlacklist from bots inventory * @param botInventory Bot to filter */ - protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; + protected removeBlacklistedLootFromBotTemplate(botInventory: IInventory): void; /** * Choose various appearance settings for a bot using weights: head/body/feet/hands * @param bot Bot to adjust * @param appearance Appearance settings to choose from * @param botGenerationDetails Generation details */ - protected setBotAppearance(bot: IBotBase, appearance: Appearance, botGenerationDetails: BotGenerationDetails): void; - /** - * Create a bot nickname - * @param botJsonTemplate x.json from database - * @param botGenerationDetails - * @param botRole role of bot e.g. assault - * @param sessionId OPTIONAL: profile session id - * @returns Nickname for bot - */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; - protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; - protected addPlayerScavNameSimulationSuffix(nickname: string): string; + protected setBotAppearance(bot: IBotBase, appearance: IAppearance, botGenerationDetails: IBotGenerationDetails): void; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -113,7 +100,13 @@ export declare class BotGenerator { * @param playerScav Is a pscav bot being generated * @returns PmcHealth object */ - protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; + protected generateHealth(healthObj: IHealth, playerScav?: boolean): PmcHealth; + /** + * Sum up body parts max hp values, return the bodypart collection with lowest value + * @param bodies Body parts to sum up + * @returns Lowest hp collection + */ + protected getLowestHpBody(bodies: IBodyPart[]): IBodyPart | undefined; /** * Get a bots skills with randomsied progress value between the min and max values * @param botSkills Skills that should have their progress value randomised @@ -146,7 +139,7 @@ export declare class BotGenerator { * @param botInfo bot info object to update * @returns Chosen game version */ - protected setRandomisedGameVersionAndCategory(botInfo: Info): string; + protected setRandomisedGameVersionAndCategory(botInfo: IInfo): string; /** * Add a side-specific (usec/bear) dogtag item to a bots inventory * @param bot bot to add dogtag to diff --git a/types/generators/BotInventoryGenerator.d.ts b/types/generators/BotInventoryGenerator.d.ts index 1ea549c..163c651 100644 --- a/types/generators/BotInventoryGenerator.d.ts +++ b/types/generators/BotInventoryGenerator.d.ts @@ -1,17 +1,22 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; import { BotEquipmentModGenerator } from "@spt/generators/BotEquipmentModGenerator"; import { BotLootGenerator } from "@spt/generators/BotLootGenerator"; import { BotWeaponGenerator } from "@spt/generators/BotWeaponGenerator"; import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Chances, Equipment, Generation, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotType, IChances, IEquipment, IGeneration, IInventory } from "@spt/models/eft/common/tables/IBotType"; +import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; -import { EquipmentFilterDetails, IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -22,18 +27,22 @@ export declare class BotInventoryGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected databaseService: DatabaseService; + protected applicationContext: ApplicationContext; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; + protected profileHelper: ProfileHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; protected itemHelper: ItemHelper; + protected weatherHelper: WeatherHelper; protected localisationService: LocalisationService; + protected botEquipmentFilterService: BotEquipmentFilterService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, applicationContext: ApplicationContext, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, profileHelper: ProfileHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, weatherHelper: WeatherHelper, localisationService: LocalisationService, botEquipmentFilterService: BotEquipmentFilterService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -52,6 +61,7 @@ export declare class BotInventoryGenerator { protected generateInventoryBase(): PmcInventory; /** * Add equipment to a bot + * @param sessionId Session id * @param templateInventory bot/x.json data from db * @param wornItemChances Chances items will be added to bot * @param botRole Role bot has (assault/pmcBot) @@ -59,19 +69,23 @@ export declare class BotInventoryGenerator { * @param botLevel Level of bot * @param chosenGameVersion Game version for bot, only really applies for PMCs */ - protected generateAndAddEquipmentToBot(templateInventory: Inventory, wornItemChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string): void; + protected generateAndAddEquipmentToBot(sessionId: string, templateInventory: IInventory, wornItemChances: IChances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string, raidConfig: IGetRaidConfigurationRequestData): void; /** * Remove non-armored rigs from parameter data * @param templateEquipment Equpiment to filter TacticalVest of + * @param botRole Role of bot vests are being filtered for */ - protected filterRigsToThoseWithProtection(templateEquipment: Equipment): void; + protected filterRigsToThoseWithProtection(templateEquipment: IEquipment, botRole: string): void; /** * Remove armored rigs from parameter data * @param templateEquipment Equpiment to filter TacticalVest of + * @param botRole Role of bot vests are being filtered for + * @param allowEmptyResult Should the function return all rigs when 0 unarmored are found */ - protected filterRigsToThoseWithoutProtection(templateEquipment: Equipment): void; + protected filterRigsToThoseWithoutProtection(templateEquipment: IEquipment, botRole: string, allowEmptyResult?: boolean): void; /** * Add a piece of equipment with mods to inventory from the provided pools + * @param sessionId Session id * @param settings Values to adjust how item is chosen and added to bot * @returns true when item added */ @@ -79,10 +93,10 @@ export declare class BotInventoryGenerator { /** * Get all possible mods for item and filter down based on equipment blacklist from bot.json config * @param itemTpl Item mod pool is being retrieved and filtered - * @param equipmentBlacklist blacklist to filter mod pool with + * @param equipmentBlacklist Blacklist to filter mod pool with * @returns Filtered pool of mods */ - protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record; + protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: Record): Record; /** * Work out what weapons bot should have equipped and add them to bot inventory * @param templateInventory bot/x.json data from db @@ -94,13 +108,13 @@ export declare class BotInventoryGenerator { * @param itemGenerationLimitsMinMax Limits for items the bot can have * @param botLevel level of bot having weapon generated */ - protected generateAndAddWeaponsToBot(templateInventory: Inventory, equipmentChances: Chances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + protected generateAndAddWeaponsToBot(templateInventory: IInventory, equipmentChances: IChances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: IGeneration, botLevel: number): void; /** * Calculate if the bot should have weapons in Primary/Secondary/Holster slots * @param equipmentChances Chances bot has certain equipment * @returns What slots bot should have weapons generated for */ - protected getDesiredWeaponsForBot(equipmentChances: Chances): { + protected getDesiredWeaponsForBot(equipmentChances: IChances): { slot: EquipmentSlots; shouldSpawn: boolean; }[]; @@ -118,5 +132,5 @@ export declare class BotInventoryGenerator { protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; + }, templateInventory: IInventory, botInventory: PmcInventory, equipmentChances: IChances, botRole: string, isPmc: boolean, itemGenerationWeights: IGeneration, botLevel: number): void; } diff --git a/types/generators/BotLevelGenerator.d.ts b/types/generators/BotLevelGenerator.d.ts index dee61e2..0dada8f 100644 --- a/types/generators/BotLevelGenerator.d.ts +++ b/types/generators/BotLevelGenerator.d.ts @@ -1,15 +1,17 @@ import { MinMax } from "@spt/models/common/MinMax"; import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLevelResult"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { MathUtil } from "@spt/utils/MathUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class BotLevelGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; protected databaseService: DatabaseService; - constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService); + protected mathUtil: MathUtil; + constructor(logger: ILogger, randomUtil: RandomUtil, databaseService: DatabaseService, mathUtil: MathUtil); /** * Return a randomised bot level and exp value * @param levelDetails Min and max of level for bot @@ -17,21 +19,14 @@ export declare class BotLevelGenerator { * @param bot Bot the level is being generated for * @returns IRandomisedBotLevelResult object */ - generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult; + generateBotLevel(levelDetails: MinMax, botGenerationDetails: IBotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult; + protected chooseBotLevel(min: number, max: number, shift: number, number: number): number; /** - * Get the highest level a bot can be relative to the players level, but no further than the max size from globals.exp_table - * @param botGenerationDetails Details to help generate a bot - * @param levelDetails - * @param maxLevel Max possible level - * @returns Highest level possible for bot - */ - protected getHighestRelativeBotLevel(botGenerationDetails: BotGenerationDetails, levelDetails: MinMax, maxLevel: number): number; - /** - * Get the lowest level a bot can be relative to the players level, but no lower than 1 + * Return the min and max bot level based on a relative delta from the PMC level * @param botGenerationDetails Details to help generate a bot * @param levelDetails * @param maxlevel Max level allowed - * @returns Lowest level possible for bot + * @returns A MinMax of the lowest and highest level to generate the bots */ - protected getLowestRelativeBotLevel(botGenerationDetails: BotGenerationDetails, levelDetails: MinMax, maxlevel: number): number; + protected getRelativeBotLevelRange(botGenerationDetails: IBotGenerationDetails, levelDetails: MinMax, maxAvailableLevel: number): MinMax; } diff --git a/types/generators/BotLootGenerator.d.ts b/types/generators/BotLootGenerator.d.ts index fee56ce..07f8b68 100644 --- a/types/generators/BotLootGenerator.d.ts +++ b/types/generators/BotLootGenerator.d.ts @@ -5,9 +5,9 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotType, Inventory, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotType, IInventory, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { IItemSpawnLimitSettings } from "@spt/models/spt/bots/IItemSpawnLimitSettings"; @@ -18,9 +18,9 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; @@ -51,6 +51,14 @@ export declare class BotLootGenerator { * @param botLevel Level of bot */ generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void; + /** + * Gets the rouble cost total for loot in a bots backpack by the bots levl + * Will return 0 for non PMCs + * @param botLevel Bots level + * @param isPmc Is the bot a PMC + * @returns number + */ + protected getBackpackRoubleTotalByLevel(botLevel: number, isPmc: boolean): number; /** * Get an array of the containers a bot has on them (pockets/backpack/vest) * @param botInventory Bot to check @@ -83,7 +91,7 @@ export declare class BotLootGenerator { * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: Record, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set): void; - protected createWalletLoot(walletId: string): Item[][]; + protected createWalletLoot(walletId: string): IItem[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array * @param itemToAddTemplate Db template of item to check @@ -91,7 +99,7 @@ export declare class BotLootGenerator { * @param isPmc Is the item being generated for a pmc (affects money/ammo stack sizes) * @param botRole role bot has that owns item */ - protected addRequiredChildItemsToParent(itemToAddTemplate: ITemplateItem, itemToAddChildrenTo: Item[], isPmc: boolean, botRole: string): void; + protected addRequiredChildItemsToParent(itemToAddTemplate: ITemplateItem, itemToAddChildrenTo: IItem[], isPmc: boolean, botRole: string): void; /** * Add generated weapons to inventory as loot * @param botInventory inventory to add preset to @@ -101,7 +109,7 @@ export declare class BotLootGenerator { * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ - protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: IInventory, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set): void; /** * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 @@ -123,14 +131,14 @@ export declare class BotLootGenerator { * @param itemTemplate item details from db * @param moneyItem Money item to randomise */ - protected randomiseMoneyStackSize(botRole: string, itemTemplate: ITemplateItem, moneyItem: Item): void; + protected randomiseMoneyStackSize(botRole: string, itemTemplate: ITemplateItem, moneyItem: IItem): void; /** * Randomise the size of an ammo stack * @param isPmc Is ammo on a PMC bot * @param itemTemplate item details from db * @param ammoItem Ammo item to randomise */ - protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; + protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: IItem): void; /** * Get spawn limits for a specific bot type from bot.json config * If no limit found for a non pmc bot, fall back to defaults diff --git a/types/generators/BotWeaponGenerator.d.ts b/types/generators/BotWeaponGenerator.d.ts index 5559bfa..c5c871f 100644 --- a/types/generators/BotWeaponGenerator.d.ts +++ b/types/generators/BotWeaponGenerator.d.ts @@ -4,11 +4,11 @@ import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "@spt/helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { GenerationData, Inventory, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IGenerationData, IInventory, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { GenerateWeaponResult } from "@spt/models/spt/bots/GenerateWeaponResult"; +import { IGenerateWeaponResult } from "@spt/models/spt/bots/IGenerateWeaponResult"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; @@ -18,9 +18,9 @@ import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RepairService } from "@spt/services/RepairService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BotWeaponGenerator { protected logger: ILogger; protected hashUtil: HashUtil; @@ -52,18 +52,18 @@ export declare class BotWeaponGenerator { * @param isPmc Is weapon generated for a pmc * @returns GenerateWeaponResult object */ - generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): IGenerateWeaponResult; /** * Get a random weighted weapon from a bots pool of weapons * @param equipmentSlot Primary/secondary/holster * @param botTemplateInventory e.g. assault.json * @returns weapon tpl */ - pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: Inventory): string; + pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: IInventory): 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 weaponTpl Weapon tpl to generate (use pickWeightedWeaponTplFromPool()) + * @param slotName Slot to fit into, primary/secondary/holster * @param botTemplateInventory e.g. assault.json * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod @@ -71,7 +71,7 @@ export declare class BotWeaponGenerator { * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ - generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + generateWeaponByTpl(sessionId: string, weaponTpl: string, slotName: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): IGenerateWeaponResult; /** * Insert a cartridge(s) into a weapon * Handles all chambers - patron_in_weapon, patron_in_weapon_000 etc @@ -79,7 +79,7 @@ export declare class BotWeaponGenerator { * @param ammoTpl Cartridge to add to weapon * @param chamberSlotIds name of slots to create or add ammo to */ - protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, chamberSlotIds: string[]): void; + protected addCartridgeToChamber(weaponWithModsArray: IItem[], ammoTpl: string, chamberSlotIds: string[]): void; /** * Create array with weapon base as only element and * add additional properties based on weapon type @@ -90,7 +90,7 @@ export declare class BotWeaponGenerator { * @param botRole for durability values * @returns Base weapon item in array */ - protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[]; + protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): IItem[]; /** * Get the mods necessary to kit out a weapon to its preset level * @param weaponTpl weapon to find preset for @@ -98,14 +98,14 @@ export declare class BotWeaponGenerator { * @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[]; + protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): IItem[]; /** * Checks if all required slots are occupied on a weapon and all it's mods * @param weaponItemArray Weapon + mods * @param botRole role of bot weapon is for * @returns true if valid */ - protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean; + protected isWeaponValid(weaponItemArray: IItem[], botRole: string): boolean; /** * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer @@ -114,14 +114,14 @@ export declare class BotWeaponGenerator { * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: IGenerateWeaponResult, magWeights: IGenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods * @param generatedWeaponResult result of weapon generation * @param inventory bot inventory to add grenades to */ - protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; + protected addUbglGrenadesToBotInventory(weaponMods: IItem[], generatedWeaponResult: IGenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add @@ -137,14 +137,20 @@ export declare class BotWeaponGenerator { * @param botRole the bot type we are getting the magazine for * @returns magazine tpl string */ - protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string; + protected getMagazineTplFromWeaponTemplate(weaponMods: IItem[], weaponTemplate: ITemplateItem, botRole: string): string; /** * Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo) - * @param ammo a list of ammo tpls the weapon can use - * @param weaponTemplate the weapon we want to pick ammo for - * @returns an ammo tpl that works with the desired gun + * @param cartridgePool Dict of all cartridges keyed by type e.g. Caliber556x45NATO + * @param weaponTemplate Weapon details from db we want to pick ammo for + * @returns Ammo tpl that works with the desired gun + */ + protected getWeightedCompatibleAmmo(cartridgePool: Record>, weaponTemplate: ITemplateItem): string; + /** + * Get the cartridge ids from a weapon template that work with the weapon + * @param weaponTemplate Weapon db template to get cartridges for + * @returns Array of cartridge tpls */ - protected getWeightedCompatibleAmmo(ammo: Record>, weaponTemplate: ITemplateItem): string; + protected getCompatibleCartridgesFromWeaponTemplate(weaponTemplate: ITemplateItem): string[]; /** * Get a weapons compatible cartridge caliber * @param weaponTemplate Weapon to look up caliber of @@ -157,14 +163,14 @@ export declare class BotWeaponGenerator { * @param magazine Magazine item * @param cartridgeTpl Cartridge to insert into magazine */ - protected fillExistingMagazines(weaponMods: Item[], magazine: Item, cartridgeTpl: string): void; + protected fillExistingMagazines(weaponMods: IItem[], magazine: IItem, cartridgeTpl: string): void; /** * Add desired ammo tpl as item to weaponmods array, placed as child to UBGL * @param weaponMods Weapon with children * @param ubglMod UBGL item * @param ubglAmmoTpl Grenade ammo tpl */ - protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void; + protected fillUbgl(weaponMods: IItem[], ubglMod: IItem, ubglAmmoTpl: string): void; /** * Add cartridge item to weapon Item array, if it already exists, update * @param weaponWithMods Weapon items array to amend @@ -173,12 +179,12 @@ export declare class BotWeaponGenerator { * @param newStackSize how many cartridges should go into the magazine * @param magazineTemplate magazines db template */ - protected addOrUpdateMagazinesChildWithAmmo(weaponWithMods: Item[], magazine: Item, chosenAmmoTpl: string, magazineTemplate: ITemplateItem): void; + protected addOrUpdateMagazinesChildWithAmmo(weaponWithMods: IItem[], magazine: IItem, chosenAmmoTpl: string, magazineTemplate: ITemplateItem): void; /** * Fill each Camora with a bullet * @param weaponMods Weapon mods to find and update camora mod(s) from * @param magazineId magazine id to find and add to * @param ammoTpl ammo template id to hydate with */ - protected fillCamorasWithAmmo(weaponMods: Item[], magazineId: string, ammoTpl: string): void; + protected fillCamorasWithAmmo(weaponMods: IItem[], magazineId: string, ammoTpl: string): void; } diff --git a/types/generators/FenceBaseAssortGenerator.d.ts b/types/generators/FenceBaseAssortGenerator.d.ts index 784022f..b6ef72b 100644 --- a/types/generators/FenceBaseAssortGenerator.d.ts +++ b/types/generators/FenceBaseAssortGenerator.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -47,7 +47,7 @@ export declare class FenceBaseAssortGenerator { * @param armor Armor item array to add mods into * @param itemDbDetails Armor items db template */ - protected addChildrenToArmorModSlots(armor: Item[], itemDbDetails: ITemplateItem): void; + protected addChildrenToArmorModSlots(armor: IItem[], itemDbDetails: ITemplateItem): void; /** * Check if item is valid for being added to fence assorts * @param item Item to check diff --git a/types/generators/LocationGenerator.d.ts b/types/generators/LocationLootGenerator.d.ts similarity index 89% rename from types/generators/LocationGenerator.d.ts rename to types/generators/LocationLootGenerator.d.ts index 222b0ab..6ef0bbc 100644 --- a/types/generators/LocationGenerator.d.ts +++ b/types/generators/LocationLootGenerator.d.ts @@ -3,8 +3,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IContainerMinMax, IStaticAmmoDetails, IStaticContainer, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "@spt/models/eft/common/ILocation"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { ILooseLoot, ISpawnpoint, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -12,12 +12,12 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; import { ObjectId } from "@spt/utils/ObjectId"; import { ProbabilityObjectArray, RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export interface IContainerItem { - items: Item[]; + items: IItem[]; width: number; height: number; } @@ -27,7 +27,7 @@ export interface IContainerGroupCount { /** How many containers the map should spawn with this group id */ chosenCount: number; } -export declare class LocationGenerator { +export declare class LocationLootGenerator { protected logger: ILogger; protected databaseService: DatabaseService; protected objectId: ObjectId; @@ -49,7 +49,7 @@ export declare class LocationGenerator { * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ - generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): ISpawnpointTemplate[]; /** * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist * @param staticContainers @@ -117,14 +117,14 @@ export declare class LocationGenerator { * @param locationName Location to generate loot for * @returns Array of spawn points with loot in them */ - generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): SpawnpointTemplate[]; + generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[]; /** * Add forced spawn point loot into loot parameter array * @param lootLocationTemplates array to add forced loot spawn locations to * @param forcedSpawnPoints forced Forced loot locations that must be added * @param locationName Name of map currently having force loot created for */ - protected addForcedLoot(lootLocationTemplates: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void; + protected addForcedLoot(lootLocationTemplates: ISpawnpointTemplate[], forcedSpawnPoints: ISpawnpointsForced[], locationName: string): void; /** * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for @@ -132,19 +132,13 @@ export declare class LocationGenerator { * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; - /** - * Replace the _id value for base item + all children items parentid value - * @param itemWithChildren Item with mods to update - * @param newId new id to add on chidren of base item - */ - protected reparentItemAndChildren(itemWithChildren: Item[], newId?: string): void; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: ISpawnpoint, staticAmmoDist: Record): IContainerItem; /** * Find an item in array by its _tpl, handle differently if chosenTpl is a weapon * @param items Items array to search * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; + protected getItemInArray(items: IItem[], chosenTpl: string): IItem | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/types/generators/LootGenerator.d.ts b/types/generators/LootGenerator.d.ts index 953ac3d..a82f24f 100644 --- a/types/generators/LootGenerator.d.ts +++ b/types/generators/LootGenerator.d.ts @@ -2,12 +2,12 @@ import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { MinMax } from "@spt/models/common/MinMax"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; -import { LootItem } from "@spt/models/spt/services/LootItem"; -import { LootRequest } from "@spt/models/spt/services/LootRequest"; +import { IRewardDetails, ISealedAirdropContainerSettings } from "@spt/models/spt/config/IInventoryConfig"; +import { ILootRequest } from "@spt/models/spt/services/ILootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; @@ -37,14 +37,33 @@ export declare class LootGenerator { * @param options parameters to adjust how loot is generated * @returns An array of loot items */ - createRandomLoot(options: LootRequest): LootItem[]; + createRandomLoot(options: ILootRequest): IItem[]; + /** + * Generate An array of items + * TODO - handle weapon presets/ammo packs + * @param forcedLootDict Dictionary of item tpls with minmax values + * @returns Array of IItem + */ + createForcedLoot(forcedLootDict: Record): IItem[]; + /** + * Get pool of items from item db that fit passed in param criteria + * @param itemTplBlacklist Prevent these items + * @param itemTypeWhitelist Only allow these items + * @param useRewardItemBlacklist Should item.json reward item config be used + * @param allowBossItems Should boss items be allowed in result + * @returns results of filtering + blacklist used + */ + protected getItemRewardPool(itemTplBlacklist: string[], itemTypeWhitelist: string[], useRewardItemBlacklist: boolean, allowBossItems: boolean): { + itemPool: [string, ITemplateItem][]; + blacklist: Set; + }; /** * Filter armor items by their front plates protection level - top if its a helmet * @param armor Armor preset to check * @param options Loot request options - armor level etc * @returns True if item has desired armor level */ - protected isArmorOfDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; + protected isArmorOfDesiredProtectionLevel(armor: IPreset, options: ILootRequest): boolean; /** * Construct item limit record to hold max and current item count for each item type * @param limits limits as defined in config @@ -62,14 +81,14 @@ export declare class LootGenerator { protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record, options: LootRequest, result: LootItem[]): boolean; + }>, options: ILootRequest, result: IItem[]): boolean; /** * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values * @param item item to get stack count of * @param options loot options * @returns stack count */ - protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + protected getRandomisedStackCount(item: ITemplateItem, options: ILootRequest): number; /** * Find a random item in items.json and add to result array * @param presetPool Presets to choose from @@ -81,20 +100,20 @@ export declare class LootGenerator { protected findAndAddRandomPresetToLoot(presetPool: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; + }>, itemBlacklist: string[], result: IItem[]): boolean; /** * Sealed weapon containers have a weapon + associated mods inside them + assortment of other things (food/meds) * @param containerSettings sealed weapon container settings * @returns Array of item with children arrays */ - getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): Item[][]; + getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): IItem[][]; /** * Get non-weapon mod rewards for a sealed container * @param containerSettings Sealed weapon container settings * @param weaponDetailsDb Details for the weapon to reward player * @returns Array of item with children arrays */ - protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): Item[][]; + protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): IItem[][]; /** * Iterate over the container weaponModRewardLimits settings and create an array of weapon mods to reward player * @param containerSettings Sealed weapon container settings @@ -102,12 +121,18 @@ export declare class LootGenerator { * @param chosenWeaponPreset The weapon preset given to player as reward * @returns Array of item with children arrays */ - protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): Item[][]; + protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): IItem[][]; /** * Handle event-related loot containers - currently just the halloween jack-o-lanterns that give food rewards * @param rewardContainerDetails * @returns Array of item with children arrays */ - getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): Item[][]; + getRandomLootContainerLoot(rewardContainerDetails: IRewardDetails): IItem[][]; + /** + * Pick a reward item based on the reward details data + * @param rewardContainerDetails + * @returns Single tpl + */ + protected pickRewardItem(rewardContainerDetails: IRewardDetails): string; } export {}; diff --git a/types/generators/PlayerScavGenerator.d.ts b/types/generators/PlayerScavGenerator.d.ts index 2414150..7a8e0e7 100644 --- a/types/generators/PlayerScavGenerator.d.ts +++ b/types/generators/PlayerScavGenerator.d.ts @@ -4,9 +4,9 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IBotBase, Skills, Stats } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotBase, ISkills, IStats } from "@spt/models/eft/common/tables/IBotBase"; import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; +import { IKarmaLevel, IPlayerScavConfig } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -14,9 +14,9 @@ import { BotLootCacheService } from "@spt/services/BotLootCacheService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class PlayerScavGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -67,10 +67,10 @@ export declare class PlayerScavGenerator { * @param karmaSettings Values to modify the bot template with * @param baseBotNode bot template to modify according to karama level settings */ - protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: KarmaLevel, baseBotNode: IBotType): void; - protected getScavSkills(scavProfile: IPmcData): Skills; - protected getDefaultScavSkills(): Skills; - protected getScavStats(scavProfile: IPmcData): Stats; + protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: IKarmaLevel, baseBotNode: IBotType): void; + protected getScavSkills(scavProfile: IPmcData): ISkills; + protected getDefaultScavSkills(): ISkills; + protected getScavStats(scavProfile: IPmcData): IStats; protected getScavLevel(scavProfile: IPmcData): number; protected getScavExperience(scavProfile: IPmcData): number; /** diff --git a/types/generators/RagfairAssortGenerator.d.ts b/types/generators/RagfairAssortGenerator.d.ts index 4c6cf1c..60c4c86 100644 --- a/types/generators/RagfairAssortGenerator.d.ts +++ b/types/generators/RagfairAssortGenerator.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; @@ -14,7 +14,7 @@ export declare class RagfairAssortGenerator { protected databaseServer: DatabaseServer; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; - protected generatedAssortItems: Item[][]; + protected generatedAssortItems: IItem[][]; protected ragfairConfig: IRagfairConfig; protected ragfairItemInvalidBaseTypes: string[]; constructor(hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer); @@ -23,7 +23,7 @@ export declare class RagfairAssortGenerator { * Each sub array contains item + children (if any) * @returns array of arrays */ - getAssortItems(): Item[][]; + getAssortItems(): IItem[][]; /** * Check internal generatedAssortItems array has objects * @returns true if array has objects @@ -33,7 +33,7 @@ export declare class RagfairAssortGenerator { * Generate an array of arrays (item + children) the flea can sell * @returns array of arrays (item + children) */ - protected generateRagfairAssortItems(): Item[][]; + protected generateRagfairAssortItems(): IItem[][]; /** * Get presets from globals to add to flea * ragfairConfig.dynamic.showDefaultPresetsOnly decides if its all presets or just defaults @@ -46,5 +46,5 @@ export declare class RagfairAssortGenerator { * @param id id to add to item * @returns Hydrated Item object */ - protected createRagfairAssortRootItem(tplId: string, id?: string): Item; + protected createRagfairAssortRootItem(tplId: string, id?: string): IItem; } diff --git a/types/generators/RagfairOfferGenerator.d.ts b/types/generators/RagfairOfferGenerator.d.ts index 2c7801b..3c88984 100644 --- a/types/generators/RagfairOfferGenerator.d.ts +++ b/types/generators/RagfairOfferGenerator.d.ts @@ -6,11 +6,13 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; -import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; -import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { IOfferRequirement, IRagfairOffer, IRagfairOfferUser } from "@spt/models/eft/ragfair/IRagfairOffer"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { IArmorPlateBlacklistSettings, IBarterDetails, IDynamic, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ITplWithFleaPrice } from "@spt/models/spt/ragfair/ITplWithFleaPrice"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -19,10 +21,10 @@ import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { RagfairOfferService } from "@spt/services/RagfairOfferService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairOfferGenerator { protected logger: ILogger; protected hashUtil: HashUtil; @@ -45,6 +47,7 @@ export declare class RagfairOfferGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; protected allowedFleaPriceItemsForBarter: { tpl: string; price: number; @@ -62,7 +65,7 @@ export declare class RagfairOfferGenerator { * @param sellInOnePiece Flags sellInOnePiece to be true * @returns Created flea offer */ - createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; + createAndAddFleaOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; /** * Create an offer object ready to send to ragfairOfferService.addOffer() * @param userID Owner of the offer @@ -70,10 +73,10 @@ export declare class RagfairOfferGenerator { * @param items Items in the offer * @param barterScheme Cost of item (currency or barter) * @param loyalLevel Loyalty level needed to buy item - * @param sellInOnePiece Set StackObjectsCount to 1 + * @param isPackOffer Is offer being created flaged as a pack * @returns IRagfairOffer */ - protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; + protected createOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, isPackOffer?: boolean): IRagfairOffer; /** * Create the user object stored inside each flea offer object * @param userID user creating the offer @@ -86,7 +89,7 @@ export declare class RagfairOfferGenerator { * @param offerRequirements barter requirements for offer * @returns rouble cost of offer */ - protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number; + protected convertOfferRequirementsIntoRoubles(offerRequirements: IOfferRequirement[]): number; /** * Get avatar url from trader table in db * @param isTrader Is user we're getting avatar for a trader @@ -130,20 +133,20 @@ export declare class RagfairOfferGenerator { * Create multiple offers for items by using a unique list of items we've generated previously * @param expiredOffers optional, expired offers to regenerate */ - generateDynamicOffers(expiredOffers?: Item[][]): Promise; + generateDynamicOffers(expiredOffers?: IItem[][]): Promise; /** * @param assortItemWithChildren Item with its children to process into offers * @param isExpiredOffer is an expired offer * @param config Ragfair dynamic config */ - protected createOffersFromAssort(assortItemWithChildren: Item[], isExpiredOffer: boolean, config: Dynamic): Promise; + protected createOffersFromAssort(assortItemWithChildren: IItem[], isExpiredOffer: boolean, config: IDynamic): Promise; /** * iterate over an items chidren and look for plates above desired level and remove them * @param presetWithChildren preset to check for plates * @param plateSettings Settings * @returns True if plate removed */ - protected removeBannedPlatesFromPreset(presetWithChildren: Item[], plateSettings: IArmorPlateBlacklistSettings): boolean; + protected removeBannedPlatesFromPreset(presetWithChildren: IItem[], plateSettings: IArmorPlateBlacklistSettings): boolean; /** * Create one flea offer for a specific item * @param itemWithChildren Item to create offer for @@ -151,7 +154,7 @@ export declare class RagfairOfferGenerator { * @param itemDetails raw db item details * @returns Item array */ - protected createSingleOfferForItem(itemWithChildren: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; + protected createSingleOfferForItem(itemWithChildren: IItem[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; /** * Generate trader offers on flea using the traders assort data * @param traderID Trader to generate offers for @@ -164,7 +167,7 @@ export declare class RagfairOfferGenerator { * @param itemWithMods Item and mods, get condition of first item (only first array item is modified) * @param itemDetails db details of first item */ - protected randomiseOfferItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): void; + protected randomiseOfferItemUpdProperties(userID: string, itemWithMods: IItem[], itemDetails: ITemplateItem): void; /** * Get the relevant condition id if item tpl matches in ragfair.json/condition * @param tpl Item to look for matching condition object @@ -177,7 +180,7 @@ export declare class RagfairOfferGenerator { * @param itemWithMods Item to adjust condition details of * @param itemDetails db item details of first item in array */ - protected randomiseItemCondition(conditionSettingsId: string, itemWithMods: Item[], itemDetails: ITemplateItem): void; + protected randomiseItemCondition(conditionSettingsId: string, itemWithMods: IItem[], itemDetails: ITemplateItem): void; /** * Adjust an items durability/maxDurability value * @param item item (weapon/armor) to Adjust @@ -185,35 +188,33 @@ export declare class RagfairOfferGenerator { * @param maxMultiplier Value to multiply max durability by * @param currentMultiplier Value to multiply current durability by */ - protected randomiseWeaponDurability(item: Item, itemDbDetails: ITemplateItem, maxMultiplier: number, currentMultiplier: number): void; + protected randomiseWeaponDurability(item: IItem, itemDbDetails: ITemplateItem, maxMultiplier: number, currentMultiplier: number): void; /** * Randomise the durabiltiy values for an armors plates and soft inserts * @param armorWithMods Armor item with its child mods * @param currentMultiplier Chosen multipler to use for current durability value * @param maxMultiplier Chosen multipler to use for max durability value */ - protected randomiseArmorDurabilityValues(armorWithMods: Item[], currentMultiplier: number, maxMultiplier: number): void; + protected randomiseArmorDurabilityValues(armorWithMods: IItem[], currentMultiplier: number, maxMultiplier: number): void; /** * Add missing conditions to an item if needed * Durabiltiy for repairable items * HpResource for medical items * @param item item to add conditions to */ - protected addMissingConditions(item: Item): void; + protected addMissingConditions(item: IItem): void; /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer + * @param barterConfig Barter config from ragfairConfig.dynamic.barter * @returns Barter scheme */ - protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[]; + protected createBarterBarterScheme(offerItems: IItem[], barterConfig: IBarterDetails): IBarterScheme[]; /** * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * @returns array with tpl/price values */ - protected getFleaPricesAsArray(): { - tpl: string; - price: number; - }[]; + protected getFleaPricesAsArray(): ITplWithFleaPrice[]; /** * Create a random currency-based barter scheme for an array of items * @param offerWithChildren Items on offer @@ -221,5 +222,5 @@ export declare class RagfairOfferGenerator { * @param multipler What to multiply the resulting price by * @returns Barter scheme for offer */ - protected createCurrencyBarterScheme(offerWithChildren: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[]; + protected createCurrencyBarterScheme(offerWithChildren: IItem[], isPackOffer: boolean, multipler?: number): IBarterScheme[]; } diff --git a/types/generators/RepeatableQuestGenerator.d.ts b/types/generators/RepeatableQuestGenerator.d.ts index 77c4e79..79a10fc 100644 --- a/types/generators/RepeatableQuestGenerator.d.ts +++ b/types/generators/RepeatableQuestGenerator.d.ts @@ -1,8 +1,8 @@ import { RepeatableQuestRewardGenerator } from "@spt/generators/RepeatableQuestRewardGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { Exit } from "@spt/models/eft/common/ILocationBase"; -import { TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { IExit } from "@spt/models/eft/common/ILocationBase"; +import { ITraderInfo } from "@spt/models/eft/common/tables/IBotBase"; import { IQuestCondition, IQuestConditionCounterCondition } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; @@ -11,10 +11,10 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; import { ObjectId } from "@spt/utils/ObjectId"; import { ProbabilityObjectArray, RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RepeatableQuestGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -28,6 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; + protected maxRandomNumberAttempts: number; constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). @@ -38,7 +39,7 @@ export declare class RepeatableQuestGenerator { * @param repeatableConfig Repeatable quest config * @returns IRepeatableQuest */ - generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; + generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** * Generate a randomised Elimination quest * @param pmcLevel Player's level for requested items and reward generation @@ -108,7 +109,7 @@ export declare class RepeatableQuestGenerator { * @param playerSide Scav/Pmc * @returns Array of Exit objects */ - protected getLocationExitsForSide(locationKey: string, playerSide: string): Exit[]; + protected getLocationExitsForSide(locationKey: string, playerSide: string): IExit[]; protected generatePickupQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) @@ -123,7 +124,7 @@ export declare class RepeatableQuestGenerator { * @param {string} exit The exit name to generate the condition for * @returns {object} Exit condition */ - protected generateExplorationExitCondition(exit: Exit): IQuestConditionCounterCondition; + protected generateExplorationExitCondition(exit: IExit): IQuestConditionCounterCondition; /** * Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json * The templates include Elimination, Completion and Extraction quest types diff --git a/types/generators/RepeatableQuestRewardGenerator.d.ts b/types/generators/RepeatableQuestRewardGenerator.d.ts index 1e09994..bc78cca 100644 --- a/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; @@ -12,10 +12,10 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; import { ObjectId } from "@spt/utils/ObjectId"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RepeatableQuestRewardGenerator { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -33,26 +33,30 @@ export declare class RepeatableQuestRewardGenerator { protected questConfig: IQuestConfig; constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** - * Generate the reward for a mission. A reward can consist of + * Generate the reward for a mission. A reward can consist of: * - Experience * - Money + * - GP coins + * - Weapon preset * - Items * - Trader Reputation + * - Skill level experience * * The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to * experience / money / items / trader reputation can be defined in QuestConfig.js * - * There's also a random variation of the reward the spread of which can be also defined in the config. + * There's also a random variation of the reward the spread of which can be also defined in the config * * Additionally, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used - * - * @param {integer} pmcLevel player's level - * @param {number} difficulty a reward scaling factor from 0.2 to 1 - * @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader) - * @param {object} repeatableConfig The configuration for the repeatable kind (daily, weekly) as configured in QuestConfig for the requested quest - * @returns {object} object of "Reward"-type that can be given for a repeatable mission + * @param pmcLevel Level of player reward is being generated for + * @param difficulty Reward scaling factor from 0.2 to 1 + * @param traderId Trader reward will be given by + * @param repeatableConfig Config for quest type (daily, weekly) + * @param questConfig + * @param rewardTplBlacklist OPTIONAL: list of tpls to NOT use when picking a reward + * @returns IQuestRewards */ - generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig, rewardTplBlacklist?: string[]): IQuestRewards; protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; /** * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget @@ -133,7 +137,7 @@ export declare class RepeatableQuestRewardGenerator { * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ - protected generatePresetReward(tpl: string, count: number, index: number, preset?: Item[]): IQuestReward; + protected generatePresetReward(tpl: string, count: number, index: number, preset?: IItem[]): IQuestReward; /** * Picks rewardable items from items.json * This means they must: diff --git a/types/generators/ScavCaseRewardGenerator.d.ts b/types/generators/ScavCaseRewardGenerator.d.ts index 45f2e51..28ec2b6 100644 --- a/types/generators/ScavCaseRewardGenerator.d.ts +++ b/types/generators/ScavCaseRewardGenerator.d.ts @@ -1,10 +1,10 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; -import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; +import { IRewardCountAndPriceDetails, IScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -36,7 +36,7 @@ export declare class ScavCaseRewardGenerator { * @param recipeId recipe of the scav case craft * @returns Product array */ - generate(recipeId: string): Item[][]; + generate(recipeId: string): IItem[][]; /** * Get all db items that are not blacklisted in scavcase config or global blacklist * Store in class field @@ -48,7 +48,7 @@ export declare class ScavCaseRewardGenerator { * @param itemFilters how the rewards should be filtered down (by item count) * @returns */ - protected pickRandomRewards(items: ITemplateItem[], itemFilters: RewardCountAndPriceDetails, rarity: string): ITemplateItem[]; + protected pickRandomRewards(items: ITemplateItem[], itemFilters: IRewardCountAndPriceDetails, rarity: string): ITemplateItem[]; /** * Choose if money should be a reward based on the moneyRewardChancePercent config chance in scavCaseConfig * @returns true if reward should be money @@ -75,19 +75,19 @@ export declare class ScavCaseRewardGenerator { * @param rewardItems items to convert * @returns Product array */ - protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): Item[][]; + protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): IItem[][]; /** * @param dbItems all items from the items.json * @param itemFilters controls how the dbItems will be filtered and returned (handbook price) * @returns filtered dbItems array */ - protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: RewardCountAndPriceDetails): ITemplateItem[]; + protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: IRewardCountAndPriceDetails): ITemplateItem[]; /** * Gathers the reward min and max count params for each reward quality level from config and scavcase.json into a single object * @param scavCaseDetails scavcase.json values * @returns ScavCaseRewardCountsAndPrices object */ - protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): ScavCaseRewardCountsAndPrices; + protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): IScavCaseRewardCountsAndPrices; /** * Randomises the size of ammo and money stacks * @param itemToCalculate ammo or money item diff --git a/types/generators/WeatherGenerator.d.ts b/types/generators/WeatherGenerator.d.ts index c9ca02a..476f29c 100644 --- a/types/generators/WeatherGenerator.d.ts +++ b/types/generators/WeatherGenerator.d.ts @@ -1,6 +1,8 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; +import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IWeather, IWeatherData } from "@spt/models/eft/weather/IWeatherData"; +import { Season } from "@spt/models/enums/Season"; import { WindDirection } from "@spt/models/enums/WindDirection"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -10,6 +12,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class WeatherGenerator { protected weightedRandomHelper: WeightedRandomHelper; + protected weatherHelper: WeatherHelper; protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; @@ -18,7 +21,7 @@ export declare class WeatherGenerator { protected configServer: ConfigServer; protected weatherConfig: IWeatherConfig; private serverStartTimestampMS; - constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(weightedRandomHelper: WeightedRandomHelper, weatherHelper: WeatherHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Get current + raid datetime and format into correct BSG format and return * @param data Weather data @@ -32,12 +35,6 @@ export declare class WeatherGenerator { * @returns formatted time */ protected getBsgFormattedInRaidTime(): string; - /** - * Get the current in-raid time - * @param currentDate (new Date()) - * @returns Date object of current in-raid time - */ - getInRaidTime(): Date; /** * Get current time formatted to fit BSGs requirement * @param date date to format into bsg style @@ -46,14 +43,24 @@ export declare class WeatherGenerator { protected getBSGFormattedTime(date: Date): string; /** * Return randomised Weather data with help of config/weather.json + * @param currentSeason the currently active season + * @param timestamp OPTIONAL what timestamp to generate the weather data at, defaults to now when not supplied * @returns Randomised weather data */ - generateWeather(): IWeather; + generateWeather(currentSeason: Season, timestamp?: number): IWeather; + /** + * Choose a temprature for the raid based on time of day and current season + * @param currentSeason What season tarkov is currently in + * @param inRaidTimestamp What time is the raid running at + * @returns Timestamp + */ + protected getRaidTemperature(currentSeason: Season, inRaidTimestamp: number): number; /** * Set IWeather date/time/timestamp values to now * @param weather Object to update + * @param timestamp OPTIONAL, define timestamp used */ - protected setCurrentDateTime(weather: IWeather): void; + protected setCurrentDateTime(weather: IWeather, timestamp?: number): void; protected getWeightedWindDirection(): WindDirection; protected getWeightedClouds(): number; protected getWeightedWindSpeed(): number; diff --git a/types/generators/weapongen/InventoryMagGen.d.ts b/types/generators/weapongen/InventoryMagGen.d.ts index 1db9915..7e2011d 100644 --- a/types/generators/weapongen/InventoryMagGen.d.ts +++ b/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,10 +7,10 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): GenerationData; + constructor(magCounts: IGenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: IInventory); + getMagCount(): IGenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; - getPmcInventory(): Inventory; + getPmcInventory(): IInventory; } diff --git a/types/helpers/BotDifficultyHelper.d.ts b/types/helpers/BotDifficultyHelper.d.ts index 63572a5..ef30bbc 100644 --- a/types/helpers/BotDifficultyHelper.d.ts +++ b/types/helpers/BotDifficultyHelper.d.ts @@ -1,12 +1,13 @@ import { BotHelper } from "@spt/helpers/BotHelper"; -import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; +import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; +import { IBots } from "@spt/models/spt/bots/IBots"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BotDifficultyHelper { protected logger: ILogger; protected databaseService: DatabaseService; @@ -17,42 +18,21 @@ export declare class BotDifficultyHelper { protected cloner: ICloner; protected pmcConfig: IPmcConfig; constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); - /** - * Get a difficulty object modified to handle fighting other PMCs - * @param pmcType 'bear or 'usec' - * @param difficulty easy / normal / hard / impossible - * @param usecType pmcUSEC - * @param bearType pmcBEAR - * @returns Difficulty object - */ - getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; - /** - * Add bot types to ENEMY_BOT_TYPES array - * @param difficultySettings Bot settings to alter - * @param typesToAdd Bot types to add to enemy list - * @param typeBeingEdited Bot type to ignore and not add to enemy list - */ - protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void; - /** - * Configure difficulty settings to be hostile to USEC and BEAR - * Look up value in bot.json/chanceSameSideIsHostilePercent - * @param difficultySettings pmc difficulty settings - */ - protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void; /** * Get difficulty settings for desired bot type, if not found use assault bot types * @param type bot type to retrieve difficulty of * @param difficulty difficulty to get settings for (easy/normal etc) + * @param botDb bots from database * @returns Difficulty object */ - getBotDifficultySettings(type: string, difficulty: string): Difficulty; + getBotDifficultySettings(type: string, difficulty: string, botDb: IBots): IDifficultyCategories; /** * Get difficulty settings for a PMC * @param type "usec" / "bear" * @param difficulty what difficulty to retrieve * @returns Difficulty object */ - protected getDifficultySettings(type: string, difficulty: string): Difficulty; + protected getDifficultySettings(type: string, difficulty: string): IDifficultyCategories; /** * Translate chosen value from pre-raid difficulty dropdown into bot difficulty value * @param dropDownDifficulty Dropdown difficulty value to convert diff --git a/types/helpers/BotGeneratorHelper.d.ts b/types/helpers/BotGeneratorHelper.d.ts index 00ae8ae..468d27b 100644 --- a/types/helpers/BotGeneratorHelper.d.ts +++ b/types/helpers/BotGeneratorHelper.d.ts @@ -3,9 +3,9 @@ import { ContainerHelper } from "@spt/helpers/ContainerHelper"; import { DurabilityLimitsHelper } from "@spt/helpers/DurabilityLimitsHelper"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; -import { Grid, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IUpd, IUpdRepairable } from "@spt/models/eft/common/tables/IItem"; +import { IGrid, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ItemAddedResult } from "@spt/models/enums/ItemAddedResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/models/spt/config/IBotConfig"; @@ -37,7 +37,7 @@ export declare class BotGeneratorHelper { * @returns Item Upd object with extra properties */ generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): { - upd?: Upd; + upd?: IUpd; }; /** * Randomize the HpResource for bots e.g (245/400 resources) @@ -60,15 +60,14 @@ export declare class BotGeneratorHelper { * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): IUpdRepairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; - isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): IUpdRepairable; /** * Can item be added to another item without conflict * @param itemsEquipped Items to check compatibilities with @@ -76,7 +75,7 @@ export declare class BotGeneratorHelper { * @param equipmentSlot Slot the item will be placed into * @returns false if no incompatibilities, also has incompatibility reason */ - isItemIncompatibleWithCurrentItems(itemsEquipped: Item[], tplToCheck: string, equipmentSlot: string): IChooseRandomCompatibleModResult; + isItemIncompatibleWithCurrentItems(itemsEquipped: IItem[], tplToCheck: string, equipmentSlot: string): IChooseRandomCompatibleModResult; /** * Convert a bots role to the equipment role used in config/bot.json * @param botRole Role to convert @@ -92,12 +91,12 @@ export declare class BotGeneratorHelper { * @param inventory Inventory to add item+children into * @returns ItemAddedResult result object */ - addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: IItem[], inventory: IInventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside * @param itemTpl Item tpl being placed * @returns True if allowed */ - protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: IGrid, itemTpl: string): boolean; } diff --git a/types/helpers/BotHelper.d.ts b/types/helpers/BotHelper.d.ts index c5871ae..7dc9b59 100644 --- a/types/helpers/BotHelper.d.ts +++ b/types/helpers/BotHelper.d.ts @@ -1,6 +1,6 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { Difficulty, IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { IBotType, IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; +import { EquipmentFilters, IBotConfig, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -33,20 +33,15 @@ export declare class BotHelper { * @param difficultySettings bot settings to alter * @param typeToAdd bot type to add to friendly list */ - addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; + addBotToFriendlyList(difficultySettings: IDifficultyCategories, typeToAdd: string): void; /** * Add a bot to the REVENGE_BOT_TYPES array * @param difficultySettings bot settings to alter * @param typesToAdd bot type to add to revenge list */ - addBotToRevengeList(difficultySettings: Difficulty, typesToAdd: string[]): void; - /** - * 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 - * @returns true if should be a pmc - */ - shouldBotBePmc(botRole: string): boolean; - rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean; + addBotToRevengeList(difficultySettings: IDifficultyCategories, typesToAdd: string[]): void; + rollChanceToBePmc(botConvertMinMax: MinMax): boolean; + protected getPmcConversionValuesForLocation(location: string): Record; /** * is the provided role a PMC, case-agnostic * @param botRole Role to check @@ -59,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): IRandomisationDetails | undefined; /** * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role @@ -76,5 +71,11 @@ export declare class BotHelper { * @returns pmc side as string */ protected getRandomizedPmcSide(): string; - getPmcNicknameOfMaxLength(userId: string, maxLength: number): string; + /** + * Get a name from a PMC that fits the desired length + * @param maxLength Max length of name, inclusive + * @param side OPTIONAL - what side PMC to get name from (usec/bear) + * @returns name of PMC + */ + getPmcNicknameOfMaxLength(maxLength: number, side?: string): string; } diff --git a/types/helpers/BotWeaponGeneratorHelper.d.ts b/types/helpers/BotWeaponGeneratorHelper.d.ts index 5ab4e59..8a2d23a 100644 --- a/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,9 +1,9 @@ import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -27,13 +27,13 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: IGenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: GenerationData): number; + getRandomizedMagazineCount(magCounts: IGenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -47,7 +47,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): IItem[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets @@ -55,7 +55,7 @@ export declare class BotWeaponGeneratorHelper { * @param inventory bot inventory to add cartridges to * @param equipmentSlotsToAddTo what equipment slots should bullets be added into */ - addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; + addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: IInventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for diff --git a/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index c51bf7e..c38f0a0 100644 --- a/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -10,8 +10,8 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; import { MailSendService } from "@spt/services/MailSendService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class GiveSptCommand implements ISptCommand { protected logger: ILogger; protected itemHelper: ItemHelper; diff --git a/types/helpers/DialogueHelper.d.ts b/types/helpers/DialogueHelper.d.ts index febe696..7e1f9db 100644 --- a/types/helpers/DialogueHelper.d.ts +++ b/types/helpers/DialogueHelper.d.ts @@ -1,8 +1,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, MessagePreview } from "@spt/models/eft/profile/ISptProfile"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IDialogue, IMessagePreview } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -23,7 +23,7 @@ export declare class DialogueHelper { * @param dialogue * @returns MessagePreview */ - getMessagePreview(dialogue: Dialogue): MessagePreview; + getMessagePreview(dialogue: IDialogue): IMessagePreview; /** * Get the item contents for a particular message. * @param messageID @@ -31,11 +31,11 @@ export declare class DialogueHelper { * @param itemId Item being moved to inventory * @returns */ - getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + getMessageItemContents(messageID: string, sessionID: string, itemId: string): IItem[]; /** * Get the dialogs dictionary for a profile, create if doesnt exist * @param sessionId Session/player id * @returns Dialog dictionary */ - getDialogsForProfile(sessionId: string): Record; + getDialogsForProfile(sessionId: string): Record; } diff --git a/types/helpers/HandbookHelper.d.ts b/types/helpers/HandbookHelper.d.ts index 0ed965e..d677734 100644 --- a/types/helpers/HandbookHelper.d.ts +++ b/types/helpers/HandbookHelper.d.ts @@ -1,5 +1,5 @@ -import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IHandbookCategory } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -33,7 +33,7 @@ export declare class HandbookHelper { * @returns price in roubles */ getTemplatePrice(tpl: string): number; - getTemplatePriceForItems(items: Item[]): number; + getTemplatePriceForItems(items: IItem[]): number; /** * Get all items in template with the given parent category * @param parentId @@ -66,6 +66,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; - getCategoryById(handbookId: string): Category; + getCategoryById(handbookId: string): IHandbookCategory; } export {}; diff --git a/types/helpers/HealthHelper.d.ts b/types/helpers/HealthHelper.d.ts index 650f633..b05d008 100644 --- a/types/helpers/HealthHelper.d.ts +++ b/types/helpers/HealthHelper.d.ts @@ -1,12 +1,13 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { IBodyPartsHealth, IHealth } from "@spt/models/eft/common/tables/IBotBase"; import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; -import { Effects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; +import { IEffects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IHealthConfig } from "@spt/models/spt/config/IHealthConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class HealthHelper { protected logger: ILogger; protected timeUtil: TimeUtil; @@ -21,6 +22,23 @@ export declare class HealthHelper { * @returns updated profile */ resetVitality(sessionID: string): ISptProfile; + /** + * Update player profile vitality values with changes from client request object + * @param pmcData Player profile + * @param postRaidHealth Post raid data + * @param sessionID Session id + * @param isDead Is player dead + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) + */ + updateProfileHealthPostRaid(pmcData: IPmcData, postRaidHealth: IHealth, sessionID: string, isDead: boolean): void; + protected storeHydrationEnergyTempInProfile(fullProfile: ISptProfile, hydration: number, energy: number, temprature: number): void; + /** + * Take body part effects from client profile and apply to server profile + * @param postRaidBodyParts Post-raid body part data + * @param profileData Player profile on server + */ + protected transferPostRaidLimbEffectsToProfile(postRaidBodyParts: IBodyPartsHealth, profileData: IPmcData): void; /** * Update player profile vitality values with changes from client request object * @param pmcData Player profile @@ -45,7 +63,7 @@ export declare class HealthHelper { * @param bodyPartsWithEffects dict of body parts with effects that should be added to profile * @param addEffects Should effects be added back to profile */ - protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void; + protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: IEffects, deleteExistingEffects?: boolean): void; /** * Add effect to body part in profile * @param pmcData Player profile diff --git a/types/helpers/HideoutHelper.d.ts b/types/helpers/HideoutHelper.d.ts index c4aaa4c..21672c6 100644 --- a/types/helpers/HideoutHelper.d.ts +++ b/types/helpers/HideoutHelper.d.ts @@ -2,14 +2,15 @@ import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; -import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; +import { IBotHideoutArea, IHideoutImprovement, IProduction, IProductive } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IUpd } from "@spt/models/eft/common/tables/IItem"; +import { IHideoutArea, IStageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "@spt/models/eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -18,10 +19,10 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PlayerService } from "@spt/services/PlayerService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class HideoutHelper { protected logger: ILogger; protected hashUtil: HashUtil; @@ -37,6 +38,7 @@ export declare class HideoutHelper { protected configServer: ConfigServer; protected cloner: ICloner; static bitcoinFarm: string; + static cultistCircleCraftId: string; static bitcoinProductionId: string; static waterCollector: string; static maxSkillPoint: number; @@ -54,19 +56,19 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): IProduction; /** * Is the provided object a Production type * @param productive * @returns */ - isProductionType(productive: Productive): productive is Production; + isProductionType(productive: IProductive): productive is IProduction; /** * Apply bonus to player profile given after completing hideout upgrades * @param pmcData Profile to add bonus to * @param bonus Bonus to add to profile */ - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: IStageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -82,7 +84,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; + protected doesWaterCollectorHaveFilter(waterCollector: IBotHideoutArea): boolean; /** * Iterate over productions and update their progress timers * @param pmcData Profile to check for productions and update @@ -93,6 +95,21 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; + /** + * Is a craft from a particular hideout area + * @param craft Craft to check + * @param hideoutType Type to check craft against + * @returns True it is from that area + */ + protected isCraftOfType(craft: IProduction, hideoutType: HideoutAreas): boolean; + /** + * Has the craft completed + * Ignores bitcoin farm/cultist circle as they're continuous crafts + * @param craft Craft to check + + * @returns True when craft is compelte + */ + protected isCraftComplete(craft: IProduction): boolean; /** * Update progress timer for water collector * @param pmcData profile to update @@ -116,6 +133,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter?: boolean; }): void; + protected updateCultistCircleCraftProgress(pmcData: IPmcData, prodId: string): void; + protected flagCultistCircleCraftAsComplete(production: IProductive): void; /** * Check if a productions progress value matches its corresponding recipes production time value * @param pmcData Player profile @@ -147,8 +166,8 @@ export declare class HideoutHelper { * @param pmcData Player profile * @param isGeneratorOn Is the generator turned on since last update */ - protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, hideoutProperties: { + protected updateFuel(generatorArea: IBotHideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: IBotHideoutArea, hideoutProperties: { btcFarmCGs: number; isGeneratorOn: boolean; waterCollectorHasFilter: boolean; @@ -168,7 +187,7 @@ export declare class HideoutHelper { * @param isGeneratorOn is generator enabled * @param pmcData Player profile */ - protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): void; + protected updateWaterFilters(waterFilterArea: IBotHideoutArea, production: IProduction, isGeneratorOn: boolean, pmcData: IPmcData): void; /** * Get an adjusted water filter drain rate based on time elapsed since last run, * handle edge case when craft time has gone on longer than total production time @@ -198,15 +217,15 @@ export declare class HideoutHelper { * @param resourceUnitsConsumed * @returns Upd */ - protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; - protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; + protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): IUpd; + protected updateAirFilters(airFilterArea: IBotHideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; + protected updateBitcoinFarm(pmcData: IPmcData, btcProduction: IProductive, btcFarmCGs: number, isGeneratorOn: boolean): void; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object * @param coinCraftTimeSeconds Time to craft a bitcoin */ - protected addBtcToProduction(btcProd: Production, coinCraftTimeSeconds: number): void; + protected addBtcToProduction(btcProd: IProduction, coinCraftTimeSeconds: number): void; /** * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile @@ -248,7 +267,7 @@ export declare class HideoutHelper { * @returns Seconds to reduce craft time by */ getSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number, skill: SkillTypes, amountPerLevel: number): number; - isProduction(productive: Productive): productive is Production; + isProduction(productive: IProductive): productive is IProduction; /** * Gather crafted BTC from hideout area and add to inventory * Reset production start timestamp if hideout area at full coin capacity @@ -286,5 +305,12 @@ export declare class HideoutHelper { * @param activeDogtags Active dogtags in place of fame dogtag slots * @returns combat bonus */ - protected getDogtagCombatSkillBonusPercent(pmcData: IPmcData, activeDogtags: Item[]): number; + protected getDogtagCombatSkillBonusPercent(pmcData: IPmcData, activeDogtags: IItem[]): number; + /** + * The wall pollutes a profile with various temp buffs/debuffs, + * Remove them all + * @param wallAreaDb Hideout area data + * @param pmcData Player profile + */ + removeHideoutWallBuffsAndDebuffs(wallAreaDb: IHideoutArea, pmcData: IPmcData): void; } diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index 449be9f..11b4043 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -1,122 +1,35 @@ +import { QuestController } from "@spt/controllers/QuestController"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { PaymentHelper } from "@spt/helpers/PaymentHelper"; -import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { QuestHelper } from "@spt/helpers/QuestHelper"; -import { IPmcData, IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; -import { IQuestStatus, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; -import { LocalisationService } from "@spt/services/LocalisationService"; -import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { ICloner } from "@spt/utils/cloners/ICloner"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ProfileHelper } from "./ProfileHelper"; +import { QuestHelper } from "./QuestHelper"; export declare class InRaidHelper { protected logger: ILogger; - protected timeUtil: TimeUtil; - protected saveServer: SaveServer; + protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; + protected configServer: ConfigServer; + protected cloner: ICloner; protected databaseService: DatabaseService; - protected inventoryHelper: InventoryHelper; + protected questController: QuestController; protected profileHelper: ProfileHelper; protected questHelper: QuestHelper; - protected paymentHelper: PaymentHelper; - protected localisationService: LocalisationService; - protected profileFixerService: ProfileFixerService; - protected configServer: ConfigServer; - protected randomUtil: RandomUtil; - protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); - /** - * Lookup quest item loss from lostOnDeath config - * @returns True if items should be removed from inventory - */ - shouldQuestItemsBeRemovedOnDeath(): boolean; - /** - * Check items array and add an upd object to money 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 - */ - addStackCountToMoneyFromRaid(items: Item[]): void; - /** - * Reset a profile to a baseline, used post-raid - * Reset points earned during session property - * Increment exp - * @param profileData Profile to update - * @param saveProgressRequest post raid save data request data - * @param sessionID Session id - * @returns Reset profile object - */ - updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): void; + constructor(logger: ILogger, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner, databaseService: DatabaseService, questController: QuestController, profileHelper: ProfileHelper, questHelper: QuestHelper); /** + * @deprecated * Reset the skill points earned in a raid to 0, ready for next raid * @param profile Profile to update */ protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; - /** Check counters are correct in profile */ - protected validateTaskConditionCounters(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - /** - * Update various serverPMC profile values; quests/limb hp/trader standing with values post-raic - * @param pmcData Server PMC profile - * @param saveProgressRequest Post-raid request data - * @param sessionId Session id - */ - updatePmcProfileDataPostRaid(pmcData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; - /** - * Update scav quest values on server profile with updated values post-raid - * @param scavData Server scav profile - * @param saveProgressRequest Post-raid request data - * @param sessionId Session id - */ - updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; - /** - * Look for quests with a status different from what it began the raid with - * @param sessionId Player id - * @param pmcData Player profile - * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client with post-raid quests - */ - protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; - protected handleFailRestartableQuestStatus(pmcData: IPmcData, postRaidProfile: IPostRaidPmcData, postRaidQuest: IQuestStatus): void; - /** - * Take body part effects from client profile and apply to server profile - * @param saveProgressRequest post-raid request - * @param profileData player profile on server - */ - protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - /** - * Adjust server trader settings if they differ from data sent by client - * @param tradersServerProfile Server - * @param tradersClientProfile Client - */ - protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; - /** - * Transfer client achievements into profile - * @param profile Player pmc profile - * @param clientAchievements Achievements from client - */ - protected updateProfileAchievements(profile: IPmcData, clientAchievements: Record): void; - /** - * Set the SPT inraid location Profile property to 'none' - * @param sessionID Session id - */ - protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * 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: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid @@ -126,7 +39,14 @@ export declare class InRaidHelper { * @param serverProfile Profile to update * @param postRaidProfile Profile returned by client after a raid */ - setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData): void; + setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData, isSurvived: boolean, isTransfer: boolean): void; + /** + * 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; /** * Clear PMC inventory of all items except those that are exempt * Used post-raid to remove items after death @@ -134,29 +54,31 @@ export declare class InRaidHelper { * @param sessionId Session id */ deleteInventory(pmcData: IPmcData, sessionId: string): void; + /** + * Remove FiR status from designated container + * @param sessionId Session id + * @param pmcData Player profile + * @param secureContainerSlotId Container slot id to find items for and remove FiR from + */ + removeFiRStatusFromItemsInContainer(sessionId: string, pmcData: IPmcData, secureContainerSlotId: string): void; + /** + * Deletes quest conditions from pickup tasks given a list of quest items being carried by a PMC. + * @param carriedQuestItems Items carried by PMC at death, usually gotten from "CarriedQuestItems" + * @param sessionId Current sessionId + * @param pmcProfile Pre-raid profile that is being handled with raid information + */ + removePickupQuestConditions(carriedQuestItems: string[], sessionId: string, pmcProfile: IPmcData): void; /** * Get an array of items from a profile that will be lost on death * @param pmcProfile Profile to get items from * @returns Array of items lost on death */ - protected getInventoryItemsLostOnDeath(pmcProfile: IPmcData): Item[]; - /** - * Get items in vest/pocket/backpack inventory containers (excluding children) - * @param pmcData Player profile - * @returns Item array - */ - protected getBaseItemsInRigPocketAndBackpack(pmcData: IPmcData): Item[]; + protected getInventoryItemsLostOnDeath(pmcProfile: IPmcData): IItem[]; /** * Does the provided items slotId mean its kept on the player after death * @pmcData Player profile * @itemToCheck Item to check should be kept * @returns true if item is kept after death */ - protected isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: Item): boolean; - /** - * Return the equipped items from a players inventory - * @param items Players inventory to search through - * @returns an array of equipped items - */ - getPlayerGear(items: Item[]): Item[]; + protected isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: IItem): boolean; } diff --git a/types/helpers/InventoryHelper.d.ts b/types/helpers/InventoryHelper.d.ts index f0ff69a..c6bc6fe 100644 --- a/types/helpers/InventoryHelper.d.ts +++ b/types/helpers/InventoryHelper.d.ts @@ -6,8 +6,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IItemLocation, IUpd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; @@ -16,16 +16,16 @@ import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventor import { IInventorySplitRequestData } from "@spt/models/eft/inventory/IInventorySplitRequestData"; import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IInventoryConfig, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; +import { IInventoryConfig, IRewardDetails } from "@spt/models/spt/config/IInventoryConfig"; import { IOwnerInventoryItems } from "@spt/models/spt/inventory/IOwnerInventoryItems"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class InventoryHelper { protected logger: ILogger; protected hashUtil: HashUtil; @@ -65,33 +65,33 @@ export declare class InventoryHelper { * @param itemWithChildren An item * @param foundInRaid Item was found in raid */ - protected setFindInRaidStatusForItem(itemWithChildren: Item[], foundInRaid: boolean): void; + protected setFindInRaidStatusForItem(itemWithChildren: IItem[], foundInRaid: boolean): void; /** * Remove properties from a Upd object used by a trader/ragfair that are unnecessary to a player * @param upd Object to update */ - protected removeTraderRagfairRelatedUpdProperties(upd: Upd): void; + protected removeTraderRagfairRelatedUpdProperties(upd: IUpd): void; /** * Can all probided items be added into player inventory * @param sessionId Player id * @param itemsWithChildren array of items with children to try and fit * @returns True all items fit */ - canPlaceItemsInInventory(sessionId: string, itemsWithChildren: Item[][]): boolean; + canPlaceItemsInInventory(sessionId: string, itemsWithChildren: IItem[][]): boolean; /** * Do the provided items all fit into the grid * @param containerFS2D Container grid to fit items into * @param itemsWithChildren items to try and fit into grid * @returns True all fit */ - canPlaceItemsInContainer(containerFS2D: number[][], itemsWithChildren: Item[][]): boolean; + canPlaceItemsInContainer(containerFS2D: number[][], itemsWithChildren: IItem[][]): boolean; /** * Does an item fit into a container grid * @param containerFS2D Container grid * @param itemWithChildren item to check fits * @returns True it fits */ - canPlaceItemInContainer(containerFS2D: number[][], itemWithChildren: Item[]): boolean; + canPlaceItemInContainer(containerFS2D: number[][], itemWithChildren: IItem[]): boolean; /** * Find a free location inside a container to fit the item * @param containerFS2D Container grid to add item to @@ -99,7 +99,7 @@ export declare class InventoryHelper { * @param containerId Id of the container we're fitting item into * @param desiredSlotId slot id value to use, default is "hideout" */ - placeItemInContainer(containerFS2D: number[][], itemWithChildren: Item[], containerId: string, desiredSlotId?: string): void; + placeItemInContainer(containerFS2D: number[][], itemWithChildren: IItem[], containerId: string, desiredSlotId?: string): void; /** * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots @@ -109,7 +109,7 @@ export declare class InventoryHelper { * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ - protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; + protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: IItem[], playerInventory: IInventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -144,7 +144,7 @@ export declare class InventoryHelper { * @param inventoryItems * @returns [width, height] */ - getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + getItemSize(itemTpl: string, itemID: string, inventoryItems: IItem[]): number[]; /** * Calculates the size of an item including attachements * takes into account if item is folded @@ -162,14 +162,16 @@ export declare class InventoryHelper { */ protected getBlankContainerMap(containerH: number, containerY: number): number[][]; /** + * Get a 2d mapping of a container with what grid slots are filled * @param containerH Horizontal size of container * @param containerV Vertical size of container - * @param itemList + * @param itemList Players inventory items * @param containerId Id of the container * @returns Two-dimensional representation of container */ - getContainerMap(containerH: number, containerV: number, itemList: Item[], containerId: string): number[][]; - protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; + getContainerMap(containerH: number, containerV: number, itemList: IItem[], containerId: string): number[][]; + protected isVertical(itemLocation: IItemLocation): boolean; + protected getInventoryItemHash(inventoryItem: IItem[]): InventoryHelper.InventoryItemHash; /** * Return the inventory that needs to be modified (scav/pmc etc) * Changes made to result apply to character inventory @@ -217,7 +219,7 @@ export declare class InventoryHelper { * @param toItems Inventory of the destination * @param request Move request */ - moveItemToProfile(sourceItems: Item[], toItems: Item[], request: IInventoryMoveRequestData): void; + moveItemToProfile(sourceItems: IItem[], toItems: IItem[], request: IInventoryMoveRequestData): void; /** * Internal helper function to move item within the same profile_f. * @param pmcData profile to edit @@ -225,7 +227,7 @@ export declare class InventoryHelper { * @param moveRequest client move request * @returns True if move was successful */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + moveItemInternal(pmcData: IPmcData, inventoryItems: IItem[], moveRequest: IInventoryMoveRequestData): { success: boolean; errorMessage?: string; }; @@ -234,17 +236,17 @@ export declare class InventoryHelper { * @param pmcData Player profile * @param itemBeingMoved item being moved */ - protected updateFastPanelBinding(pmcData: IPmcData, itemBeingMoved: Item): void; + protected updateFastPanelBinding(pmcData: IPmcData, itemBeingMoved: IItem): void; /** * Internal helper function to handle cartridges in inventory if any of them exist. */ - protected handleCartridges(items: Item[], request: IInventoryMoveRequestData): void; + protected handleCartridges(items: IItem[], request: IInventoryMoveRequestData): void; /** * Get details for how a random loot container should be handled, max rewards, possible reward tpls * @param itemTpl Container being opened * @returns Reward details */ - getRandomLootContainerRewardDetails(itemTpl: string): RewardDetails; + getRandomLootContainerRewardDetails(itemTpl: string): IRewardDetails; getInventoryConfig(): IInventoryConfig; /** * Recursively checks if the given item is @@ -254,12 +256,21 @@ export declare class InventoryHelper { * @param itemToCheck Item to look for * @returns True if item exists inside stash */ - isItemInStash(pmcData: IPmcData, itemToCheck: Item): boolean; + isItemInStash(pmcData: IPmcData, itemToCheck: IItem): boolean; + validateInventoryUsesMonogoIds(itemsToValidate: IItem[]): void; + /** + * Does the provided item have a root item with the provided id + * @param pmcData Profile with items + * @param item Item to check + * @param rootId Root item id to check for + * @returns True when item has rootId, false when not + */ + doesItemHaveRootId(pmcData: IPmcData, item: IItem, rootId: string): boolean; } declare namespace InventoryHelper { interface InventoryItemHash { - byItemId: Record; - byParentId: Record; + byItemId: Record; + byParentId: Record; } } export {}; diff --git a/types/helpers/ItemHelper.d.ts b/types/helpers/ItemHelper.d.ts index da5dd11..366ad9b 100644 --- a/types/helpers/ItemHelper.d.ts +++ b/types/helpers/ItemHelper.d.ts @@ -1,8 +1,8 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IInsuredItem } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IUpd, IUpdRepairable } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -11,13 +11,13 @@ import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { CompareUtil } from "@spt/utils/CompareUtil"; import { HashUtil } from "@spt/utils/HashUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; import { MathUtil } from "@spt/utils/MathUtil"; import { ObjectId } from "@spt/utils/ObjectId"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; @@ -42,7 +42,7 @@ export declare class ItemHelper { * @param slotId OPTIONAL - slotid of desired item * @returns True if pool contains item */ - hasItemWithTpl(itemPool: Item[], item: ItemTpl, slotId?: string): boolean; + hasItemWithTpl(itemPool: IItem[], item: ItemTpl, slotId?: string): boolean; /** * Get the first item from provided pool with the desired tpl * @param itemPool Item collection to search @@ -50,7 +50,7 @@ export declare class ItemHelper { * @param slotId OPTIONAL - slotid of desired item * @returns Item or undefined */ - getItemFromPoolByTpl(itemPool: Item[], item: ItemTpl, slotId?: string): Item | undefined; + getItemFromPoolByTpl(itemPool: IItem[], item: ItemTpl, slotId?: string): IItem | undefined; /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -59,7 +59,7 @@ export declare class ItemHelper { * @param compareUpdProperties Upd properties to compare between the items * @returns true if they are the same, false if they arent */ - isSameItems(item1: Item[], item2: Item[], compareUpdProperties?: Set): boolean; + isSameItems(item1: IItem[], item2: IItem[], compareUpdProperties?: Set): boolean; /** * This method will compare two items and see if the are equivalent. * This method will NOT compare IDs on the items @@ -68,15 +68,21 @@ export declare class ItemHelper { * @param compareUpdProperties Upd properties to compare between the items * @returns true if they are the same, false if they arent */ - isSameItem(item1: Item, item2: Item, compareUpdProperties?: Set): boolean; + isSameItem(item1: IItem, item2: IItem, compareUpdProperties?: Set): boolean; /** * Helper method to generate a Upd based on a template * @param itemTemplate the item template to generate a Upd for * @returns A Upd with all the default properties set */ - generateUpdForItem(itemTemplate: ITemplateItem): Upd; + generateUpdForItem(itemTemplate: ITemplateItem): IUpd; /** - * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash + * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash + * Valid means: + * Not quest item + * 'Item' type + * Not on the invalid base types array + * Price above 0 roubles + * Not on item config blacklist * @param {string} tpl the template id / tpl * @returns boolean; true for items that may be in player possession and not quest items */ @@ -165,7 +171,7 @@ export declare class ItemHelper { * @param item Item to update * @returns Fixed item */ - fixItemStackCount(item: Item): Item; + fixItemStackCount(item: IItem): IItem; /** * Get cloned copy of all item data from items.json * @returns array of ITemplateItem objects @@ -185,7 +191,7 @@ export declare class ItemHelper { * @param skipArmorItemsWithoutDurability Skip over armor items without durability * @returns % quality modifer between 0 and 1 */ - getItemQualityModifierForItems(items: Item[], skipArmorItemsWithoutDurability?: boolean): number; + getItemQualityModifierForItems(items: IItem[], skipArmorItemsWithoutDurability?: boolean): number; /** * get normalized value (0-1) based on item condition * Will return -1 for base armor items with 0 durability @@ -193,7 +199,7 @@ export declare class ItemHelper { * @param skipArmorItemsWithoutDurability return -1 for armor items that have maxdurability of 0 * @returns Number between 0 and 1 */ - getItemQualityModifier(item: Item, skipArmorItemsWithoutDurability?: boolean): number; + getItemQualityModifier(item: IItem, skipArmorItemsWithoutDurability?: boolean): number; /** * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability * @param itemDetails Db details for item we want quality value for @@ -201,14 +207,14 @@ export declare class ItemHelper { * @param item Item quality value is for * @returns A number between 0 and 1 */ - protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: IUpdRepairable, item: IItem): number; /** * Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results * @param items Array of items (item + possible children) * @param baseItemId Parent items id * @returns an array of strings */ - findAndReturnChildrenByItems(items: Item[], baseItemId: string): string[]; + findAndReturnChildrenByItems(items: IItem[], baseItemId: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. * @param items Array of items (item + possible children) @@ -216,20 +222,20 @@ export declare class ItemHelper { * @param modsOnly Include only mod items, exclude items stored inside root item * @returns An array of Item objects */ - findAndReturnChildrenAsItems(items: Item[], baseItemId: string, modsOnly?: boolean): Item[]; + findAndReturnChildrenAsItems(items: IItem[], baseItemId: string, modsOnly?: boolean): IItem[]; /** * Find children of the item in a given assort (weapons parts for example, need recursive loop function) * @param itemIdToFind Template id of item to check for * @param assort Array of items to check in * @returns Array of children of requested item */ - findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + findAndReturnChildrenByAssort(itemIdToFind: string, assort: IItem[]): IItem[]; /** * Check if the passed in item has buy count restrictions * @param itemToCheck Item to check * @returns true if it has buy restrictions */ - hasBuyRestrictions(itemToCheck: Item): boolean; + hasBuyRestrictions(itemToCheck: IItem): boolean; /** * is the passed in template id a dog tag * @param tpl Template id to check @@ -241,7 +247,7 @@ export declare class ItemHelper { * @param item * @returns "slotId OR slotid,locationX,locationY" */ - getChildId(item: Item): string; + getChildId(item: IItem): string; /** * Can the passed in item be stacked * @param tpl item to check @@ -253,21 +259,28 @@ export declare class ItemHelper { * @param itemToSplit Item to split into smaller stacks * @returns Array of root item + children */ - splitStack(itemToSplit: Item): Item[]; + splitStack(itemToSplit: IItem): IItem[]; /** * Turn items like money into separate stacks that adhere to max stack size * @param itemToSplit Item to split into smaller stacks * @returns */ - splitStackIntoSeparateItems(itemToSplit: Item): Item[][]; + splitStackIntoSeparateItems(itemToSplit: IItem): IItem[][]; /** * Find Barter items from array of items * @param {string} by tpl or id - * @param {Item[]} itemsToSearch Array of items to iterate over + * @param {IItem[]} itemsToSearch Array of items to iterate over * @param {string} desiredBarterItemIds * @returns Array of Item objects */ - findBarterItems(by: "tpl" | "id", itemsToSearch: Item[], desiredBarterItemIds: string | string[]): Item[]; + findBarterItems(by: "tpl" | "id", itemsToSearch: IItem[], desiredBarterItemIds: string | string[]): IItem[]; + /** + * Replace the _id value for base item + all children that are children of it + * REPARENTS ROOT ITEM ID, NOTHING ELSE + * @param itemWithChildren Item with mods to update + * @param newId new id to add on chidren of base item + */ + replaceRootItemID(itemWithChildren: IItem[], newId?: string): void; /** * Regenerate all GUIDs with new IDs, for the exception of special item types (e.g. quest, sorting table, etc.) This * function will not mutate the original items array, but will return a new array with new GUIDs. @@ -278,13 +291,13 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; + replaceIDs(originalItems: IItem[], pmcData?: IPmcData, insuredItems?: IInsuredItem[], fastPanel?: any): IItem[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items * @param items The list of items to mark as FiR */ - setFoundInRaid(items: Item[]): void; + setFoundInRaid(items: IItem[]): void; /** * WARNING, SLOW. Recursively loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do * @param {string} tpl Items tpl to check parents of @@ -309,7 +322,7 @@ export declare class ItemHelper { * @param parent The parent of the item to be checked * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | undefined; + isRaidModdable(item: IItem, parent: IItem): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -326,14 +339,14 @@ export declare class ItemHelper { * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; + getAttachmentMainParent(itemId: string, itemsMap: Map): IItem | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * * @param item The item to check. * @returns true if the item is attached attachment, otherwise false. */ - isAttachmentAttached(item: Item): boolean; + isAttachmentAttached(item: IItem): boolean; /** * Retrieves the equipment parent item for a given item. * @@ -349,14 +362,14 @@ export declare class ItemHelper { * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; + getEquipmentParent(itemId: string, itemsMap: Map): IItem | undefined; /** * Get the inventory size of an item * @param items Item with children * @param rootItemId * @returns ItemSize object (width and height) */ - getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; + getItemSize(items: IItem[], rootItemId: string): ItemHelper.IItemSize; /** * Get a random cartridge from an items Filter property * @param item Db item template to look up Cartridge filter values from @@ -368,21 +381,21 @@ export declare class ItemHelper { * @param ammoBox Box to add cartridges to * @param ammoBoxDetails Item template from items db */ - addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + addCartridgesToAmmoBox(ammoBox: IItem[], ammoBoxDetails: ITemplateItem): void; /** * Add a single stack of cartridges to the ammo box * @param ammoBox Box to add cartridges to * @param ammoBoxDetails Item template from items db */ - addSingleStackCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + addSingleStackCartridgesToAmmoBox(ammoBox: IItem[], ammoBoxDetails: ITemplateItem): void; /** * Check if item is stored inside of a container - * @param item Item to check is inside of container + * @param itemToCheck Item to check is inside of container * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack * @param items Inventory with child parent items to check * @returns True when item is in container */ - itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; + itemIsInsideContainer(itemToCheck: IItem, desiredContainerSlotId: string, items: IItem[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to @@ -393,15 +406,15 @@ export declare class ItemHelper { * @param defaultCartridgeTpl Cartridge to use when none found * @param weapon Weapon the magazine will be used for (if passed in uses Chamber as whitelist) */ - fillMagazineWithRandomCartridge(magazine: Item[], magTemplate: ITemplateItem, staticAmmoDist: Record, caliber?: string, minSizePercent?: number, defaultCartridgeTpl?: string, weapon?: ITemplateItem): void; + fillMagazineWithRandomCartridge(magazine: IItem[], magTemplate: ITemplateItem, staticAmmoDist: Record, caliber?: string, minSizePercent?: number, defaultCartridgeTpl?: string, weapon?: ITemplateItem): void; /** * Add child items to a magazine of a specific cartridge * @param magazineWithChildCartridges Magazine to add child items to * @param magTemplate Db template of magazine * @param cartridgeTpl Cartridge to add to magazine - * @param minSizePercent % the magazine must be filled to + * @param minSizeMultiplier % the magazine must be filled to */ - fillMagazineWithCartridge(magazineWithChildCartridges: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void; + fillMagazineWithCartridge(magazineWithChildCartridges: IItem[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizeMultiplier?: number): void; /** * Choose a random bullet type from the list of possible a magazine has * @param magTemplate Magazine template from Db @@ -426,13 +439,13 @@ export declare class ItemHelper { * @param foundInRaid OPTIONAL - Are cartridges found in raid (SpawnedInSession) * @returns Item */ - createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number, foundInRaid?: boolean): Item; + createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number, foundInRaid?: boolean): IItem; /** * Get the size of a stack, return 1 if no stack object count property found * @param item Item to get stack size of * @returns size of stack */ - getItemStackSize(item: Item): number; + getItemStackSize(item: IItem): number; /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of @@ -453,7 +466,7 @@ export declare class ItemHelper { * @param requiredOnly Only add required mods * @returns Item with children */ - addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; + addChildSlotItems(itemToAdd: IItem[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): IItem[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from @@ -478,14 +491,14 @@ export declare class ItemHelper { * @param itemWithChildren Primary item + children of primary item * @returns Item array with updated IDs */ - reparentItemAndChildren(rootItem: Item, itemWithChildren: Item[]): Item[]; + reparentItemAndChildren(rootItem: IItem, itemWithChildren: IItem[]): IItem[]; /** * Update a root items _id property value to be unique * @param itemWithChildren Item to update root items _id property * @param newId Optional: new id to use * @returns New root id */ - remapRootItemId(itemWithChildren: Item[], newId?: string): string; + remapRootItemId(itemWithChildren: IItem[], newId?: string): string; /** * Adopts orphaned items by resetting them as root "hideout" items. Helpful in situations where a parent has been * deleted from a group of items and there are children still referencing the missing parent. This method will @@ -495,24 +508,37 @@ export declare class ItemHelper { * @param items Array of Items that should be adjusted. * @returns Array of Items that have been adopted. */ - adoptOrphanedItems(rootId: string, items: Item[]): Item[]; + adoptOrphanedItems(rootId: string, items: IItem[]): IItem[]; /** * Populate a Map object of items for quick lookup using their ID. * * @param items An array of Items that should be added to a Map. * @returns A Map where the keys are the item IDs and the values are the corresponding Item objects. */ - generateItemsMap(items: Item[]): Map; + generateItemsMap(items: IItem[]): Map; /** * Add a blank upd object to passed in item if it does not exist already * @param item item to add upd to * @param warningMessageWhenMissing text to write to log when upd object was not found * @returns True when upd object was added */ - addUpdObjectToItem(item: Item, warningMessageWhenMissing?: string): boolean; + addUpdObjectToItem(item: IItem, warningMessageWhenMissing?: string): boolean; + /** + * Return all tpls from Money enum + * @returns string tpls + */ + getMoneyTpls(): string[]; + /** + * Get a randomsied stack size for the passed in ammo + * @param ammoItemTemplate Ammo to get stack size for + * @param maxLimit default: Limit to 60 to prevent crazy values when players use stack increase mods + * @returns number + */ + getRandomisedAmmoStackSize(ammoItemTemplate: ITemplateItem, maxLimit?: number): number; + getItemBaseType(tpl: string, rootOnly?: boolean): string; } declare namespace ItemHelper { - interface ItemSize { + interface IItemSize { width: number; height: number; } diff --git a/types/helpers/NotificationSendHelper.d.ts b/types/helpers/NotificationSendHelper.d.ts index 3a74563..80beb77 100644 --- a/types/helpers/NotificationSendHelper.d.ts +++ b/types/helpers/NotificationSendHelper.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { MessageType } from "@spt/models/enums/MessageType"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -32,5 +32,5 @@ export declare class NotificationSendHelper { * @param senderDetails Who is sending the message * @returns Dialogue */ - protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): Dialogue; + protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): IDialogue; } diff --git a/types/helpers/NotifierHelper.d.ts b/types/helpers/NotifierHelper.d.ts index b947f1b..2732631 100644 --- a/types/helpers/NotifierHelper.d.ts +++ b/types/helpers/NotifierHelper.d.ts @@ -1,5 +1,5 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; -import { Message, MessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage, IMessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; import { IWsChatMessageReceived } from "@spt/models/eft/ws/IWsChatMessageReceived"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IWsRagfairOfferSold } from "@spt/models/eft/ws/IWsRagfairOfferSold"; @@ -17,12 +17,12 @@ export declare class NotifierHelper { * @param ragfairData Ragfair data to attach to notification * @returns */ - createRagfairOfferSoldNotification(dialogueMessage: Message, ragfairData: MessageContentRagfair): IWsRagfairOfferSold; + createRagfairOfferSoldNotification(dialogueMessage: IMessage, ragfairData: IMessageContentRagfair): IWsRagfairOfferSold; /** * Create a new notification with the specified dialogueMessage object * @param dialogueMessage * @returns */ - createNewMessageNotification(dialogueMessage: Message): IWsChatMessageReceived; + createNewMessageNotification(dialogueMessage: IMessage): IWsChatMessageReceived; getWebSocketServer(sessionID: string): string; } diff --git a/types/helpers/PresetHelper.d.ts b/types/helpers/PresetHelper.d.ts index f16d6ce..62fda36 100644 --- a/types/helpers/PresetHelper.d.ts +++ b/types/helpers/PresetHelper.d.ts @@ -40,9 +40,9 @@ export declare class PresetHelper { getAllPresets(): IPreset[]; getPresets(templateId: string): IPreset[]; /** - * Get the default preset for passed in item id - * @param templateId Item id to get preset for - * @returns Null if no default preset, otherwise IPreset + * Get a cloned default preset for passed in item tpl + * @param templateId Item tpl to get preset for + * @returns undefined if no default preset, otherwise IPreset */ getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; diff --git a/types/helpers/ProfileHelper.d.ts b/types/helpers/ProfileHelper.d.ts index 0671179..e36a349 100644 --- a/types/helpers/ProfileHelper.d.ts +++ b/types/helpers/ProfileHelper.d.ts @@ -1,8 +1,9 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase"; +import { Common, ICounterKeyValue, IStats } from "@spt/models/eft/common/tables/IBotBase"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; +import { BonusType } from "@spt/models/enums/BonusType"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -10,11 +11,10 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; import { Watermark } from "@spt/utils/Watermark"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class ProfileHelper { protected logger: ILogger; protected hashUtil: HashUtil; @@ -23,12 +23,11 @@ export declare class ProfileHelper { protected saveServer: SaveServer; protected databaseService: DatabaseService; protected itemHelper: ItemHelper; - protected profileSnapshotService: ProfileSnapshotService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected inventoryConfig: IInventoryConfig; - constructor(logger: ILogger, hashUtil: HashUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -47,18 +46,10 @@ export declare class ProfileHelper { */ getCompleteProfile(sessionId: string): IPmcData[]; /** - * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen - * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using - * the now updated profile values as a base, meaning it shows x2 xp gained - * Instead, clone the post-raid profile (so we dont alter its values), apply the pre-raid xp values to the cloned objects and return - * Delete snapshot of pre-raid profile prior to returning profile data - * @param sessionId Session id - * @param output pmc and scav profiles array - * @param pmcProfile post-raid pmc profile - * @param scavProfile post-raid scav profile - * @returns Updated profile array + * Sanitize any information from the profile that the client does not expect to receive + * @param clonedProfile A clone of the full player profile */ - protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; + protected sanitizeProfileForClient(clonedProfile: ISptProfile): void; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object @@ -120,7 +111,7 @@ export declare class ProfileHelper { * Get baseline counter values for a fresh profile * @returns Default profile Stats object */ - getDefaultCounters(): Stats; + getDefaultCounters(): IStats; /** * is this profile flagged for data removal * @param sessionID Profile id @@ -154,7 +145,7 @@ export declare class ProfileHelper { * @param counters Counters to search for key * @param keyToIncrement Key */ - incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + incrementStatCounter(counters: ICounterKeyValue[], keyToIncrement: string): void; /** * Check if player has a skill at elite level * @param skillType Skill to check @@ -190,6 +181,13 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + /** + * Iterate over all bonuses and sum up all bonuses of desired type in provided profile + * @param pmcProfile Player profile + * @param desiredBonus Bonus to sum up + * @returns Summed bonus value or 0 if no bonus found + */ + getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number; playerIsFleaBanned(pmcProfile: IPmcData): boolean; /** * Add an achievement to player profile @@ -198,4 +196,10 @@ export declare class ProfileHelper { */ addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; hasAccessToRepeatableFreeRefreshSystem(pmcProfile: IPmcData): boolean; + /** + * Find a profiles "Pockets" item and replace its tpl with passed in value + * @param pmcProfile Player profile + * @param newPocketTpl New tpl to set profiles Pockets to + */ + replaceProfilePocketTpl(pmcProfile: IPmcData, newPocketTpl: string): void; } diff --git a/types/helpers/QuestHelper.d.ts b/types/helpers/QuestHelper.d.ts index 2b84b8f..02fc439 100644 --- a/types/helpers/QuestHelper.d.ts +++ b/types/helpers/QuestHelper.d.ts @@ -8,7 +8,7 @@ import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Common, IQuestStatus } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition, IQuestReward } from "@spt/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData"; @@ -23,9 +23,9 @@ import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class QuestHelper { protected logger: ILogger; protected timeUtil: TimeUtil; @@ -102,20 +102,20 @@ export declare class QuestHelper { * @param questReward Reward item to fix * @returns Fixed rewards */ - protected processReward(questReward: IQuestReward): Item[]; + protected processReward(questReward: IQuestReward): IItem[]; /** * Add missing mod items to a quest armor reward * @param originalRewardRootItem Original armor reward item from IQuestReward.items object * @param questReward Armor reward from quest */ - protected generateArmorRewardChildSlots(originalRewardRootItem: Item, questReward: IQuestReward): void; + protected generateArmorRewardChildSlots(originalRewardRootItem: IItem, questReward: IQuestReward): void; /** * Gets a flat list of reward items for the given quest at a specific state (e.g. Fail/Success) * @param quest quest to get rewards for * @param status Quest status that holds the items (Started, Success, Fail) * @returns array of items with the correct maxStack */ - getQuestRewardItems(quest: IQuest, status: QuestStatus): Item[]; + getQuestRewardItems(quest: IQuest, status: QuestStatus): IItem[]; /** * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile * @param pmcData Player profile @@ -142,6 +142,22 @@ export declare class QuestHelper { * @param questId QuestId to check */ questIsForOtherSide(playerSide: string, questId: string): boolean; + /** + * Is the provided quest prevented from being viewed by the provided game version + * (Inclusive filter) + * @param gameVersion Game version to check against + * @param questId Quest id to check + * @returns True Quest should not be visible to game version + */ + protected questIsProfileBlacklisted(gameVersion: string, questId: string): boolean; + /** + * Is the provided quest able to be seen by the provided game version + * (Exclusive filter) + * @param gameVersion Game version to check against + * @param questId Quest id to check + * @returns True Quest should be visible to game version + */ + protected questIsProfileWhitelisted(gameVersion: string, questId: string): boolean; /** * Get quests that can be shown to player after failing a quest * @param failedQuestId Id of the quest failed by player @@ -152,7 +168,7 @@ export declare class QuestHelper { /** * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards - * @param bonusPercent Value to adjust money rewards by + * @param bonusPercent Pecent to adjust money rewards by * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ @@ -173,7 +189,7 @@ export declare class QuestHelper { * @param sessionId Session id * @param item Item that was adjusted */ - protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: Item): void; + protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: IItem): void; /** * Get quests, strip all requirement conditions except level * @param quests quests to process @@ -243,7 +259,7 @@ export declare class QuestHelper { * @param questResponse Response to send back to client * @returns Array of reward objects */ - applyQuestReward(profileData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): Item[]; + applyQuestReward(profileData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): IItem[]; /** * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile * also update client response recipeUnlocked array with craft id @@ -259,7 +275,7 @@ export declare class QuestHelper { * @param pmcData player profile * @returns bonus as a percent */ - protected getQuestMoneyRewardBonus(pmcData: IPmcData): number; + protected getQuestMoneyRewardBonusMultiplier(pmcData: IPmcData): number; /** * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for diff --git a/types/helpers/RagfairHelper.d.ts b/types/helpers/RagfairHelper.d.ts index 52ca467..0ec76d6 100644 --- a/types/helpers/RagfairHelper.d.ts +++ b/types/helpers/RagfairHelper.d.ts @@ -2,7 +2,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt/helpers/UtilityHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; @@ -36,7 +36,7 @@ export declare class RagfairHelper { * Iterate over array of identical items and merge stack count * Ragfair allows abnormally large stacks. */ - mergeStackable(items: Item[]): Item[]; + mergeStackable(items: IItem[]): IItem[]; /** * Return the symbol for a currency * e.g. 5449016a4bdc2d6f028b456f return ₽ diff --git a/types/helpers/RagfairOfferHelper.d.ts b/types/helpers/RagfairOfferHelper.d.ts index b526554..66a146d 100644 --- a/types/helpers/RagfairOfferHelper.d.ts +++ b/types/helpers/RagfairOfferHelper.d.ts @@ -9,14 +9,15 @@ import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairSortHelper } from "@spt/helpers/RagfairSortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; -import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { IRagfairConfig, ITieredFlea } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -55,6 +56,7 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; + protected botConfig: IBotConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see @@ -65,6 +67,7 @@ export declare class RagfairOfferHelper { * @returns Offers the player should see */ getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcData: IPmcData): IRagfairOffer[]; + protected checkAndLockOfferFromPlayerTieredFlea(tieredFlea: ITieredFlea, offer: IRagfairOffer, tieredFleaLimitTypes: string[], playerLevel: number): void; /** * Get matching offers that require the desired item and filter out offers from non traders if player is below ragfair unlock level * @param searchRequest Search request from client @@ -125,7 +128,7 @@ export declare class RagfairOfferHelper { * @param itemsInInventoryToList items to sum up * @returns Total count */ - getTotalStackCountSize(itemsInInventoryToList: Item[][]): number; + getTotalStackCountSize(itemsInInventoryToList: IItem[][]): number; /** * Add amount to players ragfair rating * @param sessionId Profile to update @@ -151,7 +154,7 @@ export declare class RagfairOfferHelper { * @param boughtAmount Amount item was purchased for * @returns IItemEventRouterResponse */ - protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; + completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; /** * Get a localised message for when players offer has sold on flea * @param itemTpl Item sold @@ -173,7 +176,7 @@ export declare class RagfairOfferHelper { * @param offer The flea offer * @returns True if the given item is functional */ - isItemFunctional(offerRootItem: Item, offer: IRagfairOffer): boolean; + isItemFunctional(offerRootItem: IItem, offer: IRagfairOffer): boolean; /** * Should a ragfair offer be visible to the player * @param searchRequest Search request @@ -190,7 +193,7 @@ export declare class RagfairOfferHelper { * @param item Item to check * @returns True if has condition */ - protected isConditionItem(item: Item): boolean; + protected isConditionItem(item: IItem): boolean; /** * Is items quality value within desired range * @param item Item to check quality of @@ -198,5 +201,5 @@ export declare class RagfairOfferHelper { * @param max Desired maximum quality * @returns True if in range */ - protected itemQualityInRange(item: Item, min: number, max: number): boolean; + protected itemQualityInRange(item: IItem, min: number, max: number): boolean; } diff --git a/types/helpers/RagfairSellHelper.d.ts b/types/helpers/RagfairSellHelper.d.ts index fc9e4b5..232ec51 100644 --- a/types/helpers/RagfairSellHelper.d.ts +++ b/types/helpers/RagfairSellHelper.d.ts @@ -1,4 +1,4 @@ -import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; +import { ISellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -28,5 +28,5 @@ export declare class RagfairSellHelper { * @param sellInOneGo All items listed get sold at once * @returns Array of purchases of item(s) listed */ - rollForSale(sellChancePercent: number, itemSellCount: number, sellInOneGo?: boolean): SellResult[]; + rollForSale(sellChancePercent: number, itemSellCount: number, sellInOneGo?: boolean): ISellResult[]; } diff --git a/types/helpers/RagfairServerHelper.d.ts b/types/helpers/RagfairServerHelper.d.ts index 927caf5..c7c72a0 100644 --- a/types/helpers/RagfairServerHelper.d.ts +++ b/types/helpers/RagfairServerHelper.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; @@ -12,9 +12,9 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** * Helper class for common ragfair server actions */ @@ -65,7 +65,7 @@ export declare class RagfairServerHelper { * @param sessionID Player to send items to * @param returnedItems Items to send to player */ - returnItems(sessionID: string, returnedItems: Item[]): void; + returnItems(sessionID: string, returnedItems: IItem[]): void; calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number; /** * Choose a currency at random with bias @@ -77,11 +77,11 @@ export declare class RagfairServerHelper { * @param item Preset item * @returns Array of weapon and its children */ - getPresetItems(item: Item): Item[]; + getPresetItems(item: IItem): IItem[]; /** * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json * @param item Preset item * @returns */ - getPresetItemsByTpl(item: Item): Item[]; + getPresetItemsByTpl(item: IItem): IItem[]; } diff --git a/types/helpers/RepairHelper.d.ts b/types/helpers/RepairHelper.d.ts index 99a21da..67da4ef 100644 --- a/types/helpers/RepairHelper.d.ts +++ b/types/helpers/RepairHelper.d.ts @@ -1,11 +1,11 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RepairHelper { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -24,7 +24,7 @@ export declare class RepairHelper { * @param traderQualityMultipler Trader quality value from traders base json * @param applyMaxDurabilityDegradation should item have max durability reduced */ - updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; + updateItemDurability(itemToRepair: IItem, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; /** * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material * @param armorMaterial What material is the armor being repaired made of @@ -42,5 +42,5 @@ export declare class RepairHelper { * @param traderQualityMultipler Different traders produce different loss values * @returns Amount to reduce max durability by */ - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + protected getRandomisedWeaponRepairDegradationValue(itemProps: IProps, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/types/helpers/RepeatableQuestHelper.d.ts b/types/helpers/RepeatableQuestHelper.d.ts index d92657e..8c65f40 100644 --- a/types/helpers/RepeatableQuestHelper.d.ts +++ b/types/helpers/RepeatableQuestHelper.d.ts @@ -1,8 +1,8 @@ import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; import { ProbabilityObject, ProbabilityObjectArray } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RepeatableQuestHelper { protected mathUtil: MathUtil; protected configServer: ConfigServer; diff --git a/types/helpers/SecureContainerHelper.d.ts b/types/helpers/SecureContainerHelper.d.ts index b6bcffe..7684486 100644 --- a/types/helpers/SecureContainerHelper.d.ts +++ b/types/helpers/SecureContainerHelper.d.ts @@ -1,8 +1,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -export interface OwnerInventoryItems { - from: Item[]; - to: Item[]; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +export interface IOwnerInventoryItems { + from: IItem[]; + to: IItem[]; sameInventory: boolean; isMail: boolean; } @@ -14,5 +14,5 @@ export declare class SecureContainerHelper { * @param items Inventory items to look for secure container in * @returns Array of ids */ - getSecureContainerItems(items: Item[]): string[]; + getSecureContainerItems(items: IItem[]): string[]; } diff --git a/types/helpers/TradeHelper.d.ts b/types/helpers/TradeHelper.d.ts index f994fda..c7e1e14 100644 --- a/types/helpers/TradeHelper.d.ts +++ b/types/helpers/TradeHelper.d.ts @@ -3,7 +3,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "@spt/models/eft/trade/IProcessSellTradeRequestData"; @@ -13,14 +13,16 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class TradeHelper { protected logger: ILogger; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; @@ -36,7 +38,7 @@ export declare class TradeHelper { protected cloner: ICloner; protected traderConfig: ITraderConfig; protected inventoryConfig: IInventoryConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, localisationService: LocalisationService, httpResponse: HttpResponseUtil, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, traderAssortHelper: TraderAssortHelper, traderPurchasePersisterService: TraderPurchasePersisterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, localisationService: LocalisationService, httpResponse: HttpResponseUtil, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, traderAssortHelper: TraderAssortHelper, traderPurchasePersisterService: TraderPurchasePersisterService, configServer: ConfigServer, cloner: ICloner); /** * Buy item from flea or trader * @param pmcData Player profile @@ -56,6 +58,7 @@ export declare class TradeHelper { * @param output IItemEventRouterResponse */ sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string, output: IItemEventRouterResponse): void; + protected incrementCirculateSoldToTraderCounter(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData): void; /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id @@ -65,5 +68,5 @@ export declare class TradeHelper { * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: IItem, assortId: string, count: number): void; } diff --git a/types/helpers/TraderAssortHelper.d.ts b/types/helpers/TraderAssortHelper.d.ts index 8f8f802..a50b589 100644 --- a/types/helpers/TraderAssortHelper.d.ts +++ b/types/helpers/TraderAssortHelper.d.ts @@ -4,7 +4,7 @@ import { AssortHelper } from "@spt/helpers/AssortHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITrader, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -14,9 +14,9 @@ import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class TraderAssortHelper { protected logger: ILogger; protected mathUtil: MathUtil; @@ -58,7 +58,7 @@ export declare class TraderAssortHelper { * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust */ - protected resetBuyRestrictionCurrentValue(assortItems: Item[]): void; + protected resetBuyRestrictionCurrentValue(assortItems: IItem[]): void; /** * Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed */ @@ -85,7 +85,7 @@ export declare class TraderAssortHelper { * @param traderId trader id * @returns array of Items */ - protected getPristineTraderAssorts(traderId: string): Item[]; + protected getPristineTraderAssorts(traderId: string): IItem[]; /** * Returns generated ragfair offers in a trader assort format * @returns Trader assort object diff --git a/types/helpers/TraderHelper.d.ts b/types/helpers/TraderHelper.d.ts index 52c0d9b..0cce160 100644 --- a/types/helpers/TraderHelper.d.ts +++ b/types/helpers/TraderHelper.d.ts @@ -2,9 +2,9 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { ITraderAssort, ITraderBase, ITraderLoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; @@ -52,7 +52,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; + getTraderAssortItemByAssortId(traderId: string, assortId: string): IItem | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -66,7 +66,7 @@ export declare class TraderHelper { * @param rawProfileTemplate Raw profile from profiles.json to look up standing from * @returns Standing value */ - protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + protected getStartingStanding(traderId: string, rawProfileTemplate: IProfileTraderTemplate): number; /** * Add an array of suit ids to a profiles suit array, no duplicates * @param fullProfile Profile to add to @@ -118,7 +118,7 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number | undefined; - getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; + getLoyaltyLevel(traderID: string, pmcData: IPmcData): ITraderLoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile * @param sessionID Session id @@ -130,7 +130,7 @@ export declare class TraderHelper { count: number; }[]; traderId: string; - }, itemPurchased: Item): void; + }, itemPurchased: IItem): void; /** * EoD and Unheard get a 20% bonus to personal trader limit purchases * @param buyRestrictionMax Existing value from trader item diff --git a/types/helpers/WeatherHelper.d.ts b/types/helpers/WeatherHelper.d.ts new file mode 100644 index 0000000..928017f --- /dev/null +++ b/types/helpers/WeatherHelper.d.ts @@ -0,0 +1,25 @@ +import { DateTime } from "@spt/models/enums/DateTime"; +import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +export declare class WeatherHelper { + protected logger: ILogger; + protected timeUtil: TimeUtil; + protected configServer: ConfigServer; + protected weatherConfig: IWeatherConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, configServer: ConfigServer); + /** + * Get the current in-raid time + * @param currentDate (new Date()) + * @returns Date object of current in-raid time + */ + getInRaidTime(timestamp?: number): Date; + /** + * Is the current raid at nighttime + * @param timeVariant PASS OR CURR (from raid settings) + * @returns True when nighttime + */ + isNightTime(timeVariant: DateTime): boolean; + isHourAtNightTime(currentHour: number): boolean; +} diff --git a/types/helpers/WeightedRandomHelper.d.ts b/types/helpers/WeightedRandomHelper.d.ts index f3a34f3..e6e2041 100644 --- a/types/helpers/WeightedRandomHelper.d.ts +++ b/types/helpers/WeightedRandomHelper.d.ts @@ -1,13 +1,4 @@ export declare class WeightedRandomHelper { - /** - * @deprecated USE getWeightedValue() WHERE POSSIBLE - * Gets a tplId from a weighted dictionary - * @param {tplId: weighting[]} itemArray - * @returns tplId - */ - getWeightedInventoryItem(itemArray: { - [tplId: string]: unknown; - } | ArrayLike): string; /** * Choos an item from the passed in array based on the weightings of each * @param itemArray Items and weights to use diff --git a/types/loaders/BundleLoader.d.ts b/types/loaders/BundleLoader.d.ts index e270988..fcbf97d 100644 --- a/types/loaders/BundleLoader.d.ts +++ b/types/loaders/BundleLoader.d.ts @@ -1,14 +1,14 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { BundleHashCacheService } from "@spt/services/cache/BundleHashCacheService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { JsonUtil } from "@spt/utils/JsonUtil"; import { VFS } from "@spt/utils/VFS"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class BundleInfo { modpath: string; filename: string; crc: number; dependencies: string[]; - constructor(modpath: string, bundle: BundleManifestEntry, bundleHash: number); + constructor(modpath: string, bundle: IBundleManifestEntry, bundleHash: number); } export declare class BundleLoader { protected httpServerHelper: HttpServerHelper; @@ -26,10 +26,10 @@ export declare class BundleLoader { addBundles(modpath: string): void; addBundle(key: string, b: BundleInfo): void; } -export interface BundleManifest { - manifest: BundleManifestEntry[]; +export interface IBundleManifest { + manifest: IBundleManifestEntry[]; } -export interface BundleManifestEntry { +export interface IBundleManifestEntry { key: string; dependencyKeys: string[]; } diff --git a/types/loaders/PostDBModLoader.d.ts b/types/loaders/PostDBModLoader.d.ts index b0c4bf4..a8bb6a9 100644 --- a/types/loaders/PostDBModLoader.d.ts +++ b/types/loaders/PostDBModLoader.d.ts @@ -1,10 +1,10 @@ -import { DependencyContainer } from "tsyringe"; import { OnLoad } from "@spt/di/OnLoad"; import { BundleLoader } from "@spt/loaders/BundleLoader"; import { ModTypeCheck } from "@spt/loaders/ModTypeCheck"; import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { LocalisationService } from "@spt/services/LocalisationService"; +import { DependencyContainer } from "tsyringe"; export declare class PostDBModLoader implements OnLoad { protected logger: ILogger; protected bundleLoader: BundleLoader; diff --git a/types/loaders/PostSptModLoader.d.ts b/types/loaders/PostSptModLoader.d.ts index fb54579..2603497 100644 --- a/types/loaders/PostSptModLoader.d.ts +++ b/types/loaders/PostSptModLoader.d.ts @@ -1,9 +1,9 @@ -import { DependencyContainer } from "tsyringe"; import { ModTypeCheck } from "@spt/loaders/ModTypeCheck"; import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; import { IModLoader } from "@spt/models/spt/mod/IModLoader"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { LocalisationService } from "@spt/services/LocalisationService"; +import { DependencyContainer } from "tsyringe"; export declare class PostSptModLoader implements IModLoader { protected logger: ILogger; protected preSptModLoader: PreSptModLoader; diff --git a/types/loaders/PreSptModLoader.d.ts b/types/loaders/PreSptModLoader.d.ts index bc846c8..e8166f1 100644 --- a/types/loaders/PreSptModLoader.d.ts +++ b/types/loaders/PreSptModLoader.d.ts @@ -1,7 +1,6 @@ -import { DependencyContainer } from "tsyringe"; import { ModLoadOrder } from "@spt/loaders/ModLoadOrder"; import { ModTypeCheck } from "@spt/loaders/ModTypeCheck"; -import { ModDetails } from "@spt/models/eft/profile/ISptProfile"; +import { IModDetails } from "@spt/models/eft/profile/ISptProfile"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IModLoader } from "@spt/models/spt/mod/IModLoader"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; @@ -11,6 +10,7 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { ModCompilerService } from "@spt/services/ModCompilerService"; import { JsonUtil } from "@spt/utils/JsonUtil"; import { VFS } from "@spt/utils/VFS"; +import { DependencyContainer } from "tsyringe"; export declare class PreSptModLoader implements IModLoader { protected logger: ILogger; protected vfs: VFS; @@ -36,7 +36,7 @@ export declare class PreSptModLoader implements IModLoader { */ getImportedModsNames(): string[]; getImportedModDetails(): Record; - getProfileModsGroupedByModName(profileMods: ModDetails[]): ModDetails[]; + getProfileModsGroupedByModName(profileMods: IModDetails[]): IModDetails[]; getModPath(mod: string): string; protected importModsAsync(): Promise; protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; diff --git a/types/models/eft/bot/IGenerateBotsRequestData.d.ts b/types/models/eft/bot/IGenerateBotsRequestData.d.ts index f1f7013..f0f7168 100644 --- a/types/models/eft/bot/IGenerateBotsRequestData.d.ts +++ b/types/models/eft/bot/IGenerateBotsRequestData.d.ts @@ -1,7 +1,7 @@ export interface IGenerateBotsRequestData { - conditions: Condition[]; + conditions: ICondition[]; } -export interface Condition { +export interface ICondition { /** e.g. assault/pmcBot/bossKilla */ Role: string; Limit: number; diff --git a/types/models/eft/common/IEmptyRequestData.d.ts b/types/models/eft/common/IEmptyRequestData.d.ts index 284d16e..52a7b12 100644 --- a/types/models/eft/common/IEmptyRequestData.d.ts +++ b/types/models/eft/common/IEmptyRequestData.d.ts @@ -1,2 +1 @@ -export interface IEmptyRequestData { -} +export type IEmptyRequestData = {}; diff --git a/types/models/eft/common/IGlobals.d.ts b/types/models/eft/common/IGlobals.d.ts index bfcb920..f23b608 100644 --- a/types/models/eft/common/IGlobals.d.ts +++ b/types/models/eft/common/IGlobals.d.ts @@ -1,5 +1,5 @@ import { Ixyz } from "@spt/models/eft/common/Ixyz"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IGlobals { time: number; config: IConfig; @@ -9,7 +9,80 @@ export interface IGlobals { BotWeaponScatterings: IBotWeaponScattering[]; ItemPresets: Record; } +export interface IArtilleryShelling { + ArtilleryMapsConfigs: Record; + ProjectileExplosionParams: IProjectileExplosionParams; + MaxCalledShellingCount: number; +} +export interface IArtilleryMapSettings { + PlanedShellingOn: boolean; + InitShellingTimer: number; + BeforeShellingSignalTime: number; + ShellingCount: number; + ZonesInShelling: number; + NewZonesForEachShelling: boolean; + InitCalledShellingTime: number; + ShellingZones: IShellingZone[]; + Brigades: IBrigade[]; + ArtilleryShellingAirDropSettings: IArtilleryShellingAirDropSettings; + PauseBetweenShellings: Ixyz; +} +export interface IShellingZone { + ID: number; + PointsInShellings: Ixyz; + ShellingRounds: number; + ShotCount: number; + PauseBetweenRounds: Ixyz; + PauseBetweenShots: Ixyz; + Center: Ixyz; + Rotate: number; + GridStep: Ixyz; + Points: Ixyz; + PointRadius: number; + ExplosionDistanceRange: Ixyz; + AlarmStages: IAlarmStage[]; + BeforeShellingSignalTime: number; + UsedInPlanedShelling: boolean; + UseInCalledShelling: boolean; + IsActive: boolean; +} +export interface IAlarmStage { + Value: { + x: number; + y: number; + }; +} +export interface IBrigade { + ID: number; + ArtilleryGuns: IArtilleryGun[]; +} +export interface IArtilleryGun { + Position: Ixyz; +} +export interface IArtilleryShellingAirDropSettings { + UseAirDrop: boolean; + AirDropTime: number; + AirDropPosition: Ixyz; + LootTemplateId: string; +} +export interface IProjectileExplosionParams { + Blindness: Ixyz; + Contusion: Ixyz; + ArmorDistanceDistanceDamage: Ixyz; + MinExplosionDistance: number; + MaxExplosionDistance: number; + FragmentsCount: number; + Strength: number; + ArmorDamage: number; + StaminaBurnRate: number; + PenetrationPower: number; + DirectionalDamageAngle: number; + DirectionalDamageMultiplier: number; + FragmentType: string; + DeadlyDistance: number; +} export interface IConfig { + ArtilleryShelling: IArtilleryShelling; content: IContent; AimPunchMagnitude: number; WeaponSkillProgressRate: number; @@ -29,8 +102,12 @@ export interface IConfig { Mastering: IMastering[]; GlobalItemPriceModifier: number; TradingUnlimitedItems: boolean; + TransitSettings: ITransitSettings; + TripwiresSettings: ITripwiresSettings; MaxLoyaltyLevelForAll: boolean; + MountingSettings: IMountingSettings; GlobalLootChanceModifier: number; + GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -47,8 +124,10 @@ export interface IConfig { UncheckOnShot: boolean; BotsEnabled: boolean; BufferZone: IBufferZone; + Airdrop: IAirdropGlobalSettings; ArmorMaterials: IArmorMaterials; ArenaEftTransferSettings: IArenaEftTransferSettings; + KarmaCalculationSettings: IKarmaCalculationSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -173,6 +252,80 @@ export interface IEventWeather { Wind: number; WindDirection: number; } +export interface ITransitSettings { + BearPriceMod: number; + ClearAllPlayerEffectsOnTransit: boolean; + CoefficientDiscountCharisma: number; + DeliveryMinPrice: number; + DeliveryPrice: number; + ModDeliveryCost: number; + PercentageOfMissingEnergyRestore: number; + PercentageOfMissingHealthRestore: number; + PercentageOfMissingWaterRestore: number; + ScavPriceMod: number; + UsecPriceMod: number; + active: boolean; +} +export interface ITripwiresSettings { + CollisionCapsuleCheckCoef: number; + CollisionCapsuleRadius: number; + DefuseTimeSeconds: number; + DestroyedSeconds: number; + GroundDotProductTolerance: number; + InertSeconds: number; + InteractionSqrDistance: number; + MaxHeightDifference: number; + MaxLength: number; + MaxPreviewLength: number; + MaxTripwireToPlayerDistance: number; + MinLength: number; + MultitoolDefuseTimeSeconds: number; + ShotSqrDistance: number; +} +export interface IMountingSettings { + MovementSettings: IMountingMovementSettings; + PointDetectionSettings: IMountingPointDetectionSettings; +} +export interface IMountingMovementSettings { + ApproachTime: number; + ApproachTimeDeltaAngleModifier: number; + ExitTime: number; + MaxApproachTime: number; + MaxPitchLimitExcess: number; + MaxVerticalMountAngle: number; + MaxYawLimitExcess: number; + MinApproachTime: number; + MountingCameraSpeed: number; + MountingSwayFactorModifier: number; + PitchLimitHorizontal: Ixyz; + PitchLimitHorizontalBipod: Ixyz; + PitchLimitVertical: Ixyz; + RotationSpeedClamp: number; + SensitivityMultiplier: number; +} +export interface IMountingPointDetectionSettings { + CheckHorizontalSecondaryOffset: number; + CheckWallOffset: number; + EdgeDetectionDistance: number; + GridMaxHeight: number; + GridMinHeight: number; + HorizontalGridFromTopOffset: number; + HorizontalGridSize: number; + HorizontalGridStepsAmount: number; + MaxFramesForRaycast: number; + MaxHorizontalMountAngleDotDelta: number; + MaxProneMountAngleDotDelta: number; + MaxVerticalMountAngleDotDelta: number; + PointHorizontalMountOffset: number; + PointVerticalMountOffset: number; + RaycastDistance: number; + SecondCheckVerticalDistance: number; + SecondCheckVerticalGridOffset: number; + SecondCheckVerticalGridSize: number; + SecondCheckVerticalGridSizeStepsAmount: number; + VerticalGridSize: number; + VerticalGridStepsAmount: number; +} export interface IGraphicSettings { ExperimentalFogInCity: boolean; } @@ -229,6 +382,8 @@ export interface IMatchEnd { survivedMult: number; runnerMult: number; killedMult: number; + transit_exp_reward: number; + transit_mult: number[][]; } export interface IKill { combo: ICombo[]; @@ -392,10 +547,30 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IAirdropGlobalSettings { + ParachuteEndOpenHeight: number; + ParachuteStartOpenHeight: number; + PlaneAdditionalDistance: number; + PlaneAirdropDuration: number; + PlaneAirdropFlareWait: number; + PlaneAirdropSmoke: number; + PlaneMaxFlightHeight: number; + PlaneMinFlightHeight: number; + PlaneSpeed: number; + SmokeActivateHeight: number; +} +export interface IKarmaCalculationSettings { + defaultPveKarmaValue: number; + enable: boolean; + expireDaysAfterLastRaid: number; + maxKarmaThresholdPercentile: number; + minKarmaThresholdPercentile: number; + minSurvivedRaidCount: number; +} export interface IArenaEftTransferSettings { - ArenaEftTransferSettings: ArenaEftTransferSettings; + ArenaEftTransferSettings: IArenaEftTransferSettings; } -export interface ArenaEftTransferSettings { +export interface IArenaEftTransferSettings { ArenaManagerReputationTaxMultiplier: number; CharismaTaxMultiplier: number; CreditPriceTaxMultiplier: number; @@ -805,6 +980,7 @@ export interface IRagFair { balancerAveragePriceCoefficient: number; delaySinceOfferAdd: number; uniqueBuyerTimeoutInDays: number; + userRatingChangeFrequencyMultiplayer: number; ratingSumForIncrease: number; ratingIncreaseCount: number; ratingSumForDecrease: number; @@ -813,6 +989,7 @@ export interface IRagFair { maxSumForDecreaseRatingPerOneSale: number; maxSumForRarity: IMaxSumForRarity; ChangePriceCoef: number; + ItemRestrictions: IItemGlobalRestrictions[]; balancerUserItemSaleCooldownEnabled: boolean; balancerUserItemSaleCooldown: number; youSellOfferMaxStorageTimeInHour: number; @@ -820,11 +997,15 @@ export interface IRagFair { isOnlyFoundInRaidAllowed: boolean; sellInOnePiece: number; } +export interface IItemGlobalRestrictions { + MaxFlea: number; + MaxFleaStacked: number; + TemplateId: string; +} export interface IMaxActiveOfferCount { from: number; to: number; count: number; - countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; @@ -842,7 +1023,10 @@ export interface IStamina { Capacity: number; SprintDrainRate: number; BaseRestorationRate: number; + BipodAimDrainRateMultiplier: number; JumpConsumption: number; + MountingHorizontalAimDrainRateMultiplier: number; + MountingVerticalAimDrainRateMultiplier: number; GrenadeHighThrow: number; GrenadeLowThrow: number; AimDrainRate: number; @@ -913,8 +1097,9 @@ export interface IAlpinist { RequirementTip: string; } export interface IRestrictionsInRaid { + MaxInLobby: number; + MaxInRaid: number; TemplateId: string; - Value: number; } export interface IFavoriteItemsSettings { WeaponStandMaxItemsCount: number; @@ -1013,6 +1198,7 @@ export interface ISquadSettings { SendRequestDelaySeconds: number; } export interface IInsurance { + ChangeForReturnItemsInOfflineRaid: number; MaxStorageTimeInHour: number; CoefOfSendingMessageTime: number; CoefOfHavingMarkOfUnknown: number; @@ -1028,6 +1214,7 @@ export interface ISkillsSettings { HideoutManagement: IHideoutManagement; Crafting: ICrafting; Metabolism: IMetabolism; + MountingErgonomicsBonusPerLevel: number; Immunity: Immunity; Endurance: IEndurance; Strength: IStrength; @@ -1053,6 +1240,7 @@ export interface ISkillsSettings { BearAksystems: any[]; BearHeavycaliber: any[]; BearRawpower: any[]; + BipodErgonomicsBonusPerLevel: number; UsecArsystems: any[]; UsecDeepweaponmodding_Settings: any[]; UsecLongrangeoptics_Settings: any[]; @@ -1112,6 +1300,7 @@ export interface IArmorCounters { export interface IHideoutManagement { SkillPointsPerAreaUpgrade: number; SkillPointsPerCraft: number; + CircleOfCultistsBonusPercent: number; ConsumptionReductionPerLevel: number; SkillBoostPercent: number; SkillPointsRate: ISkillPointsRate; @@ -1417,6 +1606,7 @@ export interface IFenceLevel { PaidExitCostModifier: number; BotFollowChance: number; ScavEquipmentSpawnChanceModifier: number; + TransitGridSize: Ixyz; PriceModifier: number; HostileBosses: boolean; HostileScavs: boolean; @@ -1435,6 +1625,7 @@ export interface IFenceLevel { ReactOnMarkOnUnknownsPVE: boolean; DeliveryGridSize: Ixyz; CanInteractWithBtr: boolean; + CircleOfCultistsBonusPercent: number; } export interface IInertia { InertiaLimits: Ixyz; @@ -1550,7 +1741,7 @@ export interface IPreset { _changeWeaponName: boolean; _name: string; _parent: string; - _items: Item[]; + _items: IItem[]; /** Default presets have this property */ _encyclopedia?: string; } diff --git a/types/models/eft/common/ILocation.d.ts b/types/models/eft/common/ILocation.d.ts index b8589c9..15a495c 100644 --- a/types/models/eft/common/ILocation.d.ts +++ b/types/models/eft/common/ILocation.d.ts @@ -1,7 +1,7 @@ -import { Exit, ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { ILooseLoot } from "@spt/models/eft/common/ILooseLoot"; +import { IExit, ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { IGroupPostion, ILooseLoot } from "@spt/models/eft/common/ILooseLoot"; import { Ixyz } from "@spt/models/eft/common/Ixyz"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface ILocation { /** Map meta-data */ base: ILocationBase; @@ -15,7 +15,7 @@ export interface ILocation { /** All possible static containers on map + their assign groupings */ statics: IStaticContainer; /** All possible map extracts */ - allExtracts: Exit[]; + allExtracts: IExit[]; } export interface IStaticContainer { containersGroups: Record; @@ -51,12 +51,12 @@ export interface IStaticPropsBase { Rotation: Ixyz; IsGroupPosition: boolean; IsAlwaysSpawn: boolean; - GroupPositions: any[]; + GroupPositions: IGroupPostion[]; Root: string; - Items: any[]; + Items: IItem[]; } export interface IStaticWeaponProps extends IStaticPropsBase { - Items: Item[]; + Items: IItem[]; } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; @@ -76,9 +76,9 @@ export interface IStaticForcedProps { itemTpl: string; } export interface IStaticContainerProps extends IStaticPropsBase { - Items: StaticItem[]; + Items: IStaticItem[]; } -export interface StaticItem { +export interface IStaticItem { _id: string; _tpl: string; } diff --git a/types/models/eft/common/ILocationBase.d.ts b/types/models/eft/common/ILocationBase.d.ts index 10f1a57..473648d 100644 --- a/types/models/eft/common/ILocationBase.d.ts +++ b/types/models/eft/common/ILocationBase.d.ts @@ -1,18 +1,20 @@ import { MinMax } from "@spt/models/common/MinMax"; import { Ixyz } from "@spt/models/eft/common/Ixyz"; +import { ISpawnpointTemplate } from "./ILooseLoot"; export interface ILocationBase { AccessKeys: string[]; - AirdropParameters: AirdropParameter[]; + AccessKeysPvE: string[]; + AirdropParameters: IAirdropParameter[]; Area: number; AveragePlayTime: number; AveragePlayerLevel: number; - Banners: Banner[]; - BossLocationSpawn: BossLocationSpawn[]; + Banners: IBanner[]; + BossLocationSpawn: IBossLocationSpawn[]; BotAssault: number; BotEasy: number; BotHard: number; BotImpossible: number; - BotLocationModifier: BotLocationModifier; + BotLocationModifier: IBotLocationModifier; BotMarksman: number; BotMax: number; BotMaxPlayer: number; @@ -41,14 +43,14 @@ export interface ILocationBase { Insurance: boolean; IsSecret: boolean; Locked: boolean; - Loot: any[]; - MatchMakerMinPlayersByWaitTime: MinPlayerWaitTime[]; + Loot: ISpawnpointTemplate[]; + MatchMakerMinPlayersByWaitTime: IMinPlayerWaitTime[]; MaxBotPerZone: number; MaxDistToFreePoint: number; MaxPlayers: number; MinDistToExitPoint: number; MinDistToFreePoint: number; - MinMaxBots: MinMaxBot[]; + MinMaxBots: IMinMaxBot[]; MinPlayers: number; MaxCoopGroup: number; Name: string; @@ -57,7 +59,7 @@ export interface ILocationBase { OcculsionCullingEnabled: boolean; OldSpawn: boolean; OpenZones: string; - Preview: Preview; + Preview: IPreview; PlayersRequestCount: number; RequiredPlayerLevel?: number; RequiredPlayerLevelMin?: number; @@ -67,8 +69,8 @@ export interface ILocationBase { ScavMaxPlayersInGroup: number; Rules: string; SafeLocation: boolean; - Scene: Scene; - SpawnPointParams: SpawnPointParam[]; + Scene: IScene; + SpawnPointParams: ISpawnPointParam[]; UnixDateTime: number; _Id: string; doors: any[]; @@ -76,21 +78,33 @@ export interface ILocationBase { EscapeTimeLimitCoop: number; EscapeTimeLimitPVE: number; exit_access_time: number; + ForceOnlineRaidInPVE: boolean; exit_count: number; exit_time: number; - exits: Exit[]; + exits: IExit[]; filter_ex: string[]; limits: ILimit[]; matching_min_seconds: number; GenerateLocalLootCache: boolean; - maxItemCountInLocation: MaxItemCountInLocation[]; + maxItemCountInLocation: IMaxItemCountInLocation[]; sav_summon_seconds: number; tmp_location_field_remove_me: number; + transits: ITransit[]; users_gather_seconds: number; users_spawn_seconds_n: number; users_spawn_seconds_n2: number; users_summon_seconds: number; - waves: Wave[]; + waves: IWave[]; +} +export interface ITransit { + activateAfterSec: string; + active: boolean; + conditions: string; + description: string; + id: number; + location: string; + target: string; + time: number; } export interface INonWaveGroupScenario { Chance: number; @@ -101,7 +115,7 @@ export interface INonWaveGroupScenario { export interface ILimit extends MinMax { items: any[]; } -export interface AirdropParameter { +export interface IAirdropParameter { AirdropPointDeactivateDistance: number; MinPlayersCountToSpawnAirdrop: number; PlaneAirdropChance: number; @@ -113,15 +127,15 @@ export interface AirdropParameter { PlaneAirdropStartMin: number; UnsuccessfulTryPenalty: number; } -export interface Banner { +export interface IBanner { id: string; - pic: Pic; + pic: IPic; } -export interface Pic { +export interface IPic { path: string; rcid: string; } -export interface BossLocationSpawn { +export interface IBossLocationSpawn { BossChance: number; BossDifficult: string; BossEscortAmount: string; @@ -135,48 +149,73 @@ export interface BossLocationSpawn { TriggerId: string; TriggerName: string; Delay?: number; + DependKarma?: boolean; + DependKarmaPVE?: boolean; ForceSpawn?: boolean; IgnoreMaxBots?: boolean; - Supports?: BossSupport[]; + Supports?: IBossSupport[]; sptId?: string; spawnMode: string[]; } -export interface BossSupport { +export interface IBossSupport { BossEscortAmount: string; BossEscortDifficult: string[]; BossEscortType: string; } -export interface BotLocationModifier { +export interface IBotLocationModifier { AccuracySpeed: number; + AdditionalHostilitySettings: IAdditionalHostilitySettings[]; DistToActivate: number; + DistToActivatePvE: number; DistToPersueAxemanCoef: number; DistToSleep: number; + DistToSleepPvE: number; GainSight: number; KhorovodChance: number; MagnetPower: number; MarksmanAccuratyCoef: number; Scattering: number; VisibleDistance: number; + MaxExfiltrationTime: number; + MinExfiltrationTime: number; +} +export interface IAdditionalHostilitySettings { + AlwaysEnemies: string[]; + AlwaysFriends: string[]; + BearEnemyChance: number; + BearPlayerBehaviour: string; + BotRole: string; + ChancedEnemies: IChancedEnemy[]; + Neutral: string[]; + SavagePlayerBehaviour: string; + SavageEnemyChance?: number; + UsecEnemyChance: number; + UsecPlayerBehaviour: string; + Warn: string[]; +} +export interface IChancedEnemy { + EnemyChance: number; + Role: string; } -export interface MinMaxBot extends MinMax { +export interface IMinMaxBot extends MinMax { WildSpawnType: WildSpawnType | string; } -export interface MinPlayerWaitTime { +export interface IMinPlayerWaitTime { minPlayers: number; time: number; } -export interface Preview { +export interface IPreview { path: string; rcid: string; } -export interface Scene { +export interface IScene { path: string; rcid: string; } -export interface SpawnPointParam { +export interface ISpawnPointParam { BotZoneName: string; Categories: string[]; - ColliderParams: ColliderParams; + ColliderParams: IColliderParams; CorePointId: number; DelayToCanSpawnSec: number; Id: string; @@ -185,15 +224,15 @@ export interface SpawnPointParam { Rotation: number; Sides: string[]; } -export interface ColliderParams { +export interface IColliderParams { _parent: string; - _props: Props; + _props: IProps; } -export interface Props { +export interface IProps { Center: Ixyz; Radius: number; } -export interface Exit { +export interface IExit { /** % Chance out of 100 exit will appear in raid */ Chance: number; ChancePVE: number; @@ -217,11 +256,11 @@ export interface Exit { RequirementTip: string; Side?: string; } -export interface MaxItemCountInLocation { +export interface IMaxItemCountInLocation { TemplateId: string; Value: number; } -export interface Wave { +export interface IWave { BotPreset: string; BotSide: string; SpawnPoints: string; @@ -234,9 +273,12 @@ export interface Wave { time_min: number; sptId?: string; ChanceGroup?: number; + SpawnMode: string[]; } export declare enum WildSpawnType { ASSAULT = "assault", MARKSMAN = "marksman", - PMCBOT = "pmcbot" + PMCBOT = "pmcbot", + BOSSKILLA = "bosskilla", + BOSSKNIGHT = "bossknight" } diff --git a/types/models/eft/common/ILocationsSourceDestinationBase.d.ts b/types/models/eft/common/ILocationsSourceDestinationBase.d.ts index e6bc8ee..4e455a1 100644 --- a/types/models/eft/common/ILocationsSourceDestinationBase.d.ts +++ b/types/models/eft/common/ILocationsSourceDestinationBase.d.ts @@ -1,9 +1,9 @@ import { ILocations } from "@spt/models/spt/server/ILocations"; export interface ILocationsGenerateAllResponse { locations: ILocations; - paths: Path[]; + paths: IPath[]; } -export interface Path { +export interface IPath { Source: string; Destination: string; } diff --git a/types/models/eft/common/ILooseLoot.d.ts b/types/models/eft/common/ILooseLoot.d.ts index b5b538c..392a48c 100644 --- a/types/models/eft/common/ILooseLoot.d.ts +++ b/types/models/eft/common/ILooseLoot.d.ts @@ -1,20 +1,20 @@ import { Ixyz } from "@spt/models/eft/common/Ixyz"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface ILooseLoot { - spawnpointCount: SpawnpointCount; - spawnpointsForced: SpawnpointsForced[]; - spawnpoints: Spawnpoint[]; + spawnpointCount: ISpawnpointCount; + spawnpointsForced: ISpawnpointsForced[]; + spawnpoints: ISpawnpoint[]; } -export interface SpawnpointCount { +export interface ISpawnpointCount { mean: number; std: number; } -export interface SpawnpointsForced { +export interface ISpawnpointsForced { locationId: string; probability: number; - template: SpawnpointTemplate; + template: ISpawnpointTemplate; } -export interface SpawnpointTemplate { +export interface ISpawnpointTemplate { Id: string; IsContainer: boolean; useGravity: boolean; @@ -23,20 +23,26 @@ export interface SpawnpointTemplate { Rotation: Ixyz; IsAlwaysSpawn: boolean; IsGroupPosition: boolean; - GroupPositions: any[]; + GroupPositions: IGroupPostion[]; Root: string; - Items: Item[]; + Items: IItem[]; } -export interface Spawnpoint { +export interface IGroupPostion { + Name: string; + Weight: number; + Postion: Ixyz; + Rotation: Ixyz; +} +export interface ISpawnpoint { locationId: string; probability: number; - template: SpawnpointTemplate; + template: ISpawnpointTemplate; itemDistribution: ItemDistribution[]; } export interface ItemDistribution { - composedKey: ComposedKey; + composedKey: IComposedKey; relativeProbability: number; } -export interface ComposedKey { +export interface IComposedKey { key: string; } diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index a7fe1ca..307277c 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -1,4 +1,4 @@ -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IItem, IUpd } from "@spt/models/eft/common/tables/IItem"; import { IPmcDataRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; import { BonusSkillType } from "@spt/models/enums/BonusSkillType"; @@ -12,29 +12,30 @@ export interface IBotBase { /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ sessionId: string; savage?: string; - Info: Info; - Customization: Customization; - Health: Health; - Inventory: Inventory; - Skills: Skills; - Stats: Stats; + karmaValue: number; + Info: IInfo; + Customization: ICustomization; + Health: IHealth; + Inventory: IInventory; + Skills: ISkills; + Stats: IStats; Encyclopedia: Record; TaskConditionCounters: Record; - InsuredItems: InsuredItem[]; - Hideout: Hideout; + InsuredItems: IInsuredItem[]; + Hideout: IHideout; Quests: IQuestStatus[]; - TradersInfo: Record; + TradersInfo: Record; UnlockedInfo: IUnlockedInfo; - RagfairInfo: RagfairInfo; + RagfairInfo: IRagfairInfo; /** Achievement id and timestamp */ Achievements: Record; RepeatableQuests: IPmcDataRepeatableQuest[]; - Bonuses: Bonus[]; - Notes: Notes; + Bonuses: IBonus[]; + Notes: INotes; CarExtractCounts: Record; CoopExtractCounts: Record; SurvivorClass: SurvivorClass; - WishList: string[]; + WishList: Record; moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; @@ -56,13 +57,14 @@ export interface ITaskConditionCounter { export interface IUnlockedInfo { unlockedProductionRecipe: string[]; } -export interface Info { +export interface IInfo { EntryPoint: string; Nickname: string; LowerNickname: string; Side: string; SquadInviteRestriction: boolean; HasCoopExtension: boolean; + HasPveGame: boolean; Voice: string; Level: number; Experience: number; @@ -70,22 +72,22 @@ export interface Info { GameVersion: string; AccountType: number; MemberCategory: MemberCategory; + SelectedMemberCategory: MemberCategory; lockedMoveCommands: boolean; SavageLockTime: number; LastTimePlayedAsSavage: number; - Settings: Settings; + Settings: IBotInfoSettings; NicknameChangeDate: number; NeedWipeOptions: any[]; - lastCompletedWipe: LastCompleted; + lastCompletedWipe: ILastCompleted; Bans: IBan[]; BannedState: boolean; BannedUntil: number; IsStreamerModeAvailable: boolean; - lastCompletedEvent?: LastCompleted; - SelectedMemberCategory: number; + lastCompletedEvent?: ILastCompleted; isMigratedSkills: boolean; } -export interface Settings { +export interface IBotInfoSettings { Role: string; BotDifficulty: string; Experience: number; @@ -105,42 +107,43 @@ export declare enum BanType { FRIENDS = 5, CHANGE_NICKNAME = 6 } -export interface Customization { +export interface ICustomization { Head: string; Body: string; Feet: string; Hands: string; } -export interface Health { - Hydration: CurrentMax; - Energy: CurrentMax; - Temperature: CurrentMax; - BodyParts: BodyPartsHealth; +export interface IHealth { + Hydration: ICurrentMax; + Energy: ICurrentMax; + Temperature: ICurrentMax; + BodyParts: IBodyPartsHealth; UpdateTime: number; Immortal?: boolean; } -export interface BodyPartsHealth { - Head: BodyPartHealth; - Chest: BodyPartHealth; - Stomach: BodyPartHealth; - LeftArm: BodyPartHealth; - RightArm: BodyPartHealth; - LeftLeg: BodyPartHealth; - RightLeg: BodyPartHealth; -} -export interface BodyPartHealth { - Health: CurrentMax; - Effects?: Record; -} -export interface BodyPartEffectProperties { +export interface IBodyPartsHealth { + Head: IBodyPartHealth; + Chest: IBodyPartHealth; + Stomach: IBodyPartHealth; + LeftArm: IBodyPartHealth; + RightArm: IBodyPartHealth; + LeftLeg: IBodyPartHealth; + RightLeg: IBodyPartHealth; +} +export interface IBodyPartHealth { + Health: ICurrentMax; + Effects?: Record; +} +export interface IBodyPartEffectProperties { + ExtraData?: any; Time: number; } -export interface CurrentMax { +export interface ICurrentMax { Current: number; Maximum: number; } -export interface Inventory { - items: Item[]; +export interface IInventory { + items: IItem[]; equipment: string; stash: string; sortingTable: string; @@ -149,16 +152,16 @@ export interface Inventory { /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ hideoutAreaStashes: Record; fastPanel: Record; - favoriteItems: string[]; + favoriteItems: IItem[]; } export interface IBaseJsonSkills { Common: Record; - Mastering: Record; + Mastering: Record; Points: number; } -export interface Skills { +export interface ISkills { Common: Common[]; - Mastering: Mastering[]; + Mastering: IMastering[]; Points: number; } export interface IBaseSkill { @@ -171,26 +174,26 @@ export interface Common extends IBaseSkill { PointsEarnedDuringSession?: number; LastAccess?: number; } -export interface Mastering extends IBaseSkill { +export interface IMastering extends IBaseSkill { } -export interface Stats { +export interface IStats { Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; - Victims: Victim[]; + Victims: IVictim[]; TotalSessionExperience: number; LastSessionDate: number; - SessionCounters: SessionCounters; - OverallCounters: OverallCounters; + SessionCounters: ISessionCounters; + OverallCounters: IOverallCounters; SessionExperienceMult?: number; ExperienceBonusMult?: number; - Aggressor?: Aggressor; + Aggressor?: IAggressor; DroppedItems?: IDroppedItem[]; - FoundInRaidItems?: FoundInRaidItem[]; - DamageHistory?: DamageHistory; - DeathCause?: DeathCause; - LastPlayerState?: LastPlayerState; + FoundInRaidItems?: IFoundInRaidItem[]; + DamageHistory?: IDamageHistory; + DeathCause?: IDeathCause; + LastPlayerState?: ILastPlayerState; TotalInGameTime: number; SurvivorClass?: string; sptLastRaidFenceRepChange?: number; @@ -200,11 +203,11 @@ export interface IDroppedItem { ItemId: string; ZoneId: string; } -export interface FoundInRaidItem { +export interface IFoundInRaidItem { QuestId: string; ItemId: string; } -export interface Victim { +export interface IVictim { AccountId: string; ProfileId: string; Name: string; @@ -216,17 +219,17 @@ export interface Victim { Weapon: string; Role: string; } -export interface SessionCounters { - Items: CounterKeyValue[]; +export interface ISessionCounters { + Items: ICounterKeyValue[]; } -export interface OverallCounters { - Items: CounterKeyValue[]; +export interface IOverallCounters { + Items: ICounterKeyValue[]; } -export interface CounterKeyValue { +export interface ICounterKeyValue { Key: string[]; Value: number; } -export interface Aggressor { +export interface IAggressor { AccountId: string; ProfileId: string; MainProfileNickname: string; @@ -237,12 +240,12 @@ export interface Aggressor { WeaponName: string; Category: string; } -export interface DamageHistory { +export interface IDamageHistory { LethalDamagePart: string; - LethalDamage: LethalDamage; - BodyParts: BodyPartsDamageHistory; + LethalDamage: ILethalDamage; + BodyParts: IBodyPartsDamageHistory; } -export interface LethalDamage { +export interface ILethalDamage { Amount: number; Type: string; SourceId: string; @@ -250,17 +253,17 @@ export interface LethalDamage { Blunt: boolean; ImpactsCount: number; } -export interface BodyPartsDamageHistory { - Head: DamageStats[]; - Chest: DamageStats[]; - Stomach: DamageStats[]; - LeftArm: DamageStats[]; - RightArm: DamageStats[]; - LeftLeg: DamageStats[]; - RightLeg: DamageStats[]; - Common: DamageStats[]; -} -export interface DamageStats { +export interface IBodyPartsDamageHistory { + Head: IDamageStats[]; + Chest: IDamageStats[]; + Stomach: IDamageStats[]; + LeftArm: IDamageStats[]; + RightArm: IDamageStats[]; + LeftLeg: IDamageStats[]; + RightLeg: IDamageStats[]; + Common: IDamageStats[]; +} +export interface IDamageStats { Amount: number; Type: string; SourceId: string; @@ -268,55 +271,63 @@ export interface DamageStats { Blunt: boolean; ImpactsCount: number; } -export interface DeathCause { +export interface IDeathCause { DamageType: string; Side: string; Role: string; WeaponId: string; } -export interface LastPlayerState { - Info: LastPlayerStateInfo; +export interface ILastPlayerState { + Info: ILastPlayerStateInfo; Customization: Record; Equipment: any; } -export interface LastPlayerStateInfo { +export interface ILastPlayerStateInfo { Nickname: string; Side: string; Level: number; MemberCategory: MemberCategory; } -export interface BackendCounter { +export interface IBackendCounter { id: string; qid?: string; value: number; } -export interface InsuredItem { +export interface IInsuredItem { /** Trader Id item was insured by */ tid: string; itemId: string; } -export interface Hideout { - Production: Record; - Areas: HideoutArea[]; - Improvement: Record; +export interface IHideout { + Production: Record; + Areas: IBotHideoutArea[]; + Improvements: Record; + HideoutCounters: IHideoutCounters; Seed: number; + MannequinPoses: string[]; sptUpdateLastRunTimestamp: number; } +export interface IHideoutCounters { + fuelCounter: number; + airFilterCounter: number; + waterFilterCounter: number; + craftingTimeCounter: number; +} export interface IHideoutImprovement { completed: boolean; improveCompleteTimestamp: number; } -export interface Productive { - Products: Product[]; +export interface IProductive { + Products: IProduct[]; /** Seconds passed of production */ Progress?: number; /** Is craft in some state of being worked on by client (crafting/ready to pick up) */ inProgress?: boolean; - StartTimestamp?: number; + StartTimestamp?: string; SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; - GivenItemsInStart?: string[]; + GivenItemsInStart?: IItem[]; Interrupted?: boolean; Code?: string; Decoded?: boolean; @@ -331,22 +342,23 @@ export interface Productive { /** Is the craft a Continuous, e.g bitcoins/water collector */ sptIsContinuous?: boolean; /** Stores a list of tools used in this craft and whether they're FiR, to give back once the craft is done */ - sptRequiredTools?: Item[]; + sptRequiredTools?: IItem[]; + sptIsCultistCircle?: boolean; } -export interface Production extends Productive { +export interface IProduction extends IProductive { RecipeId: string; - SkipTime: number; - ProductionTime: number; + SkipTime?: number; + ProductionTime?: number; } -export interface ScavCase extends Productive { +export interface IScavCase extends IProductive { RecipeId: string; } -export interface Product { +export interface IProduct { _id: string; _tpl: string; - upd?: Upd; + upd?: IUpd; } -export interface HideoutArea { +export interface IBotHideoutArea { type: HideoutAreas; level: number; active: boolean; @@ -354,26 +366,24 @@ export interface HideoutArea { /** Must be integer */ completeTime: number; constructing: boolean; - slots: HideoutSlot[]; + slots: IHideoutSlot[]; lastRecipe: string; } -export interface HideoutSlot { +export interface IHideoutSlot { /** SPT specific value to keep track of what index this slot is (0,1,2,3 etc) */ locationIndex: number; - item?: HideoutItem[]; + item?: IHideoutItem[]; } -export interface HideoutItem { +export interface IHideoutItem { _id: string; _tpl: string; - upd?: Upd; + upd?: IUpd; } -export interface LastCompleted { +export interface ILastCompleted { $oid: string; } -export interface Notes { - Notes: Note[]; -} -export interface CarExtractCounts { +export interface INotes { + Notes: INote[]; } export declare enum SurvivorClass { UNKNOWN = 0, @@ -391,20 +401,20 @@ export interface IQuestStatus { completedConditions?: string[]; availableAfter?: number; } -export interface TraderInfo { - loyaltyLevel: number; +export interface ITraderInfo { + loyaltyLevel?: number; salesSum: number; standing: number; nextResupply: number; unlocked: boolean; disabled: boolean; } -export interface RagfairInfo { +export interface IRagfairInfo { rating: number; isRatingGrowing: boolean; offers: IRagfairOffer[]; } -export interface Bonus { +export interface IBonus { id?: string; type: BonusType; templateId?: string; @@ -416,7 +426,7 @@ export interface Bonus { filter?: string[]; skillType?: BonusSkillType; } -export interface Note { +export interface INote { Time: number; Text: string; } diff --git a/types/models/eft/common/tables/IBotType.d.ts b/types/models/eft/common/tables/IBotType.d.ts index 074a7d6..6d4b0c7 100644 --- a/types/models/eft/common/tables/IBotType.d.ts +++ b/types/models/eft/common/tables/IBotType.d.ts @@ -1,28 +1,28 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { Skills } from "@spt/models/eft/common/tables/IBotBase"; +import { ISkills } from "@spt/models/eft/common/tables/IBotBase"; export interface IBotType { - appearance: Appearance; - chances: Chances; - difficulty: Difficulties; - experience: Experience; + appearance: IAppearance; + chances: IChances; + difficulty: IDifficulties; + experience: IExperience; firstName: string[]; - generation: Generation; - health: Health; - inventory: Inventory; + generation: IGeneration; + health: IHealth; + inventory: IInventory; lastName: string[]; - skills: Skills; + skills: ISkills; } -export interface Appearance { +export interface IAppearance { body: Record; feet: Record; hands: Record; head: Record; voice: Record; } -export interface Chances { +export interface IChances { equipment: EquipmentChances; - weaponMods: ModsChances; - equipmentMods: ModsChances; + weaponMods: IModsChances; + equipmentMods: IModsChances; } export interface EquipmentChances { ArmBand: number; @@ -40,7 +40,7 @@ export interface EquipmentChances { SecuredContainer: number; TacticalVest: number; } -export interface ModsChances { +export interface IModsChances { mod_charge: number; mod_equipment: number; mod_equipment_000: number; @@ -74,13 +74,13 @@ export interface ModsChances { mod_tactical_003: number; mod_handguard: number; } -export interface Difficulties { - easy: Difficulty; - normal: Difficulty; - hard: Difficulty; - impossible: Difficulty; +export interface IDifficulties { + easy: IDifficultyCategories; + normal: IDifficultyCategories; + hard: IDifficultyCategories; + impossible: IDifficultyCategories; } -export interface Difficulty { +export interface IDifficultyCategories { Aiming: Record; Boss: Record; Change: Record; @@ -96,42 +96,42 @@ export interface Difficulty { Scattering: Record; Shoot: Record; } -export interface Experience { +export interface IExperience { aggressorBonus: number; level: MinMax; reward: MinMax; standingForKill: number; } -export interface Generation { - items: GenerationWeightingItems; -} -export interface GenerationWeightingItems { - grenades: GenerationData; - healing: GenerationData; - drugs: GenerationData; - food: GenerationData; - drink: GenerationData; - currency: GenerationData; - stims: GenerationData; - backpackLoot: GenerationData; - pocketLoot: GenerationData; - vestLoot: GenerationData; - magazines: GenerationData; - specialItems: GenerationData; -} -export interface GenerationData { +export interface IGeneration { + items: IGenerationWeightingItems; +} +export interface IGenerationWeightingItems { + grenades: IGenerationData; + healing: IGenerationData; + drugs: IGenerationData; + food: IGenerationData; + drink: IGenerationData; + currency: IGenerationData; + stims: IGenerationData; + backpackLoot: IGenerationData; + pocketLoot: IGenerationData; + vestLoot: IGenerationData; + magazines: IGenerationData; + specialItems: IGenerationData; +} +export interface IGenerationData { /** key: number of items, value: weighting */ weights: Record; /** Array of item tpls */ whitelist: Record; } -export interface Health { - BodyParts: BodyPart[]; +export interface IHealth { + BodyParts: IBodyPart[]; Energy: MinMax; Hydration: MinMax; Temperature: MinMax; } -export interface BodyPart { +export interface IBodyPart { Chest: MinMax; Head: MinMax; LeftArm: MinMax; @@ -140,13 +140,13 @@ export interface BodyPart { RightLeg: MinMax; Stomach: MinMax; } -export interface Inventory { - equipment: Equipment; - Ammo: Record>; - items: Items; - mods: Mods; +export interface IInventory { + equipment: IEquipment; + Ammo: IAmmo; + items: IItemPools; + mods: IMods; } -export interface Equipment { +export interface IEquipment { ArmBand: Record; ArmorVest: Record; Backpack: Record; @@ -162,11 +162,12 @@ export interface Equipment { SecuredContainer: Record; TacticalVest: Record; } -export interface Items { +export interface IItemPools { Backpack: Record; Pockets: Record; SecuredContainer: Record; SpecialLoot: Record; TacticalVest: Record; } -export type Mods = Record>; +export type IAmmo = Record>; +export type IMods = Record>; diff --git a/types/models/eft/common/tables/ICustomizationItem.d.ts b/types/models/eft/common/tables/ICustomizationItem.d.ts index 3883765..abf82d9 100644 --- a/types/models/eft/common/tables/ICustomizationItem.d.ts +++ b/types/models/eft/common/tables/ICustomizationItem.d.ts @@ -4,10 +4,10 @@ export interface ICustomizationItem { _name: string; _parent: string; _type: string; - _props: Props; + _props: IProps; _proto: string; } -export interface Props { +export interface IProps { Name: string; ShortName: string; Description: string; @@ -17,13 +17,13 @@ export interface Props { Body: string; Hands: string; Feet: string; - Prefab: Prefab; - WatchPrefab: Prefab; + Prefab: IPrefab; + WatchPrefab: IPrefab; IntegratedArmorVest: boolean; WatchPosition: Ixyz; WatchRotation: Ixyz; } -export interface Prefab { +export interface IPrefab { path: string; rcid: string; } diff --git a/types/models/eft/common/tables/IHandbookBase.d.ts b/types/models/eft/common/tables/IHandbookBase.d.ts index 7d7db07..697b782 100644 --- a/types/models/eft/common/tables/IHandbookBase.d.ts +++ b/types/models/eft/common/tables/IHandbookBase.d.ts @@ -1,15 +1,15 @@ export interface IHandbookBase { - Categories: Category[]; - Items: HandbookItem[]; + Categories: IHandbookCategory[]; + Items: IHandbookItem[]; } -export interface Category { +export interface IHandbookCategory { Id: string; ParentId?: string; Icon: string; Color: string; Order: string; } -export interface HandbookItem { +export interface IHandbookItem { Id: string; ParentId: string; Price: number; diff --git a/types/models/eft/common/tables/IItem.d.ts b/types/models/eft/common/tables/IItem.d.ts index 8f60c4f..8139fa1 100644 --- a/types/models/eft/common/tables/IItem.d.ts +++ b/types/models/eft/common/tables/IItem.d.ts @@ -1,99 +1,107 @@ -export interface Item { +export interface IItem { _id: string; _tpl: string; parentId?: string; slotId?: string; - location?: Location | number; - upd?: Upd; + location?: IItemLocation | number; + upd?: IUpd; } -export interface Upd { - Buff?: Buff; +export interface IItemLocation { + x: number; + y: number; + r: string | number; + isSearched?: boolean; + /** SPT property? */ + rotation?: string | boolean; +} +export interface IUpd { + Buff?: IUpdBuff; OriginalStackObjectsCount?: number; - Togglable?: Togglable; - Map?: Map; - Tag?: Tag; + Togglable?: IUpdTogglable; + Map?: IUpdMap; + Tag?: IUpdTag; /** SPT specific property, not made by BSG */ sptPresetId?: string; - FaceShield?: FaceShield; + FaceShield?: IUpdFaceShield; StackObjectsCount?: number; UnlimitedCount?: boolean; - Repairable?: Repairable; - RecodableComponent?: RecodableComponent; - FireMode?: FireMode; + Repairable?: IUpdRepairable; + RecodableComponent?: IUpdRecodableComponent; + FireMode?: IUpdFireMode; SpawnedInSession?: boolean; - Light?: Light; - Key?: Key; - Resource?: Resource; - Sight?: Sight; - MedKit?: MedKit; - FoodDrink?: FoodDrink; - Dogtag?: Dogtag; + Light?: IUpdLight; + Key?: IUpdKey; + Resource?: IUpdResource; + Sight?: IUpdSight; + MedKit?: IUpdMedKit; + FoodDrink?: IUpdFoodDrink; + Dogtag?: IUpdDogtag; BuyRestrictionMax?: number; BuyRestrictionCurrent?: number; - Foldable?: Foldable; - SideEffect?: SideEffect; - RepairKit?: RepairKit; - CultistAmulet?: ICultistAmulet; + Foldable?: IUpdFoldable; + SideEffect?: IUpdSideEffect; + RepairKit?: IUpdRepairKit; + CultistAmulet?: IUpdCultistAmulet; } -export interface Buff { +export interface IUpdBuff { rarity: string; buffType: string; value: number; thresholdDurability?: number; } -export interface Togglable { +export interface IUpdTogglable { On: boolean; } -export interface Map { - Markers: MapMarker[]; +export interface IUpdMap { + Markers: IMapMarker[]; } -export interface MapMarker { +export interface IMapMarker { X: number; Y: number; } -export interface Tag { +export interface IUpdTag { Color: number; Name: string; } -export interface FaceShield { +export interface IUpdFaceShield { Hits: number; } -export interface Repairable { +export interface IUpdRepairable { Durability: number; MaxDurability: number; } -export interface RecodableComponent { +export interface IUpdRecodableComponent { IsEncoded: boolean; } -export interface MedKit { +export interface IUpdMedKit { HpResource: number; } -export interface Sight { +export interface IUpdSight { ScopesCurrentCalibPointIndexes: number[]; ScopesSelectedModes: number[]; SelectedScope: number; } -export interface Foldable { +export interface IUpdFoldable { Folded: boolean; } -export interface FireMode { +export interface IUpdFireMode { FireMode: string; } -export interface FoodDrink { +export interface IUpdFoodDrink { HpPercent: number; } -export interface Key { +export interface IUpdKey { NumberOfUsages: number; } -export interface Resource { +export interface IUpdResource { Value: number; UnitsConsumed: number; } -export interface Light { +export interface IUpdLight { IsActive: boolean; SelectedMode: number; } -export interface Dogtag { +export interface IUpdDogtag { AccountId: string; ProfileId: string; Nickname: string; @@ -106,20 +114,12 @@ export interface Dogtag { KillerName: string; WeaponName: string; } -export interface Location { - x: number; - y: number; - r: string | number; - isSearched?: boolean; - /** SPT property? */ - rotation?: string | boolean; -} -export interface SideEffect { +export interface IUpdSideEffect { Value: number; } -export interface RepairKit { +export interface IUpdRepairKit { Resource: number; } -export interface ICultistAmulet { +export interface IUpdCultistAmulet { NumberOfUsages: number; } diff --git a/types/models/eft/common/tables/ILocationServices.d.ts b/types/models/eft/common/tables/ILocationServices.d.ts new file mode 100644 index 0000000..399ae7b --- /dev/null +++ b/types/models/eft/common/tables/ILocationServices.d.ts @@ -0,0 +1,71 @@ +import { Ixyz } from "@spt/models/eft/common/Ixyz"; +export interface ILocationServices { + TraderServerSettings: ITraderServerSettings; + BTRServerSettings: IBtrServerSettings; +} +export interface ITraderServerSettings { + TraderServices: ITraderServices; +} +export interface ITraderServices { + ExUsecLoyalty: ITraderService; + ZryachiyAid: ITraderService; + CultistsAid: ITraderService; + PlayerTaxi: ITraderService; + BtrItemsDelivery: ITraderService; + BtrBotCover: ITraderService; + TransitItemsDelivery: ITraderService; +} +export interface ITraderService { + TraderId: string; + TraderServiceType: string; + Requirements: IServiceRequirements; + ServiceItemCost: Record; + UniqueItems: string[]; +} +export interface IServiceRequirements { + CompletedQuests: ICompletedQuest[]; + Standings: Record; +} +export interface ICompletedQuest { + QuestId: string; +} +export interface IStandingRequirement { + Value: number; +} +export interface IServiceItemCostDetails { + Count: number; +} +export interface IBtrServerSettings { + ChanceSpawn: number; + SpawnPeriod: Ixyz; + MoveSpeed: number; + ReadyToDepartureTime: number; + CheckTurnDistanceTime: number; + TurnCheckSensitivity: number; + DecreaseSpeedOnTurnLimit: number; + EndSplineDecelerationDistance: number; + AccelerationSpeed: number; + DecelerationSpeed: number; + PauseDurationRange: Ixyz; + BodySwingReturnSpeed: number; + BodySwingDamping: number; + BodySwingIntensity: number; + ServerMapBTRSettings: Record; +} +export interface IServerMapBtrsettings { + MapID: string; + ChanceSpawn: number; + SpawnPeriod: Ixyz; + MoveSpeed: number; + ReadyToDepartureTime: number; + CheckTurnDistanceTime: number; + TurnCheckSensitivity: number; + DecreaseSpeedOnTurnLimit: number; + EndSplineDecelerationDistance: number; + AccelerationSpeed: number; + DecelerationSpeed: number; + PauseDurationRange: Ixyz; + BodySwingReturnSpeed: number; + BodySwingDamping: number; + BodySwingIntensity: number; +} diff --git a/types/models/eft/common/tables/ILocationsBase.d.ts b/types/models/eft/common/tables/ILocationsBase.d.ts index 2c96af3..e773096 100644 --- a/types/models/eft/common/tables/ILocationsBase.d.ts +++ b/types/models/eft/common/tables/ILocationsBase.d.ts @@ -1,10 +1,9 @@ export interface ILocationsBase { - locations: Locations; - paths: Path[]; + locations: ILocations; + paths: IPath[]; } -export interface Locations { -} -export interface Path { +export type ILocations = {}; +export interface IPath { Source: string; Destination: string; } diff --git a/types/models/eft/common/tables/IMatch.d.ts b/types/models/eft/common/tables/IMatch.d.ts index 042f5bb..5d18f57 100644 --- a/types/models/eft/common/tables/IMatch.d.ts +++ b/types/models/eft/common/tables/IMatch.d.ts @@ -1,7 +1,7 @@ export interface IMatch { - metrics: Metrics; + metrics: IMetrics; } -export interface Metrics { +export interface IMetrics { Keys: number[]; NetProcessingBins: number[]; RenderBins: number[]; diff --git a/types/models/eft/common/tables/IProfileTemplate.d.ts b/types/models/eft/common/tables/IProfileTemplate.d.ts index 20923bc..0eb800a 100644 --- a/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,12 +1,12 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Dialogue, IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; export interface IProfileTemplates { - "Standard": IProfileSides; + Standard: IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; - "Unheard": IProfileSides; - "Tournament": IProfileSides; + Unheard: IProfileSides; + Tournament: IProfileSides; "SPT Developer": IProfileSides; "SPT Easy start": IProfileSides; "SPT Zero to hero": IProfileSides; @@ -19,11 +19,11 @@ export interface IProfileSides { export interface ITemplateSide { character: IPmcData; suits: string[]; - dialogues: Record; + dialogues: Record; userbuilds: IUserBuilds; - trader: ProfileTraderTemplate; + trader: IProfileTraderTemplate; } -export interface ProfileTraderTemplate { +export interface IProfileTraderTemplate { initialLoyaltyLevel: Record; initialStanding: Record; setQuestsAvailableForStart?: boolean; diff --git a/types/models/eft/common/tables/IQuest.d.ts b/types/models/eft/common/tables/IQuest.d.ts index 54ff191..e956856 100644 --- a/types/models/eft/common/tables/IQuest.d.ts +++ b/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { QuestRewardType } from "@spt/models/enums/QuestRewardType"; import { QuestStatus } from "@spt/models/enums/QuestStatus"; import { QuestTypeEnum } from "@spt/models/enums/QuestTypeEnum"; @@ -17,21 +17,19 @@ export interface IQuest { image: string; type: QuestTypeEnum; isKey: boolean; - /** @deprecated - Likely not used, use 'status' instead */ - questStatus: QuestStatus; restartable: boolean; instantComplete: boolean; secretQuest: boolean; startedMessageText: string; successMessageText: string; - acceptPlayerMessage: string; + acceptPlayerMessage?: string; declinePlayerMessage: string; - completePlayerMessage: string; - templateId: string; + completePlayerMessage?: string; + templateId?: string; rewards: IQuestRewards; /** Becomes 'AppearStatus' inside client */ - status: string | number; - KeyQuest: boolean; + status?: string | number; + KeyQuest?: boolean; changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; @@ -39,10 +37,10 @@ export interface IQuest { sptStatus?: QuestStatus; } export interface IQuestConditionTypes { - Started: IQuestCondition[]; + Started?: IQuestCondition[]; AvailableForFinish: IQuestCondition[]; AvailableForStart: IQuestCondition[]; - Success: IQuestCondition[]; + Success?: IQuestCondition[]; Fail: IQuestCondition[]; } export interface IQuestCondition { @@ -50,21 +48,24 @@ export interface IQuestCondition { index?: number; compareMethod?: string; dynamicLocale: boolean; - visibilityConditions?: VisibilityCondition[]; + visibilityConditions?: IVisibilityCondition[]; globalQuestCounterId?: string; parentId?: string; - target: string[] | string; + target?: string[] | string; value?: string | number; - type?: boolean; + type?: boolean | string; status?: QuestStatus[]; availableAfter?: number; dispersion?: number; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; + isResetOnConditionFailed?: boolean; + isNecessary?: boolean; doNotResetIfCounterCompleted?: boolean; - dogtagLevel?: number; - maxDurability?: number; - minDurability?: number; + dogtagLevel?: number | string; + traderId?: string; + maxDurability?: number | string; + minDurability?: number | string; counter?: IQuestConditionCounter; plantTime?: number; zoneId?: string; @@ -79,7 +80,7 @@ export interface IQuestConditionCounter { } export interface IQuestConditionCounterCondition { id: string; - dynamicLocale: boolean; + dynamicLocale?: boolean; target?: string[] | string; completeInSeconds?: number; energy?: IValueCompare; @@ -87,7 +88,7 @@ export interface IQuestConditionCounterCondition { hydration?: IValueCompare; time?: IValueCompare; compareMethod?: string; - value?: number; + value?: number | string; weapon?: string[]; distance?: ICounterConditionDistance; equipmentInclusive?: string[][]; @@ -120,12 +121,12 @@ export interface IDaytimeCounter { from: number; to: number; } -export interface VisibilityCondition { +export interface IVisibilityCondition { id: string; target: string; value?: number; dynamicLocale?: boolean; - oneSessionOnly: boolean; + oneSessionOnly?: boolean; conditionType: string; } export interface IQuestRewards { @@ -143,10 +144,14 @@ export interface IQuestReward { type: QuestRewardType; index: number; target?: string; - items?: Item[]; + items?: IItem[]; loyaltyLevel?: number; /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; + /** Game editions whitelisted to get reward */ + availableInGameEditions?: string[]; + /** Game editions blacklisted from getting reward */ + notAvailableInGameEditions?: string[]; } diff --git a/types/models/eft/common/tables/IRepeatableQuests.d.ts b/types/models/eft/common/tables/IRepeatableQuests.d.ts index 0753cff..37e582a 100644 --- a/types/models/eft/common/tables/IRepeatableQuests.d.ts +++ b/types/models/eft/common/tables/IRepeatableQuests.d.ts @@ -41,14 +41,14 @@ export interface IOptions { Completion: ICompletionFilter; } export interface ICompletionFilter { - itemsBlacklist: ItemsBlacklist[]; - itemsWhitelist: ItemsWhitelist[]; + itemsBlacklist: IItemsBlacklist[]; + itemsWhitelist: IItemsWhitelist[]; } -export interface ItemsBlacklist { +export interface IItemsBlacklist { minPlayerLevel: number; itemIds: string[]; } -export interface ItemsWhitelist { +export interface IItemsWhitelist { minPlayerLevel: number; itemIds: string[]; } diff --git a/types/models/eft/common/tables/ITemplateItem.d.ts b/types/models/eft/common/tables/ITemplateItem.d.ts index c5b2da3..41b4d1d 100644 --- a/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/types/models/eft/common/tables/ITemplateItem.d.ts @@ -4,11 +4,11 @@ export interface ITemplateItem { _name: string; _parent: string; _type: ItemType; - _props: Props; + _props: IProps; _proto?: string; } -export interface Props { - AllowSpawnOnLocations?: any[]; +export interface IProps { + AllowSpawnOnLocations?: string[]; BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; @@ -25,8 +25,9 @@ export interface Props { SpawnChance?: number; CreditsPrice?: number; ItemSound?: string; - Prefab?: Prefab; - UsePrefab?: Prefab; + Prefab?: IPrefab; + UsePrefab?: IPrefab; + airDropTemplateId?: string; StackObjectsCount?: number; NotShownInSlot?: boolean; ExaminedByDefault?: boolean; @@ -51,6 +52,7 @@ export interface Props { ExtraSizeLeft?: number; ExtraSizeRight?: number; ExtraSizeUp?: number; + FlareTypes?: string[]; ExtraSizeDown?: number; ExtraSizeForceAdd?: boolean; MergesWithChildren?: boolean; @@ -70,8 +72,8 @@ export interface Props { MaxResource?: number; Resource?: number; DogTagQualities?: boolean; - Grids?: Grid[]; - Slots?: Slot[]; + Grids?: IGrid[]; + Slots?: ISlot[]; CanPutIntoDuringTheRaid?: boolean; CantRemoveFromSlotsDuringRaid?: string[]; KeyIds?: string[]; @@ -93,13 +95,16 @@ export interface Props { IsAnimated?: boolean; HasShoulderContact?: boolean; SightingRange?: number; + ZoomSensitivity?: number; DoubleActionAccuracyPenaltyMult?: number; - ModesCount?: any; + ModesCount?: number | number[]; DurabilityBurnModificator?: number; HeatFactor?: number; CoolFactor?: number; muzzleModType?: string; CustomAimPlane?: string; + IsAdjustableOptic?: boolean; + MinMaxFov?: Ixyz; sightModType?: string; aimingSensitivity?: number; SightModesCount?: number; @@ -135,7 +140,7 @@ export interface Props { PixelationBlockCount?: number; ShiftsAimCamera?: number; magAnimationIndex?: number; - Cartridges?: Slot[]; + Cartridges?: ISlot[]; CanFast?: boolean; CanHit?: boolean; CanAdmin?: boolean; @@ -170,7 +175,7 @@ export interface Props { spawnRarity?: string; minCountSpawn?: number; maxCountSpawn?: number; - openedByKeyID?: any[]; + openedByKeyID?: string[]; RigLayoutName?: string; MaxDurability?: number; armorZone?: string[]; @@ -213,7 +218,7 @@ export interface Props { defAmmo?: string; AdjustCollimatorsToTrajectory?: boolean; shotgunDispersion?: number; - Chambers?: Slot[]; + Chambers?: ISlot[]; CameraSnap?: number; CameraToWeaponAngleSpeedRange?: Ixyz; CameraToWeaponAngleStep?: number; @@ -226,6 +231,8 @@ export interface Props { RotationCenterNoStock?: Ixyz; ShotsGroupSettings?: IShotsGroupSettings[]; FoldedSlot?: string; + ForbidMissingVitalParts?: boolean; + ForbidNonEmptyContainers?: boolean; CompactHandling?: boolean; MinRepairDegradation?: number; MaxRepairDegradation?: number; @@ -263,6 +270,13 @@ export interface Props { RecoilStableIndexShot?: number; MinRepairKitDegradation?: number; MaxRepairKitDegradation?: number; + MountCameraSnapMultiplier?: number; + MountHorizontalRecoilMultiplier?: number; + MountReturnSpeedHandMultiplier?: number; + MountVerticalRecoilMultiplier?: number; + MountingHorizontalOutOfBreathMultiplier?: number; + MountingPosition?: Ixyz; + MountingVerticalOutOfBreathMultiplier?: Ixyz; BlocksEarpiece?: boolean; BlocksEyewear?: boolean; BlocksHeadwear?: boolean; @@ -379,6 +393,7 @@ export interface Props { ShowHitEffectOnExplode?: boolean; ExplosionType?: string; AmmoLifeTimeSec?: number; + AmmoTooltipClass?: string; Contusion?: Ixyz; ArmorDistanceDistanceDamage?: Ixyz; Blindness?: Ixyz; @@ -388,7 +403,7 @@ export interface Props { LightAndSoundShotSelfContusionStrength?: number; MalfMisfireChance?: number; MalfFeedChance?: number; - StackSlots?: StackSlot[]; + StackSlots?: IStackSlot[]; type?: string; eqMin?: number; eqMax?: number; @@ -401,6 +416,7 @@ export interface Props { explDelay?: number; EmitTime?: number; CanBeHiddenDuringThrow?: boolean; + CanPlantOnGround?: boolean; MinTimeToContactExplode?: number; ExplosionEffectType?: string; LinkedWeapon?: string; @@ -413,7 +429,7 @@ export interface Props { RepairStrategyTypes?: string[]; IsEncoded?: boolean; LayoutName?: string; - Lower75Prefab?: Prefab; + Lower75Prefab?: IPrefab; MaxUsages?: number; ScavKillExpPenalty?: number; ScavKillExpPenaltyPVE?: number; @@ -426,19 +442,19 @@ export interface IHealthEffect { type: string; value: number; } -export interface Prefab { +export interface IPrefab { path: string; rcid: string; } -export interface Grid { +export interface IGrid { _name: string; _id: string; _parent: string; - _props: GridProps; + _props: IGridProps; _proto: string; } -export interface GridProps { - filters: GridFilter[]; +export interface IGridProps { + filters: IGridFilter[]; cellsH: number; cellsV: number; minCount: number; @@ -446,25 +462,26 @@ export interface GridProps { maxWeight: number; isSortingTable: boolean; } -export interface GridFilter { +export interface IGridFilter { Filter: string[]; ExcludedFilter: string[]; + locked?: boolean; } -export interface Slot { +export interface ISlot { _name: string; _id: string; _parent: string; - _props: SlotProps; + _props: ISlotProps; _max_count?: number; _required?: boolean; _mergeSlotWithChildren?: boolean; _proto: string; } -export interface SlotProps { - filters: SlotFilter[]; +export interface ISlotProps { + filters: ISlotFilter[]; MaxStackCount?: number; } -export interface SlotFilter { +export interface ISlotFilter { Shift?: number; locked?: boolean; Plate?: string; @@ -473,17 +490,17 @@ export interface SlotFilter { Filter: string[]; AnimationIndex?: number; } -export interface StackSlot { +export interface IStackSlot { _name?: string; _id: string; _parent: string; _max_count: number; - _props: StackSlotProps; + _props: IStackSlotProps; _proto: string; upd?: any; } -export interface StackSlotProps { - filters: SlotFilter[]; +export interface IStackSlotProps { + filters: ISlotFilter[]; } export interface IRandomLootSettings { allowToSpawnIdenticalItems: boolean; @@ -500,14 +517,14 @@ export interface IRandomLootExcluded { rarity: string[]; templates: any[]; } -export interface EffectsHealth { - Energy: EffectsHealthProps; - Hydration: EffectsHealthProps; +export interface IEffectsHealth { + Energy: IEffectsHealthProps; + Hydration: IEffectsHealthProps; } -export interface EffectsHealthProps { +export interface IEffectsHealthProps { value: number; } -export interface EffectsDamage { +export interface IEffectsDamage { Pain: IEffectDamageProps; LightBleeding: IEffectDamageProps; HeavyBleeding: IEffectDamageProps; diff --git a/types/models/eft/common/tables/ITrader.d.ts b/types/models/eft/common/tables/ITrader.d.ts index 14ab409..9e161c8 100644 --- a/types/models/eft/common/tables/ITrader.d.ts +++ b/types/models/eft/common/tables/ITrader.d.ts @@ -1,4 +1,5 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { DogtagExchangeSide } from "@spt/models/enums/DogtagExchangeSide"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; export interface ITrader { assort?: ITraderAssort; @@ -22,16 +23,20 @@ export interface ITraderBase { discount: number; discount_end: number; gridHeight: number; - insurance: Insurance; + sell_modifier_for_prohibited_items?: number; + insurance: ITraderInsurance; items_buy: IItemBuyData; items_buy_prohibited: IItemBuyData; + isCanTransferItems?: boolean; + transferableItems?: IItemBuyData; + prohibitedTransferableItems?: IItemBuyData; location: string; - loyaltyLevels: LoyaltyLevel[]; + loyaltyLevels: ITraderLoyaltyLevel[]; medic: boolean; name: string; nextResupply: number; nickname: string; - repair: Repair; + repair: ITraderRepair; sell_category: string[]; surname: string; unlockedByDefault: boolean; @@ -40,7 +45,7 @@ export interface IItemBuyData { category: string[]; id_list: string[]; } -export interface Insurance { +export interface ITraderInsurance { availability: boolean; excluded_category: string[]; max_return_hour: number; @@ -48,7 +53,7 @@ export interface Insurance { min_payment: number; min_return_hour: number; } -export interface LoyaltyLevel { +export interface ITraderLoyaltyLevel { buy_price_coef: number; exchange_price_coef: number; heal_price_coef: number; @@ -58,18 +63,18 @@ export interface LoyaltyLevel { minStanding: number; repair_price_coef: number; } -export interface Repair { +export interface ITraderRepair { availability: boolean; currency: string; currency_coefficient: number; excluded_category: string[]; /** Doesn't exist in client object */ - excluded_id_list: any[]; + excluded_id_list: string[]; quality: number; } export interface ITraderAssort { nextResupply: number; - items: Item[]; + items: IItem[]; barter_scheme: Record; loyal_level_items: Record; } @@ -78,6 +83,8 @@ export interface IBarterScheme { _tpl: string; onlyFunctional?: boolean; sptQuestLocked?: boolean; + level?: number; + side?: DogtagExchangeSide; } export interface ISuit { _id: string; diff --git a/types/models/eft/customization/IBuyClothingRequestData.d.ts b/types/models/eft/customization/IBuyClothingRequestData.d.ts index d19b70d..3fea512 100644 --- a/types/models/eft/customization/IBuyClothingRequestData.d.ts +++ b/types/models/eft/customization/IBuyClothingRequestData.d.ts @@ -1,9 +1,9 @@ export interface IBuyClothingRequestData { Action: "CustomizationBuy"; offer: string; - items: ClothingItem[]; + items: IPaymentItemForClothing[]; } -export interface ClothingItem { +export interface IPaymentItemForClothing { del: boolean; id: string; count: number; diff --git a/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts b/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts index 9bcfead..845d92c 100644 --- a/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts +++ b/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts @@ -1,6 +1,6 @@ -import { Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage } from "@spt/models/eft/profile/ISptProfile"; export interface IGetAllAttachmentsResponse { - messages: Message[]; + messages: IMessage[]; profiles: any[]; hasMessagesWithRewards: boolean; } diff --git a/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts b/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts index ba28910..0eaacf8 100644 --- a/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts +++ b/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts @@ -1,6 +1,6 @@ -import { IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; export interface IGetMailDialogViewResponseData { - messages: Message[]; + messages: IMessage[]; profiles: IUserDialogInfo[]; hasMessagesWithRewards: boolean; } diff --git a/types/models/eft/game/IGameConfigResponse.d.ts b/types/models/eft/game/IGameConfigResponse.d.ts index 2bff352..c44867e 100644 --- a/types/models/eft/game/IGameConfigResponse.d.ts +++ b/types/models/eft/game/IGameConfigResponse.d.ts @@ -5,7 +5,7 @@ export interface IGameConfigResponse { ndaFree: boolean; taxonomy: number; activeProfileId: string; - backend: Backend; + backend: IBackend; useProtobuf: boolean; utc_time: number; /** Total in game time */ @@ -13,7 +13,7 @@ export interface IGameConfigResponse { reportAvailable: boolean; twitchEventMember: boolean; } -export interface Backend { +export interface IBackend { Lobby: string; Trading: string; Messaging: string; diff --git a/types/models/eft/game/IVersionValidateRequestData.d.ts b/types/models/eft/game/IVersionValidateRequestData.d.ts index 0aa0fed..18213d9 100644 --- a/types/models/eft/game/IVersionValidateRequestData.d.ts +++ b/types/models/eft/game/IVersionValidateRequestData.d.ts @@ -1,8 +1,8 @@ export interface IVersionValidateRequestData { - version: Version; + version: IVersion; develop: boolean; } -export interface Version { +export interface IVersion { major: string; minor: string; game: string; diff --git a/types/models/eft/health/IHealthTreatmentRequestData.d.ts b/types/models/eft/health/IHealthTreatmentRequestData.d.ts index 598e60c..e544bf9 100644 --- a/types/models/eft/health/IHealthTreatmentRequestData.d.ts +++ b/types/models/eft/health/IHealthTreatmentRequestData.d.ts @@ -1,31 +1,31 @@ export interface IHealthTreatmentRequestData { Action: "RestoreHealth"; trader: string; - items: Cost[]; - difference: Difference; + items: IItemCost[]; + difference: IDifference; timestamp: number; } -export interface Cost { +export interface IItemCost { /** Id of stack to take money from */ id: string; /** Amount of money to take off player for treatment */ count: number; } -export interface Difference { - BodyParts: BodyParts; +export interface IDifference { + BodyParts: IBodyParts; Energy: number; Hydration: number; } -export interface BodyParts { - Head: BodyPart; - Chest: BodyPart; - Stomach: BodyPart; - LeftArm: BodyPart; - RightArm: BodyPart; - LeftLeg: BodyPart; - RightLeg: BodyPart; +export interface IBodyParts { + Head: IBodyPart; + Chest: IBodyPart; + Stomach: IBodyPart; + LeftArm: IBodyPart; + RightArm: IBodyPart; + LeftLeg: IBodyPart; + RightLeg: IBodyPart; } -export interface BodyPart { +export interface IBodyPart { Health: number; /** Effects in array are to be removed */ Effects: string[]; diff --git a/types/models/eft/health/ISyncHealthRequestData.d.ts b/types/models/eft/health/ISyncHealthRequestData.d.ts index 20e32f6..7c7d05c 100644 --- a/types/models/eft/health/ISyncHealthRequestData.d.ts +++ b/types/models/eft/health/ISyncHealthRequestData.d.ts @@ -1,20 +1,20 @@ export interface ISyncHealthRequestData { - Health: Health; + Health: IBodyPartCollection; IsAlive: boolean; Hydration?: number; Energy?: number; Temperature?: number; } -export interface Health { - Head?: BodyPartHealth; - Chest?: BodyPartHealth; - Stomach?: BodyPartHealth; - LeftArm?: BodyPartHealth; - RightArm?: BodyPartHealth; - LeftLeg?: BodyPartHealth; - RightLeg?: BodyPartHealth; +export interface IBodyPartCollection { + Head?: IBodyPartHealth; + Chest?: IBodyPartHealth; + Stomach?: IBodyPartHealth; + LeftArm?: IBodyPartHealth; + RightArm?: IBodyPartHealth; + LeftLeg?: IBodyPartHealth; + RightLeg?: IBodyPartHealth; } -export interface BodyPartHealth { +export interface IBodyPartHealth { Maximum: number; Current: number; Effects: Record; diff --git a/types/models/eft/health/IWorkoutData.d.ts b/types/models/eft/health/IWorkoutData.d.ts index ba629d2..d958b74 100644 --- a/types/models/eft/health/IWorkoutData.d.ts +++ b/types/models/eft/health/IWorkoutData.d.ts @@ -1,4 +1,36 @@ export interface IWorkoutData extends Record { - skills: any; - effects: any; + skills: IWorkoutSkills; + effects: IWorkoutEffects; +} +export interface IWorkoutSkills { + Common: IWorkoutSkillCommon[]; + Mastering: any[]; + Bonuses: any; + Points: number; +} +export interface IWorkoutSkillCommon { + Id: string; + Progress: number; + PointsEarnedDuringSession: number; + LastAccess: number; +} +export interface IWorkoutEffects { + Effects: IWorkoutEffectsParts; + Hydration: number; + Energy: number; +} +export interface IWorkoutEffectsParts { + Head: IWorkoutBodyPart; + Chest: IWorkoutBodyPart; + Stomach: IWorkoutBodyPart; + LeftArm: IWorkoutBodyPart; + RightArm: IWorkoutBodyPart; + LeftLeg: IWorkoutBodyPart; + RightLeg: IWorkoutBodyPart; + Common: IWorkoutBodyPart; +} +export interface IWorkoutBodyPart { + Regeneration: number; + Fracture: number; + MildMusclePain: number; } diff --git a/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts b/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts deleted file mode 100644 index 8583e8d..0000000 --- a/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface HideoutUpgradeCompleteRequestData { - Action: string; - areaType: number; - timestamp: number; -} diff --git a/types/models/eft/hideout/IHideoutArea.d.ts b/types/models/eft/hideout/IHideoutArea.d.ts index ca0eb07..ce4d779 100644 --- a/types/models/eft/hideout/IHideoutArea.d.ts +++ b/types/models/eft/hideout/IHideoutArea.d.ts @@ -1,3 +1,4 @@ +import { IRequirementBase } from "@spt/models/eft/hideout/IHideoutProduction"; import { BonusSkillType } from "@spt/models/enums/BonusSkillType"; import { BonusType } from "@spt/models/enums/BonusType"; export interface IHideoutArea { @@ -11,16 +12,16 @@ export interface IHideoutArea { displayLevel: boolean; enableAreaRequirements: boolean; parentArea?: string; - stages: Record; + stages: Record; } export interface IAreaRequirement { areaType: number; requiredlevel: number; type: string; } -export interface Stage { +export interface IStage { autoUpgrade: boolean; - bonuses: StageBonus[]; + bonuses: IStageBonus[]; constructionTime: number; /** Containers inventory tpl */ container?: string; @@ -50,20 +51,19 @@ export interface IStageImprovementRequirement { templateId: string; type: string; } -export interface IStageRequirement { +export interface IStageRequirement extends IRequirementBase { areaType?: number; requiredLevel?: number; - type: string; templateId?: string; count?: number; - isEncoded: false; + isEncoded?: false; isFunctional?: boolean; traderId?: string; loyaltyLevel?: number; skillName?: string; skillLevel?: number; } -export interface StageBonus { +export interface IStageBonus { value: number; passive: boolean; production: boolean; diff --git a/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts b/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts new file mode 100644 index 0000000..6f7c9b7 --- /dev/null +++ b/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts @@ -0,0 +1,4 @@ +export interface IHideoutCircleOfCultistProductionStartRequestData { + Action: "HideoutCircleOfCultistProductionStart"; + timestamp: number; +} diff --git a/types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts b/types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts new file mode 100644 index 0000000..97714de --- /dev/null +++ b/types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts @@ -0,0 +1,5 @@ +export interface IHideoutDeleteProductionRequestData { + Action: "HideoutDeleteProductionCommand"; + recipeId: string; + timestamp: number; +} diff --git a/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts b/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts index 7e927bf..f963c13 100644 --- a/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts @@ -3,10 +3,10 @@ export interface IHideoutImproveAreaRequestData { /** Hideout area id from areas.json */ id: string; areaType: number; - items: HideoutItem[]; + items: IHideoutItem[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { /** Hideout inventory id that was used by improvement action */ id: string; count: number; diff --git a/types/models/eft/hideout/IHideoutProduction.d.ts b/types/models/eft/hideout/IHideoutProduction.d.ts index 7373a4f..1926311 100644 --- a/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/types/models/eft/hideout/IHideoutProduction.d.ts @@ -1,7 +1,13 @@ +import { MinMax } from "@spt/models/common/MinMax"; +export interface IHideoutProductionData { + recipes: IHideoutProduction[]; + scavRecipes: IScavRecipe[]; + cultistRecipes: ICultistRecipe[]; +} export interface IHideoutProduction { _id: string; areaType: number; - requirements: Requirement[]; + requirements: IRequirement[]; productionTime: number; /** Tpl of item being crafted */ endProduct: string; @@ -12,14 +18,30 @@ export interface IHideoutProduction { count: number; productionLimitCount: number; } -export interface Requirement { +export interface IRequirement extends IRequirementBase { templateId?: string; count?: number; isEncoded?: boolean; isFunctional?: boolean; - type: string; areaType?: number; requiredLevel?: number; resource?: number; questId?: string; } +export interface IRequirementBase { + type: string; +} +export type IScavRecipe = { + _id: string; + requirements: IRequirement[]; + productionTime: number; + endProducts: IEndProducts; +}; +export interface IEndProducts { + Common: MinMax; + Rare: MinMax; + Superrare: MinMax; +} +export type ICultistRecipe = { + _id: string; +}; diff --git a/types/models/eft/hideout/IHideoutScavCase.d.ts b/types/models/eft/hideout/IHideoutScavCase.d.ts index d081d42..b420d2d 100644 --- a/types/models/eft/hideout/IHideoutScavCase.d.ts +++ b/types/models/eft/hideout/IHideoutScavCase.d.ts @@ -2,16 +2,16 @@ import { MinMax } from "@spt/models/common/MinMax"; export interface IHideoutScavCase { _id: string; ProductionTime: number; - Requirements: Requirement[]; - EndProducts: EndProducts; + Requirements: IRequirement[]; + EndProducts: IEndProducts; } -export interface Requirement { +export interface IRequirement { templateId: string; count: number; isFunctional: boolean; type: string; } -export interface EndProducts { +export interface IEndProducts { Common: MinMax; Rare: MinMax; Superrare: MinMax; diff --git a/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts b/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts index 72fda86..198d778 100644 --- a/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts @@ -1,15 +1,15 @@ export interface IHideoutScavCaseStartRequestData { Action: "HideoutScavCaseProductionStart"; recipeId: string; - items: HideoutItem[]; - tools: Tool[]; + items: IHideoutItem[]; + tools: ITool[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { id: string; count: number; } -export interface Tool { +export interface ITool { id: string; count: number; } diff --git a/types/models/eft/hideout/IHideoutSettingsBase.d.ts b/types/models/eft/hideout/IHideoutSettingsBase.d.ts index 8e45939..513d3c7 100644 --- a/types/models/eft/hideout/IHideoutSettingsBase.d.ts +++ b/types/models/eft/hideout/IHideoutSettingsBase.d.ts @@ -2,5 +2,6 @@ export interface IHideoutSettingsBase { generatorSpeedWithoutFuel: number; generatorFuelFlowRate: number; airFilterUnitFlowRate: number; + cultistAmuletBonusPercent: number; gpuBoostRate: number; } diff --git a/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts b/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts index dfb92e2..1c97b22 100644 --- a/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts @@ -1,11 +1,11 @@ export interface IHideoutSingleProductionStartRequestData { Action: "HideoutSingleProductionStart"; recipeId: string; - items: Item[]; - tools: Item[]; + items: IHandoverItem[]; + tools: IHandoverItem[]; timestamp: number; } -export interface Item { +export interface IHandoverItem { id: string; count: number; } diff --git a/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts b/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts index dfbfdca..59b6141 100644 --- a/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts @@ -1,10 +1,10 @@ export interface IHideoutUpgradeRequestData { Action: "HideoutUpgrade"; areaType: number; - items: HideoutItem[]; + items: IHideoutItem[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { count: number; id: string; } diff --git a/types/models/eft/hideout/IQteData.d.ts b/types/models/eft/hideout/IQteData.d.ts index 7f507e1..fe6cce6 100644 --- a/types/models/eft/hideout/IQteData.d.ts +++ b/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt/models/eft/health/Effect"; import { BodyPart } from "@spt/models/eft/health/IOffraidHealRequestData"; +import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt/models/enums/SkillTypes"; +import { Traders } from "@spt/models/enums/Traders"; import { QteActivityType } from "@spt/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt/models/enums/hideout/QteRewardType"; import { QteType } from "@spt/models/enums/hideout/QteType"; import { RequirementType } from "@spt/models/enums/hideout/RequirementType"; -import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt/models/enums/SkillTypes"; -import { Traders } from "@spt/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts b/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts index a27bfbb..7e0fe98 100644 --- a/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts +++ b/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts @@ -1,5 +1,5 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IItemDeliveryRequestData { - items: Item[]; + items: IItem[]; traderId: string; } diff --git a/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/types/models/eft/inRaid/ISaveProgressRequestData.d.ts deleted file mode 100644 index b654088..0000000 --- a/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; -import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; -import { IInsuredItemsData } from "@spt/models/eft/inRaid/IInsuredItemsData"; -import { PlayerRaidEndState } from "@spt/models/enums/PlayerRaidEndState"; -export interface ISaveProgressRequestData { - exit: PlayerRaidEndState; - profile: IPostRaidPmcData; - isPlayerScav: boolean; - health: ISyncHealthRequestData; - insurance: IInsuredItemsData[]; -} diff --git a/types/models/eft/inRaid/IScavSaveRequestData.d.ts b/types/models/eft/inRaid/IScavSaveRequestData.d.ts new file mode 100644 index 0000000..e96a9ed --- /dev/null +++ b/types/models/eft/inRaid/IScavSaveRequestData.d.ts @@ -0,0 +1,4 @@ +import { IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; +export interface IScavSaveRequestData { + profile: IPostRaidPmcData; +} diff --git a/types/models/eft/inventory/IAddItemDirectRequest.d.ts b/types/models/eft/inventory/IAddItemDirectRequest.d.ts index 1616901..7f58d00 100644 --- a/types/models/eft/inventory/IAddItemDirectRequest.d.ts +++ b/types/models/eft/inventory/IAddItemDirectRequest.d.ts @@ -1,7 +1,7 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IAddItemDirectRequest { /** Item and child mods to add to player inventory */ - itemWithModsToAdd: Item[]; + itemWithModsToAdd: IItem[]; foundInRaid: boolean; callback: (buyCount: number) => void; useSortingTable: boolean; diff --git a/types/models/eft/inventory/IAddItemRequestData.d.ts b/types/models/eft/inventory/IAddItemRequestData.d.ts index 3fa86dc..70241bc 100644 --- a/types/models/eft/inventory/IAddItemRequestData.d.ts +++ b/types/models/eft/inventory/IAddItemRequestData.d.ts @@ -1,9 +1,9 @@ export interface IAddItemRequestData { /** Trader id */ tid: string; - items: AddItem[]; + items: IItemToAdd[]; } -export interface AddItem { +export interface IItemToAdd { count: number; sptIsPreset?: boolean; item_id: string; diff --git a/types/models/eft/inventory/IAddItemTempObject.d.ts b/types/models/eft/inventory/IAddItemTempObject.d.ts index 7b3a6ea..a822d56 100644 --- a/types/models/eft/inventory/IAddItemTempObject.d.ts +++ b/types/models/eft/inventory/IAddItemTempObject.d.ts @@ -1,8 +1,8 @@ -import { Item, Location } from "@spt/models/eft/common/tables/IItem"; +import { IItem, IItemLocation } from "@spt/models/eft/common/tables/IItem"; export interface IAddItemTempObject { - itemRef: Item; + itemRef: IItem; count: number; isPreset: boolean; - location?: Location; + location?: IItemLocation; containerId?: string; } diff --git a/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index 386359e..a744487 100644 --- a/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -1,7 +1,7 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IAddItemsDirectRequest { /** Item and child mods to add to player inventory */ - itemsWithModsToAdd: Item[][]; + itemsWithModsToAdd: IItem[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ callback?: (buyCount: number) => void; diff --git a/types/models/eft/inventory/IInventoryAddRequestData.d.ts b/types/models/eft/inventory/IInventoryAddRequestData.d.ts index 63c5389..e1ac7ec 100644 --- a/types/models/eft/inventory/IInventoryAddRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryAddRequestData.d.ts @@ -1,6 +1,6 @@ -import { Container, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IContainer, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventoryAddRequestData extends IInventoryBaseActionRequestData { Action: "Add"; item: string; - container: Container; + container: IContainer; } diff --git a/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index cc7269c..64b1a3e 100644 --- a/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -1,25 +1,19 @@ import { IBaseInteractionRequestData } from "@spt/models/eft/common/request/IBaseInteractionRequestData"; +import { IItemLocation } from "@spt/models/eft/common/tables/IItem"; export interface IInventoryBaseActionRequestData extends IBaseInteractionRequestData { } -export interface To { +export interface ITo { id: string; container: string; - location?: ToLocation | number; + location?: IItemLocation | number; isSearched?: boolean; } -export interface ToLocation { - x: number; - y: number; - r: string; - rotation?: string; - isSearched: boolean; -} -export interface Container { +export interface IContainer { id: string; container: string; - location?: Location | number; + location?: ILocation | number; } -export interface Location { +export interface ILocation { x: number; y: number; r: string; diff --git a/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts b/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts index 1469136..11d6ebd 100644 --- a/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts @@ -2,9 +2,9 @@ import { IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInve export interface IInventoryCreateMarkerRequestData extends IInventoryBaseActionRequestData { Action: "CreateMapMarker"; item: string; - mapMarker: MapMarker; + mapMarker: IMapMarker; } -export interface MapMarker { +export interface IMapMarker { Type: string; X: number; Y: number; diff --git a/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts b/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts index 87dcf86..9d7c675 100644 --- a/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts @@ -4,9 +4,9 @@ export interface IInventoryEditMarkerRequestData extends IInventoryBaseActionReq item: string; X: number; Y: number; - mapMarker: MapMarker; + mapMarker: IMapMarker; } -export interface MapMarker { +export interface IMapMarker { Type: string; X: number; Y: number; diff --git a/types/models/eft/inventory/IInventoryMoveRequestData.d.ts b/types/models/eft/inventory/IInventoryMoveRequestData.d.ts index afb6fd0..e5c2a8b 100644 --- a/types/models/eft/inventory/IInventoryMoveRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryMoveRequestData.d.ts @@ -1,6 +1,6 @@ -import { IInventoryBaseActionRequestData, To } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IInventoryBaseActionRequestData, ITo } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventoryMoveRequestData extends IInventoryBaseActionRequestData { Action: "Move"; item: string; - to: To; + to: ITo; } diff --git a/types/models/eft/inventory/IInventorySortRequestData.d.ts b/types/models/eft/inventory/IInventorySortRequestData.d.ts index d784c77..10ee271 100644 --- a/types/models/eft/inventory/IInventorySortRequestData.d.ts +++ b/types/models/eft/inventory/IInventorySortRequestData.d.ts @@ -1,20 +1,6 @@ -import { Upd } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySortRequestData extends IInventoryBaseActionRequestData { Action: "ApplyInventoryChanges"; - changedItems: ChangedItem[]; -} -export interface ChangedItem { - _id: string; - _tpl: string; - parentId: string; - slotId: string; - location: Location; - upd: Upd; -} -export interface Location { - x: number; - y: number; - r: string; - isSearched: boolean; + changedItems: IItem[]; } diff --git a/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/types/models/eft/inventory/IInventorySplitRequestData.d.ts index a4bb8a4..5667f0a 100644 --- a/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,4 +1,4 @@ -import { Container, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IContainer, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; /** Id of item to split */ @@ -6,6 +6,6 @@ export interface IInventorySplitRequestData extends IInventoryBaseActionRequestD /** Id of new item stack */ newItem: string; /** Destination new item will be placed in */ - container: Container; + container: IContainer; count: number; } diff --git a/types/models/eft/inventory/IInventorySwapRequestData.d.ts b/types/models/eft/inventory/IInventorySwapRequestData.d.ts index ccf4796..abd3adb 100644 --- a/types/models/eft/inventory/IInventorySwapRequestData.d.ts +++ b/types/models/eft/inventory/IInventorySwapRequestData.d.ts @@ -1,11 +1,11 @@ import { OwnerInfo } from "@spt/models/eft/common/request/IBaseInteractionRequestData"; -import { IInventoryBaseActionRequestData, To } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IInventoryBaseActionRequestData, ITo } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySwapRequestData extends IInventoryBaseActionRequestData { Action: "Swap"; item: string; - to: To; + to: ITo; item2: string; - to2: To; + to2: ITo; fromOwner2: OwnerInfo; toOwner2: OwnerInfo; } diff --git a/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts b/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts index c9b97e0..f9bc284 100644 --- a/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts +++ b/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts @@ -3,9 +3,9 @@ export interface IOpenRandomLootContainerRequestData extends IInventoryBaseActio Action: "OpenRandomLootContainer"; /** Container item id being opened */ item: string; - to: To[]; + to: ITo[]; } -export interface To { +export interface ITo { /** Player character (pmc/scav) id items will be sent to */ id: string; } diff --git a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 0c48014..b66fc03 100644 --- a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,5 +1,5 @@ -import { Health, IQuestStatus, Productive, Skills } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IHealth, IHideoutImprovement, IMoneyTransferLimits, IProductive, IQuestStatus, ISkills } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IItemLocation, IUpd } from "@spt/models/eft/common/tables/IItem"; import { IQuest } from "@spt/models/eft/common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; @@ -8,79 +8,70 @@ export interface IItemEventRouterBase { warnings: Warning[]; profileChanges: TProfileChanges | ""; } -export type TProfileChanges = Record; +export type TProfileChanges = Record; export interface Warning { index: number; errmsg: string; code?: string; data?: any; } -export interface ProfileChange { +export interface IProfileChange { _id: string; experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; weaponBuilds: IWeaponBuildChange[]; equipmentBuilds: IEquipmentBuildChange[]; - items: ItemChanges; - production: Record; + items: IItemChanges; + production: Record; /** Hideout area improvement id */ - improvements: Record; - skills: Skills; - health: Health; - traderRelations: Record; + improvements: Record; + skills: ISkills; + health: IHealth; + traderRelations: Record; + moneyTransferLimitData: IMoneyTransferLimits; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { - Id: string; - Tpl: string; + id: string; + tpl: string; } export interface IWeaponBuildChange { id: string; name: string; root: string; - items: Item[]; + items: IItem[]; } export interface IEquipmentBuildChange { id: string; name: string; root: string; - items: Item[]; + items: IItem[]; type: string; fastpanel: any[]; buildType: EquipmentBuildType; } -export interface ItemChanges { - new: Product[]; - change: Product[]; - del: Product[]; -} -export interface Improvement { - completed: boolean; - improveCompleteTimestamp: number; +export interface IItemChanges { + new: IProduct[]; + change: IProduct[]; + del: IProduct[]; } /** Related to TraderInfo */ -export interface TraderData { +export interface ITraderData { salesSum: number; standing: number; loyalty: number; unlocked: boolean; disabled: boolean; } -export interface Product { +export interface IProduct { _id: string; _tpl?: string; parentId?: string; slotId?: string; - location?: ItemChangeLocation; - upd?: Upd; -} -export interface ItemChangeLocation { - x: number; - y: number; - r: number; - isSearched?: boolean; + location?: IItemLocation; + upd?: IUpd; } diff --git a/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts b/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts index 515b49a..5b39fb4 100644 --- a/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts +++ b/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts @@ -1,19 +1,19 @@ export interface IItemEventRouterRequest { - data: Daum[]; + data: IDaum[]; tm: number; reload: number; } -export interface Daum { +export interface IDaum { Action: string; item: string; - to: To; + to: ITo; } -export interface To { +export interface ITo { id: string; container: string; - location?: Location; + location?: ILocation; } -export interface Location { +export interface ILocation { x: number; y: number; r: string; diff --git a/types/models/eft/launcher/IMiniProfile.d.ts b/types/models/eft/launcher/IMiniProfile.d.ts index b25a1e7..856920f 100644 --- a/types/models/eft/launcher/IMiniProfile.d.ts +++ b/types/models/eft/launcher/IMiniProfile.d.ts @@ -1,3 +1,4 @@ +import { ISpt } from "../profile/ISptProfile"; export interface IMiniProfile { username: string; nickname: string; @@ -7,8 +8,7 @@ export interface IMiniProfile { prevexp: number; nextlvl: number; maxlvl: number; - sptData: SPTData; -} -export interface SPTData { - version: string; + edition: string; + profileId: string; + sptData: ISpt; } diff --git a/types/models/eft/location/IAirdropLootResult.d.ts b/types/models/eft/location/IAirdropLootResult.d.ts index cacc805..963e43c 100644 --- a/types/models/eft/location/IAirdropLootResult.d.ts +++ b/types/models/eft/location/IAirdropLootResult.d.ts @@ -1,5 +1,5 @@ -import { LootItem } from "@spt/models/spt/services/LootItem"; +import { ILootItem } from "@spt/models/spt/services/LootItem"; export interface IAirdropLootResult { dropType: string; - loot: LootItem[]; + loot: ILootItem[]; } diff --git a/types/models/eft/location/IGetAirdropLootRequest.d.ts b/types/models/eft/location/IGetAirdropLootRequest.d.ts new file mode 100644 index 0000000..c8a9cc9 --- /dev/null +++ b/types/models/eft/location/IGetAirdropLootRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetAirdropLootRequest { + containerId: string; +} diff --git a/types/models/eft/location/IGetAirdropLootResponse.d.ts b/types/models/eft/location/IGetAirdropLootResponse.d.ts new file mode 100644 index 0000000..93950db --- /dev/null +++ b/types/models/eft/location/IGetAirdropLootResponse.d.ts @@ -0,0 +1,6 @@ +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +export interface IGetAirdropLootResponse { + icon: AirdropTypeEnum; + container: IItem[]; +} diff --git a/types/models/eft/match/IEndLocalRaidRequestData.d.ts b/types/models/eft/match/IEndLocalRaidRequestData.d.ts new file mode 100644 index 0000000..08e3c12 --- /dev/null +++ b/types/models/eft/match/IEndLocalRaidRequestData.d.ts @@ -0,0 +1,41 @@ +import { ExitStatus } from "@spt/models/enums/ExitStatis"; +import { IPmcData } from "../common/IPmcData"; +import { IItem } from "../common/tables/IItem"; +export interface IEndLocalRaidRequestData { + /** ID of server player just left */ + serverId: string; + results: IEndRaidResult; + /** Insured items left in raid by player */ + lostInsuredItems: IItem[]; + /** Items sent via traders to player, keyed to service e.g. BTRTransferStash */ + transferItems: Record; + locationTransit: ILocationTransit; +} +export interface IEndRaidResult { + profile: IPmcData; + /** "Survived/Transit etc" */ + result: string; + ExitStatus: ExitStatus; + killerId: string; + killerAid: string; + exitName: string; + inSession: boolean; + favorite: boolean; + playTime: number; +} +export interface ILocationTransit { + hash: string; + playersCount: number; + ip: string; + location: string; + profiles: Record; + transitionRaidId: string; + raidMode: string; + side: string; + dayTime: string; +} +export interface ITransitProfile { + _id: string; + keyId: string; + isSolo: boolean; +} diff --git a/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts b/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts index 959986c..ad65e88 100644 --- a/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts +++ b/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts @@ -1,6 +1,5 @@ import { IRaidSettings } from "@spt/models/eft/match/IRaidSettings"; export interface IGetRaidConfigurationRequestData extends IRaidSettings { keyId: string; - CanShowGroupPreview: boolean; MaxGroupCount: number; } diff --git a/types/models/eft/match/IGroupCharacter.d.ts b/types/models/eft/match/IGroupCharacter.d.ts index 013930a..dbb8c87 100644 --- a/types/models/eft/match/IGroupCharacter.d.ts +++ b/types/models/eft/match/IGroupCharacter.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; export interface IGroupCharacter { _id: string; @@ -29,7 +29,7 @@ export interface IGroupCharacter { }; Equipment: { Id: string; - Items: Item[]; + Items: IItem[]; }; }; isLeader: boolean; diff --git a/types/models/eft/match/IPutMetricsRequestData.d.ts b/types/models/eft/match/IPutMetricsRequestData.d.ts index d9ed214..ab62acf 100644 --- a/types/models/eft/match/IPutMetricsRequestData.d.ts +++ b/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -1,10 +1,57 @@ export interface IPutMetricsRequestData { sid: string; settings: any; - SharedSettings: any; - HardwareDescription: any; + SharedSettings: ISharedSettings; + HardwareDescription: IHardwareDescription; Location: string; Metrics: any; - ClientEvents: any; + ClientEvents: IClientEvents; SpikeSamples: any[]; + mode: string; +} +export interface ISharedSettings { + StatedFieldOfView: number; +} +export interface IHardwareDescription { + deviceUniqueIdentifier: string; + systemMemorySize: number; + graphicsDeviceID: number; + graphicsDeviceName: string; + graphicsDeviceType: string; + graphicsDeviceVendor: string; + graphicsDeviceVendorID: number; + graphicsDeviceVersion: string; + graphicsMemorySize: number; + graphicsMultiThreaded: boolean; + graphicsShaderLevel: number; + operatingSystem: string; + processorCount: number; + processorFrequency: number; + processorType: string; + driveType: string; + swapDriveType: string; +} +export interface IClientEvents { + MatchingCompleted: number; + MatchingCompletedReal: number; + LocationLoaded: number; + LocationLoadedReal: number; + GamePrepared: number; + GamePreparedReal: number; + GameCreated: number; + GameCreatedReal: number; + GamePooled: number; + GamePooledReal: number; + GameRunned: number; + GameRunnedReal: number; + GameSpawn: number; + GameSpawnReal: number; + PlayerSpawnEvent: number; + PlayerSpawnEventReal: number; + GameSpawned: number; + GameSpawnedReal: number; + GameStarting: number; + GameStartingReal: number; + GameStarted: number; + GameStartedReal: number; } diff --git a/types/models/eft/match/IRaidSettings.d.ts b/types/models/eft/match/IRaidSettings.d.ts index 78a0c19..a4b7450 100644 --- a/types/models/eft/match/IRaidSettings.d.ts +++ b/types/models/eft/match/IRaidSettings.d.ts @@ -10,17 +10,20 @@ import { TimeFlowType } from "@spt/models/enums/RaidSettings/TimeAndWeather/Time import { WindSpeed } from "@spt/models/enums/RaidSettings/TimeAndWeather/WindSpeed"; import { SideType } from "@spt/models/enums/SideType"; export interface IRaidSettings { + keyId: string; location: string; + isLocationTransition: boolean; timeVariant: DateTime; - raidMode: RaidMode; metabolismDisabled: boolean; - playersSpawnPlace: PlayersSpawnPlace; - timeAndWeatherSettings: TimeAndWeatherSettings; - botSettings: BotSettings; - wavesSettings: WavesSettings; + timeAndWeatherSettings: ITimeAndWeatherSettings; + botSettings: IBotSettings; + wavesSettings: IWavesSettings; side: SideType; + raidMode: RaidMode; + playersSpawnPlace: PlayersSpawnPlace; + CanShowGroupPreview: boolean; } -export interface TimeAndWeatherSettings { +export interface ITimeAndWeatherSettings { isRandomTime: boolean; isRandomWeather: boolean; cloudinessType: CloudinessType; @@ -30,11 +33,11 @@ export interface TimeAndWeatherSettings { timeFlowType: TimeFlowType; hourOfDay: number; } -export interface BotSettings { +export interface IBotSettings { isScavWars: boolean; botAmount: BotAmount; } -export interface WavesSettings { +export interface IWavesSettings { botAmount: BotAmount; botDifficulty: BotDifficulty; isBosses: boolean; diff --git a/types/models/eft/match/IStartLocalRaidRequestData.d.ts b/types/models/eft/match/IStartLocalRaidRequestData.d.ts new file mode 100644 index 0000000..8477df5 --- /dev/null +++ b/types/models/eft/match/IStartLocalRaidRequestData.d.ts @@ -0,0 +1,17 @@ +export interface IStartLocalRaidRequestData { + serverId: string; + location: string; + timeVariant: string; + mode: string; + playerSide: string; + isLocationTransition: boolean; + transition: IStartLocalRaidTransition; + /** Should loot generation be skipped, default false */ + sptSkipLootGeneration?: boolean; +} +export interface IStartLocalRaidTransition { + isLocationTransition: boolean; + transitionRaidId: string; + transitionCount: number; + visitedLocations: string[]; +} diff --git a/types/models/eft/match/IStartLocalRaidResponseData.d.ts b/types/models/eft/match/IStartLocalRaidResponseData.d.ts new file mode 100644 index 0000000..50b3584 --- /dev/null +++ b/types/models/eft/match/IStartLocalRaidResponseData.d.ts @@ -0,0 +1,19 @@ +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { IInsuredItem } from "@spt/models/eft/common/tables/IBotBase"; +import { ILocationServices } from "@spt/models/eft/common/tables/ILocationServices"; +export interface IStartLocalRaidResponseData { + serverId: string; + serverSettings: ILocationServices; + profile: IProfileInsuredItems; + locationLoot: ILocationBase; + transition: ITransition; +} +export interface IProfileInsuredItems { + insuredItems: IInsuredItem[]; +} +export interface ITransition { + isLocationTransition: boolean; + transitionRaidId: string; + transitionCount: number; + visitedLocations: string[]; +} diff --git a/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts b/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts index f1123c1..b59fe10 100644 --- a/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts +++ b/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts @@ -1,4 +1,4 @@ -import { Skills } from "@spt/models/eft/common/tables/IBotBase"; +import { ISkills } from "@spt/models/eft/common/tables/IBotBase"; export interface IPlayerIncrementSkillLevelRequestData { _id: string; experience: number; @@ -7,7 +7,7 @@ export interface IPlayerIncrementSkillLevelRequestData { builds: any[]; items: Items; production: Production; - skills: Skills; + skills: ISkills; traderRelations: TraderRelations; } export interface Items { @@ -15,7 +15,5 @@ export interface Items { change: any[]; del: any[]; } -export interface Production { -} -export interface TraderRelations { -} +export type Production = {}; +export type TraderRelations = {}; diff --git a/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 3cb8533..9852ccb 100644 --- a/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,9 +1,9 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; Id: string; /** name of preset given by player */ Name: string; Root: string; - Items: Item[]; + Items: IItem[]; } diff --git a/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/types/models/eft/profile/GetProfileStatusResponseData.d.ts index 1228c2e..2f3a6a8 100644 --- a/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -1,8 +1,8 @@ -export interface GetProfileStatusResponseData { +export interface IGetProfileStatusResponseData { maxPveCountExceeded: false; - profiles: ProfileData[]; + profiles: IProfileStatusData[]; } -export interface ProfileData { +export interface IProfileStatusData { profileid: string; profileToken: string; status: string; diff --git a/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 7df4eba..0b4683a 100644 --- a/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,14 +1,14 @@ -import { OverallCounters, Skills } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IOverallCounters, ISkills } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; info: IOtherProfileInfo; customization: IOtherProfileCustomization; - skills: Skills; + skills: ISkills; equipment: IOtherProfileEquipment; achievements: Record; - favoriteItems: string[]; + favoriteItems: IItem[]; pmcStats: IOtherProfileStats; scavStats: IOtherProfileStats; } @@ -29,12 +29,12 @@ export interface IOtherProfileCustomization { } export interface IOtherProfileEquipment { Id: string; - Items: Item[]; + Items: IItem[]; } export interface IOtherProfileStats { eft: IOtherProfileSubStats; } export interface IOtherProfileSubStats { totalInGameTime: number; - overAllCounters: OverallCounters; + overAllCounters: IOverallCounters; } diff --git a/types/models/eft/profile/ISptProfile.d.ts b/types/models/eft/profile/ISptProfile.d.ts index a8e742a..8290b1c 100644 --- a/types/models/eft/profile/ISptProfile.d.ts +++ b/types/models/eft/profile/ISptProfile.d.ts @@ -1,26 +1,26 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { MessageType } from "@spt/models/enums/MessageType"; import { IProfileChangeEvent } from "@spt/models/spt/dialog/ISendMessageDetails"; export interface ISptProfile { info: Info; - characters: Characters; + characters: ICharacters; /** Clothing purchases */ suits: string[]; userbuilds: IUserBuilds; - dialogues: Record; - spt: Spt; - vitality: Vitality; - inraid: Inraid; - insurance: Insurance[]; + dialogues: Record; + spt: ISpt; + vitality: IVitality; + inraid: IInraid; + insurance: IInsurance[]; /** Assort purchases made by player since last trader refresh */ - traderPurchases?: Record>; + traderPurchases?: Record>; /** Achievements earned by player */ achievements: Record; } -export declare class TraderPurchaseData { +export declare class ITraderPurchaseData { count: number; purchaseTimestamp: number; } @@ -34,7 +34,7 @@ export interface Info { wipe: boolean; edition: string; } -export interface Characters { +export interface ICharacters { pmc: IPmcData; scav: IPmcData; } @@ -50,11 +50,11 @@ export interface IUserBuild { } export interface IWeaponBuild extends IUserBuild { Root: string; - Items: Item[]; + Items: IItem[]; } export interface IEquipmentBuild extends IUserBuild { Root: string; - Items: Item[]; + Items: IItem[]; BuildType: EquipmentBuildType; } export interface IMagazineBuild extends IUserBuild { @@ -69,18 +69,18 @@ export interface IMagazineTemplateAmmoItem { } /** Used by defaultEquipmentPresets.json */ export interface IDefaultEquipmentPreset extends IUserBuild { - Items: Item[]; + Items: IItem[]; Root: string; BuildType: EquipmentBuildType; type: string; } -export interface Dialogue { +export interface IDialogue { attachmentsNew: number; new: number; type: MessageType; Users?: IUserDialogInfo[]; pinned: boolean; - messages: Message[]; + messages: IMessage[]; _id: string; } export interface IUserDialogInfo { @@ -95,16 +95,16 @@ export interface IUserDialogDetails { MemberCategory: MemberCategory; SelectedMemberCategory: MemberCategory; } -export interface DialogueInfo { +export interface IDialogueInfo { attachmentsNew: number; new: number; _id: string; type: MessageType; pinned: boolean; Users?: IUserDialogInfo[]; - message: MessagePreview; + message: IMessagePreview; } -export interface Message { +export interface IMessage { _id: string; uid: string; type: MessageType; @@ -116,7 +116,7 @@ export interface Message { replyTo?: IReplyTo; hasRewards?: boolean; rewardCollected: boolean; - items?: MessageItems; + items?: IMessageItems; maxStorageTime?: number; systemData?: ISystemData; profileChangeEvents?: IProfileChangeEvent[]; @@ -128,7 +128,7 @@ export interface IReplyTo { dt: number; text?: string; } -export interface MessagePreview { +export interface IMessagePreview { uid: string; type: MessageType; dt: number; @@ -136,9 +136,9 @@ export interface MessagePreview { text?: string; systemData?: ISystemData; } -export interface MessageItems { +export interface IMessageItems { stash?: string; - data?: Item[]; + data?: IItem[]; } export interface ISystemData { date?: string; @@ -156,39 +156,37 @@ export interface IUpdatableChatMember { Ignored: boolean; Banned: boolean; } -export interface DateTime { - date: string; - time: string; -} -export interface Spt { +export interface ISpt { /** What version of SPT was this profile made with */ version: string; /** What mods has this profile loaded at any point in time */ - mods?: ModDetails[]; + mods?: IModDetails[]; /** What gifts has this profile received and how many */ - receivedGifts: ReceivedGift[]; + receivedGifts?: IReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; /** key: daily type */ - freeRepeatableRefreshUsedCount: Record; + freeRepeatableRefreshUsedCount?: Record; + /** When was a profile migrated, value is timestamp */ + migrations?: Record; } -export interface ModDetails { +export interface IModDetails { name: string; version: string; author: string; dateAdded: number; url: string; } -export interface ReceivedGift { +export interface IReceivedGift { giftId: string; timestampLastAccepted: number; current: number; } -export interface Vitality { - health: Health; - effects: Effects; +export interface IVitality { + health: IHealth; + effects: IEffects; } -export interface Health { +export interface IHealth { Hydration: number; Energy: number; Temperature: number; @@ -200,47 +198,44 @@ export interface Health { LeftLeg: number; RightLeg: number; } -export interface Effects { - Head: Head; - Chest: Chest; - Stomach: Stomach; - LeftArm: LeftArm; - RightArm: RightArm; - LeftLeg: LeftLeg; - RightLeg: RightLeg; -} -export interface Head { -} -export interface Chest { -} -export interface Stomach { -} -export interface LeftArm { +export interface IEffects { + Head: IHead; + Chest: IChest; + Stomach: IStomach; + LeftArm: ILeftArm; + RightArm: IRightArm; + LeftLeg: ILeftLeg; + RightLeg: IRightLeg; +} +export type IHead = {}; +export type IChest = {}; +export type IStomach = {}; +export interface ILeftArm { Fracture?: number; } -export interface RightArm { +export interface IRightArm { Fracture?: number; } -export interface LeftLeg { +export interface ILeftLeg { Fracture?: number; } -export interface RightLeg { +export interface IRightLeg { Fracture?: number; } -export interface Inraid { +export interface IInraid { location: string; character: string; } -export interface Insurance { +export interface IInsurance { scheduledTime: number; traderId: string; maxStorageTime: number; systemData: ISystemData; messageType: MessageType; messageTemplateId: string; - items: Item[]; + items: IItem[]; } -export interface MessageContentRagfair { +export interface IMessageContentRagfair { offerId: string; count: number; handbookId: string; diff --git a/types/models/eft/quests/IHandoverQuestRequestData.d.ts b/types/models/eft/quests/IHandoverQuestRequestData.d.ts index 63f10a8..39604d5 100644 --- a/types/models/eft/quests/IHandoverQuestRequestData.d.ts +++ b/types/models/eft/quests/IHandoverQuestRequestData.d.ts @@ -2,9 +2,9 @@ export interface IHandoverQuestRequestData { Action: "QuestHandover"; qid: string; conditionId: string; - items: Item[]; + items: IHandoverItem[]; } -export interface Item { +export interface IHandoverItem { id: string; count: number; } diff --git a/types/models/eft/ragfair/IAddOfferRequestData.d.ts b/types/models/eft/ragfair/IAddOfferRequestData.d.ts index 465ee02..b87040a 100644 --- a/types/models/eft/ragfair/IAddOfferRequestData.d.ts +++ b/types/models/eft/ragfair/IAddOfferRequestData.d.ts @@ -2,9 +2,9 @@ export interface IAddOfferRequestData { Action: string; sellInOnePiece: boolean; items: string[]; - requirements: Requirement[]; + requirements: IRequirement[]; } -export interface Requirement { +export interface IRequirement { _tpl: string; count: number; level: number; diff --git a/types/models/eft/ragfair/IRagfairOffer.d.ts b/types/models/eft/ragfair/IRagfairOffer.d.ts index 2e97a99..77c5605 100644 --- a/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -1,47 +1,49 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { DogtagExchangeSide } from "@spt/models/enums/DogtagExchangeSide"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; export interface IRagfairOffer { - sellResult?: SellResult[]; + sellResult?: ISellResult[]; _id: string; - items: Item[]; - requirements: OfferRequirement[]; + items: IItem[]; + requirements: IOfferRequirement[]; root: string; intId: number; /** Handbook price */ itemsCost: number; - /** Rouble price */ + /** Rouble price per item */ requirementsCost: number; startTime: number; endTime: number; + /** True when offer is sold as pack */ sellInOnePiece: boolean; + /** Rouble price - same as requirementsCost */ + summaryCost: number; + user: IRagfairOfferUser; + /** Trader only */ + unlimitedCount?: boolean; loyaltyLevel: number; buyRestrictionMax?: number; buyRestrictionCurrent?: number; - locked: boolean; - unlimitedCount: boolean; - /** Rouble price */ - summaryCost: number; - user: IRagfairOfferUser; - notAvailable: boolean; - /** TODO - implement this value - not currently used */ - CurrentItemCount: number; - priority: boolean; + locked?: boolean; } -export interface OfferRequirement { +export interface IOfferRequirement { _tpl: string; count: number; onlyFunctional: boolean; + level?: number; + side?: DogtagExchangeSide; } export interface IRagfairOfferUser { id: string; nickname?: string; rating?: number; memberType: MemberCategory; + selectedMemberCategory?: MemberCategory; avatar?: string; isRatingGrowing?: boolean; aid?: number; } -export interface SellResult { +export interface ISellResult { sellTime: number; amount: number; } diff --git a/types/models/eft/ragfair/ISearchRequestData.d.ts b/types/models/eft/ragfair/ISearchRequestData.d.ts index 8261c5b..c631de8 100644 --- a/types/models/eft/ragfair/ISearchRequestData.d.ts +++ b/types/models/eft/ragfair/ISearchRequestData.d.ts @@ -29,5 +29,4 @@ export declare enum OfferOwnerType { TRADEROWNERTYPE = 1, PLAYEROWNERTYPE = 2 } -export interface BuildItems { -} +export type BuildItems = {}; diff --git a/types/models/eft/repair/IRepairActionDataRequest.d.ts b/types/models/eft/repair/IRepairActionDataRequest.d.ts index d51c1b9..58773df 100644 --- a/types/models/eft/repair/IRepairActionDataRequest.d.ts +++ b/types/models/eft/repair/IRepairActionDataRequest.d.ts @@ -1,10 +1,10 @@ import { IBaseRepairActionDataRequest } from "@spt/models/eft/repair/IBaseRepairActionDataRequest"; export interface IRepairActionDataRequest extends IBaseRepairActionDataRequest { Action: "Repair"; - repairKitsInfo: RepairKitsInfo[]; + repairKitsInfo: IRepairKitsInfo[]; target: string; } -export interface RepairKitsInfo { +export interface IRepairKitsInfo { _id: string; count: number; } diff --git a/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts b/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts index 50f308e..c55a1d9 100644 --- a/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts +++ b/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts @@ -2,9 +2,9 @@ import { IBaseRepairActionDataRequest } from "@spt/models/eft/repair/IBaseRepair export interface ITraderRepairActionDataRequest extends IBaseRepairActionDataRequest { Action: "TraderRepair"; tid: string; - repairItems: RepairItem[]; + repairItems: IRepairItem[]; } -export interface RepairItem { +export interface IRepairItem { _id: string; count: number; } diff --git a/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts b/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts index d64b2c9..d72a131 100644 --- a/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts +++ b/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts @@ -6,9 +6,9 @@ export interface IProcessBuyTradeRequestData extends IProcessBaseTradeRequestDat item_id: string; count: number; scheme_id: number; - scheme_items: SchemeItem[]; + scheme_items: ISchemeItem[]; } -export interface SchemeItem { +export interface ISchemeItem { /** Id of stack to take money from, is money tpl when Action is `SptInsure` */ id: string; count: number; diff --git a/types/models/eft/trade/IProcessSellTradeRequestData.d.ts b/types/models/eft/trade/IProcessSellTradeRequestData.d.ts index 459bd28..b345c3e 100644 --- a/types/models/eft/trade/IProcessSellTradeRequestData.d.ts +++ b/types/models/eft/trade/IProcessSellTradeRequestData.d.ts @@ -4,9 +4,9 @@ export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestDa type: string; tid: string; price: number; - items: Item[]; + items: ISoldItem[]; } -export interface Item { +export interface ISoldItem { id: string; count: number; scheme_id: number; diff --git a/types/models/eft/weather/IWeatherData.d.ts b/types/models/eft/weather/IWeatherData.d.ts index 81bc746..2246b86 100644 --- a/types/models/eft/weather/IWeatherData.d.ts +++ b/types/models/eft/weather/IWeatherData.d.ts @@ -12,12 +12,15 @@ export interface IWeather { temp: number; fog: number; rain_intensity: number; + /** 1 - 3 light rain, 3+ 'rain' */ rain: number; wind_gustiness: number; wind_direction: WindDirection; wind_speed: number; + /** < -0.4 = clear day */ cloud: number; time: string; date: string; timestamp: number; + sptInRaidTimestamp: number; } diff --git a/types/models/eft/wishlist/IAddToWishlistRequest.d.ts b/types/models/eft/wishlist/IAddToWishlistRequest.d.ts new file mode 100644 index 0000000..656f77b --- /dev/null +++ b/types/models/eft/wishlist/IAddToWishlistRequest.d.ts @@ -0,0 +1,4 @@ +export interface IAddToWishlistRequest { + Action: string; + items: Record; +} diff --git a/types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts b/types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts new file mode 100644 index 0000000..7ce88e0 --- /dev/null +++ b/types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts @@ -0,0 +1,5 @@ +export interface IChangeWishlistItemCategoryRequest { + Action: string; + item: string; + category: number; +} diff --git a/types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts b/types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts new file mode 100644 index 0000000..6a13b1f --- /dev/null +++ b/types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveFromWishlistRequest { + Action: string; + items: string[]; +} diff --git a/types/models/eft/wishlist/IWishlistActionData.d.ts b/types/models/eft/wishlist/IWishlistActionData.d.ts deleted file mode 100644 index 9217864..0000000 --- a/types/models/eft/wishlist/IWishlistActionData.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IWishlistActionData { - Action: string; - templateId: string; -} diff --git a/types/models/eft/ws/IWsChatMessageReceived.d.ts b/types/models/eft/ws/IWsChatMessageReceived.d.ts index 302d8f1..cc73cf3 100644 --- a/types/models/eft/ws/IWsChatMessageReceived.d.ts +++ b/types/models/eft/ws/IWsChatMessageReceived.d.ts @@ -1,8 +1,8 @@ import { IGroupCharacter } from "@spt/models/eft/match/IGroupCharacter"; -import { Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage } from "@spt/models/eft/profile/ISptProfile"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; export interface IWsChatMessageReceived extends IWsNotificationEvent { dialogId: string; - message: Message; + message: IMessage; profiles?: IGroupCharacter[]; } diff --git a/types/models/enums/AirdropType.d.ts b/types/models/enums/AirdropType.d.ts index a6f6e3a..103c204 100644 --- a/types/models/enums/AirdropType.d.ts +++ b/types/models/enums/AirdropType.d.ts @@ -1,6 +1,13 @@ export declare enum AirdropTypeEnum { - MIXED = "mixed", - WEAPONARMOR = "weaponarmor", - FOODMEDICAL = "foodmedical", - BARTER = "barter" + COMMON = "Common", + SUPPLY = "Supply", + MEDICAL = "Medical", + WEAPON_ARMOR = "Weapon" +} +export declare enum SptAirdropTypeEnum { + COMMON = "mixed", + SUPPLY = "barter", + FOOD_MEDICAL = "foodMedical", + WEAPON_ARMOR = "weaponArmor", + RADAR = "radar" } diff --git a/types/models/enums/ConfigTypes.d.ts b/types/models/enums/ConfigTypes.d.ts index 646fd55..2c4483a 100644 --- a/types/models/enums/ConfigTypes.d.ts +++ b/types/models/enums/ConfigTypes.d.ts @@ -24,6 +24,5 @@ export declare enum ConfigTypes { WEATHER = "spt-weather", SEASONAL_EVENT = "spt-seasonalevents", LOST_ON_DEATH = "spt-lostondeath", - GIFTS = "spt-gifts", - BTR = "spt-btr" + GIFTS = "spt-gifts" } diff --git a/types/models/enums/DogtagExchangeSide.d.ts b/types/models/enums/DogtagExchangeSide.d.ts new file mode 100644 index 0000000..de3d4df --- /dev/null +++ b/types/models/enums/DogtagExchangeSide.d.ts @@ -0,0 +1,5 @@ +export declare enum DogtagExchangeSide { + USEC = "Usec", + BEAR = "Bear", + ANY = "Any" +} diff --git a/types/models/enums/HideoutAreas.d.ts b/types/models/enums/HideoutAreas.d.ts index 1af487a..6211f26 100644 --- a/types/models/enums/HideoutAreas.d.ts +++ b/types/models/enums/HideoutAreas.d.ts @@ -25,5 +25,7 @@ export declare enum HideoutAreas { EMERGENCY_WALL = 22, GYM = 23, WEAPON_STAND = 24, - WEAPON_STAND_SECONDARY = 25 + WEAPON_STAND_SECONDARY = 25, + EQUIPMENT_PRESETS_STAND = 26, + CIRCLE_OF_CULTISTS = 27 } diff --git a/types/models/enums/HideoutEventActions.d.ts b/types/models/enums/HideoutEventActions.d.ts index 556c799..a495db9 100644 --- a/types/models/enums/HideoutEventActions.d.ts +++ b/types/models/enums/HideoutEventActions.d.ts @@ -10,5 +10,7 @@ export declare enum HideoutEventActions { HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction", HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints", HIDEOUT_IMPROVE_AREA = "HideoutImproveArea", - HIDEOUT_CANCEL_PRODUCTION_COMMAND = "HideoutCancelProductionCommand" + HIDEOUT_CANCEL_PRODUCTION_COMMAND = "HideoutCancelProductionCommand", + HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START = "HideoutCircleOfCultistProductionStart", + HIDEOUT_DELETE_PRODUCTION_COMMAND = "HideoutDeleteProductionCommand" } diff --git a/types/models/enums/ItemTpl.d.ts b/types/models/enums/ItemTpl.d.ts index 8512ea8..46502ac 100644 --- a/types/models/enums/ItemTpl.d.ts +++ b/types/models/enums/ItemTpl.d.ts @@ -37,8 +37,8 @@ export declare enum ItemTpl { AMMOBOX_366TKM_GEKSA_20RND = "657023fcbfc87b3a34093213", AMMOBOX_45ACP_AP_50RND = "6489879db5a2df1c815a04ef", AMMOBOX_45ACP_FMJ_50RND = "6570240ecfc010a0f50069f2", - AMMOBOX_45ACP_HSHOCK_50RND = "65702406bfc87b3a34093216", - AMMOBOX_45ACP_LASERFMJ_50RND = "6570240a1419851aef03e6f7", + AMMOBOX_45ACP_HYDRASHOK_50RND = "65702406bfc87b3a34093216", + AMMOBOX_45ACP_LASERMATCH_50RND = "6570240a1419851aef03e6f7", AMMOBOX_45ACP_RIP_50RND = "65702414c5d7d4cb4d078555", AMMOBOX_46X30_ACTION_SX_40RND = "657024c81419851aef03e712", AMMOBOX_46X30_AP_SX_40RND = "6489870774a806211e4fb685", @@ -204,6 +204,10 @@ export declare enum ItemTpl { AMMOBOX_9X39_SPP_8RND = "5c12619186f7743f871c8a32", AMMO_127X108_B32 = "5cde8864d7f00c0010373be1", AMMO_127X108_BZT44M = "5d2f2ab648f03550091993ca", + AMMO_127X33_COPPER = "66a0d1e0ed648d72fe064d06", + AMMO_127X33_FMJ = "668fe62ac62660a5d8071446", + AMMO_127X33_HAWK_JSP = "66a0d1f88486c69fce00fdf6", + AMMO_127X33_JHP = "66a0d1c87d0d369e270bb9de", AMMO_127X55_PS12 = "5cadf6ddae9215051e1c23b2", AMMO_127X55_PS12A = "5cadf6e5ae921500113bb973", AMMO_127X55_PS12B = "5cadf6eeae921500134b2799", @@ -237,12 +241,14 @@ export declare enum ItemTpl { AMMO_23X75_SHRAP10 = "5e85a9a6eacf8c039e4e2ac1", AMMO_23X75_SHRAP25 = "5f647f31b6238e5dd066e196", AMMO_23X75_ZVEZDA = "5e85a9f4add9fe03027d9bf1", + AMMO_26X75_AC = "635267f063651329f75a4ee8", AMMO_26X75_FLARE = "62389bc9423ed1685422dc57", AMMO_26X75_GREEN = "62389aaba63f32501b1b444f", AMMO_26X75_RED = "62389ba9a63f32501b1b4451", - AMMO_26X75_SIGNAL = "635267f063651329f75a4ee8", + AMMO_26X75_SIGNAL_FLARE_BLUE = "66d97834d2985e11480d5c1e", AMMO_26X75_SIGNAL_FLARE_GREEN = "624c0570c9b794431568f5d5", AMMO_26X75_SIGNAL_FLARE_RED = "624c09cfbc2e27219346d955", + AMMO_26X75_SIGNAL_FLARE_SPECIAL_YELLOW = "66d9f3047b82b9a9aa055d81", AMMO_26X75_SIGNAL_FLARE_WHITE = "624c09da2cec124eb67c1046", AMMO_26X75_SIGNAL_FLARE_YELLOW = "624c09e49b98e019a3315b66", AMMO_26X75_YELLOW = "62389be94d5d474bf712e709", @@ -510,6 +516,7 @@ export declare enum ItemTpl { ASSAULTCARBINE_KBP_VSK94_9X39_RIFLE = "645e0c6b3b381ede770e1cc9", ASSAULTCARBINE_MOLOT_ARMS_SIMONOV_OPSKS_762X39_CARBINE = "587e02ff24597743df3deaeb", ASSAULTCARBINE_MOLOT_ARMS_VPO101_VEPRHUNTER_762X51_CARBINE = "5c501a4d2e221602b412b540", + ASSAULTCARBINE_SR3M_9X39_COMPACT_ASSAULT_RIFLE = "651450ce0e00edc794068371", ASSAULTCARBINE_TOKAREV_AVT40_762X54R_AUTOMATIC_RIFLE = "6410733d5dd49d77bd07847e", ASSAULTCARBINE_TOKAREV_SVT40_762X54R_RIFLE = "643ea5b23db6f9f57107d9fd", ASSAULTCARBINE_TOZ_SIMONOV_SKS_762X39_CARBINE = "574d967124597745970e7c94", @@ -551,8 +558,8 @@ export declare enum ItemTpl { ASSAULTRIFLE_RIFLE_DYNAMICS_RD704_762X39_ASSAULT_RIFLE = "628a60ae6b1d481ff772e9c8", ASSAULTRIFLE_SAG_AK545_545X39_CARBINE = "628b5638ad252a16da6dd245", ASSAULTRIFLE_SAG_AK545_SHORT_545X39_CARBINE = "628b9c37a733087d0d7fe84b", + ASSAULTRIFLE_SIG_MCXSPEAR_68X51_ASSAULT_RIFLE = "65290f395ae2ae97b80fdf2d", ASSAULTRIFLE_SIG_MCX_300_BLACKOUT_ASSAULT_RIFLE = "5fbcc1d9016cce60e8341ab3", - ASSAULTRIFLE_SIG_MCX_SPEAR_68X51_ASSAULT_RIFLE = "65290f395ae2ae97b80fdf2d", ASSAULTRIFLE_STEYR_AUG_A1_556X45_ASSAULT_RIFLE = "62e7c4fba689e8c9c50dfc38", ASSAULTRIFLE_STEYR_AUG_A3_556X45_ASSAULT_RIFLE = "63171672192e68c5460cebc5", ASSAULTSCOPE_ELCAN_SPECTERDR_1X4X_SCOPE = "57ac965c24597706be5f975c", @@ -615,6 +622,7 @@ export declare enum ItemTpl { BACKPACK_6SH118_RAID_BACKPACK_DIGITAL_FLORA = "5df8a4d786f77412672a1e3b", BACKPACK_ANA_TACTICAL_BETA_2_BATTLE_BACKPACK_OLIVE_DRAB = "5b44c6ae86f7742d1627baea", BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_FOLIAGE = "545cdae64bdc2d39198b4568", + BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_MULTICAM = "66b5f22b78bbc0200425f904", BACKPACK_DIRECT_ACTION_DRAGON_EGG_MARK_II_BACKPACK_BLACK = "656f198fb27298d6fd005466", BACKPACK_DUFFLE_BAG = "56e33634d2720bd8058b456b", BACKPACK_EBERLESTOCK_F4_TERMINATOR_LOAD_BEARING_BACKPACK_TIGER_STRIPE = "5f5e46b96bdad616ad46d613", @@ -636,7 +644,9 @@ export declare enum ItemTpl { BACKPACK_MYSTERY_RANCH_BLACKJACK_50_BACKPACK_MULTICAM = "5c0e774286f77468413cc5b2", BACKPACK_MYSTERY_RANCH_NICE_COMM_3_BVS_FRAME_SYSTEM_COYOTE = "628bc7fb408e2b2e9c0801b1", BACKPACK_MYSTERY_RANCH_SATL_BRIDGER_ASSAULT_PACK_FOLIAGE = "656e0436d44a1bb4220303a0", + BACKPACK_MYSTERY_RANCH_TERRAPLANE = "56e294cdd2720b603a8b4575", BACKPACK_OAKLEY_MECHANISM_HEAVY_DUTY_BACKPACK_BLACK = "5d5d940f86f7742797262046", + BACKPACK_PARTISANS_BAG = "66a9f98f3bd5a41b162030f4", BACKPACK_PILGRIM_TOURIST = "59e763f286f7742ee57895da", BACKPACK_SANITARS_BAG = "5e997f0b86f7741ac73993e2", BACKPACK_SANTAS_BAG = "61b9e1aaef9a1b5d6a79899a", @@ -646,6 +656,7 @@ export declare enum ItemTpl { BACKPACK_TASMANIAN_TIGER_TROOPER_35_BACKPACK_KHAKI = "639346cc1c8f182ad90c8972", BACKPACK_TEHINKOM_RKPT25_PATROL_BACKPACK_DIGITAL_FLORA = "656ddcf0f02d7bcea90bf395", BACKPACK_TRANSFORMER_BAG = "56e33680d2720be2748b4576", + BACKPACK_VERTX_READY_PACK_BACKPACK_RED = "66b5f247af44ca0014063c02", BACKPACK_VKBO_ARMY_BAG = "5ab8ee7786f7742d8f33f0b9", BACKPACK_WARTECH_BERKUT_BB102_BACKPACK_ATACS_FG = "5ca20d5986f774331e7c9602", BARREL_9A91_9X39 = "645122f6d4928d46d30be3ff", @@ -660,6 +671,11 @@ export declare enum ItemTpl { BARREL_AR15_HANSON_CARBINE_556X45_137_INCH = "63d3ce0446bd475bcb50f55f", BARREL_AR15_HANSON_CARBINE_556X45_16_INCH = "63d3d44a2a49307baf09386d", BARREL_BENELLI_M3_SUPER_90_12GA_500MM = "6259c2c1d714855d182bad85", + BARREL_DESERT_EAGLE_L5_357_127MM = "669fa4c61bd4416eaa09b3ca", + BARREL_DESERT_EAGLE_L5_50_AE_127MM = "669fa4ba1bd4416eaa09b3c6", + BARREL_DESERT_EAGLE_L6_50_AE_152MM = "669fa47da0bab4e8510d9526", + BARREL_DESERT_EAGLE_L6_50_AE_152MM_BARREL_WTS = "669fa48fa0bab4e8510d952a", + BARREL_DESERT_EAGLE_MK_XIX_50_AE_152MM = "668fe5f62a0f85eea407cc18", BARREL_DVL10_762X51_500MM = "5888945a2459774bf43ba385", BARREL_DVL10_M2_762X51_660MM = "5888956924597752983e182d", BARREL_FN_FIVESEVEN_57X28 = "5d3eb5b6a4b9361eab311902", @@ -706,6 +722,10 @@ export declare enum ItemTpl { BARREL_M1911A1_45_ACP_THREADED = "5f3e77f59103d430b93f94c1", BARREL_M1A_762X51_16_INCH = "5aaf9d53e5b5b00015042a52", BARREL_M1A_762X51_22_INCH = "5addbac75acfc400194dbc56", + BARREL_M60E3_762X51_584MM = "6601279cc752a02bbe05e692", + BARREL_M60E4_762X51_458MM = "660126f7c752a02bbe05e688", + BARREL_M60E4_762X51_475MM_HEAVY = "66012788c752a02bbe05e68e", + BARREL_M60E6_762X51_458MM = "66225d88a1c7e3b81600c76f", BARREL_M700_762X51_20_INCH_STAINLESS_STEEL_THREADED = "5d2703038abbc3105103d94c", BARREL_M700_762X51_20_INCH_THREADED = "5bfebc320db8340019668d79", BARREL_M700_762X51_26_INCH = "5bfebc250db834001a6694e1", @@ -716,9 +736,9 @@ export declare enum ItemTpl { BARREL_M870_12GA_660MM_VENT_RIB = "5a787fadc5856700155a6ca1", BARREL_M870_12GA_SAWEDOFF_325MM = "5a787fdfc5856700142fdd9a", BARREL_M9A3_9X19_THREADED = "5cadc1c6ae9215000f2775a4", + BARREL_MCXSPEAR_68X51_330MM = "652910565ae2ae97b80fdf35", BARREL_MCX_300_BLK_171MM = "5fbbfabed5cb881a7363194e", BARREL_MCX_300_BLK_229MM = "5fbbfacda56d053a3543f799", - BARREL_MCX_SPEAR_68X51_330MM = "652910565ae2ae97b80fdf35", BARREL_MDR_556X45_16_INCH = "5c48a2852e221602b21d5923", BARREL_MDR_762X51_16_INCH = "5dcbe9431e1f4616d354987e", BARREL_MK18_338_LM_24_INCH = "5fc23678ab884124df0cd590", @@ -790,7 +810,15 @@ export declare enum ItemTpl { BARREL_TT_762X25_116MM = "571a26d524597720680fbe8a", BARREL_TT_762X25_116MM_GILDED = "5b3baf8f5acfc40dc5296692", BARREL_TT_762X25_121MM_HOMESPUN_THREADED = "571a279b24597720b4066566", - BARREL_VPO215_GORNOSTAY_366TKM_23_INCH = "5de65547883dde217541644b", + BARREL_UZI_238MM_THREADED_3LUG = "6698c89bfbc8142e60024b0e", + BARREL_UZI_9X19_259MM = "6698c8ab29e062525d0ad8ab", + BARREL_UZI_9X19_409MM = "6698c8b7710a4525fe0e9e55", + BARREL_UZI_PRO_9X19_114MM = "66866fe776d1a87cd80fd388", + BARREL_UZI_PRO_9X19_170MM = "6686700a2b934a68630a7fe6", + BARREL_UZI_PRO_9X19_210MM = "66867023c3d473265104f384", + BARREL_UZI_PRO_9X19_240MM = "668670432b934a68630a7fe8", + BARREL_UZI_PRO_9X19_PIKE_ARMS_114MM_THREADED = "668031705014e211b4078046", + BARREL_VPO21502_366TKM_600MM = "5de65547883dde217541644b", BARREL_VSK94_9X39 = "645123013d52156624001fd1", BARTER_42_SIGNATURE_BLEND_ENGLISH_TEA = "5bc9be8fd4351e00334cae6e", BARTER_6STEN140M_MILITARY_BATTERY = "5d03794386f77420415576f5", @@ -868,6 +896,7 @@ export declare enum ItemTpl { BARTER_FLEECE_FABRIC = "5e2af47786f7746d404f3aaa", BARTER_FP100_FILTER_ABSORBER = "5d1b2f3f86f774252167a52c", BARTER_FUEL_CONDITIONER = "5b43575a86f77424f443fe62", + BARTER_GARY_ZONT_PORTABLE_ELECTRONIC_WARFARE_DEVICE = "66d9f8744827a77e870ecaf1", BARTER_GAS_ANALYZER = "590a3efd86f77437d351a25b", BARTER_GAS_MASK_AIR_FILTER = "590c595c86f7747884343ad7", BARTER_GEIGERMULLER_COUNTER = "5672cb724bdc2dc2088b456b", @@ -884,25 +913,27 @@ export declare enum ItemTpl { BARTER_HAND_DRILL = "5d1b317c86f7742523398392", BARTER_HORSE_FIGURINE = "573478bc24597738002c6175", BARTER_HUNTING_MATCHES = "5e2af2bc86f7746d3f3c33fc", + BARTER_INSEQ_GAS_PIPE_WRENCH = "66b37f114410565a8f6789e2", BARTER_INSULATING_TAPE = "5734795124597738002c6176", BARTER_IRIDIUM_MILITARY_THERMAL_VISION_MODULE = "5d0377ce86f774186372f689", BARTER_KEKTAPE_DUCT_TAPE = "5e2af29386f7746d4159f077", BARTER_KILLA_FIGURINE = "66572c82ad599021091c6118", + BARTER_KOSA_UAV_ELECTRONIC_JAMMING_DEVICE = "66d9f7e7099cf6adcc07a369", BARTER_LEDX_SKIN_TRANSILLUMINATOR = "5c0530ee86f774697952d952", BARTER_LEGA_MEDAL = "6656560053eaaa7a23349c86", BARTER_LIGHT_BULB = "5d1b392c86f77425243e98fe", - BARTER_LOCKED_EQUIPMENT_RATE_COMMON = "66588b514de4820934746dc6", - BARTER_LOCKED_EQUIPMENT_RATE_EPIC = "6658285190486915542256c4", - BARTER_LOCKED_EQUIPMENT_RATE_RARE = "66571bf06a723f7f005a0619", - BARTER_LOCKED_SUPPLY_RATE_COMMON = "66588ba291f6e93c4c06efef", - BARTER_LOCKED_SUPPLY_RATE_EPIC = "665828c44de4820934746ce4", - BARTER_LOCKED_SUPPLY_RATE_RARE = "66572b88ac60f009f270d1dc", - BARTER_LOCKED_VALUABLES_RATE_COMMON = "66588bb047fbd536a674240e", - BARTER_LOCKED_VALUABLES_RATE_EPIC = "665828f490486915542256c6", - BARTER_LOCKED_VALUABLES_RATE_RARE = "66572bb3ac60f009f270d1df", - BARTER_LOCKED_WEAPON_RATE_COMMON = "66588b6dcb48a73e674b2649", - BARTER_LOCKED_WEAPON_RATE_EPIC = "66582889efd94e2d665b14a2", - BARTER_LOCKED_WEAPON_RATE_RARE = "66572b3f6a723f7f005a066c", + BARTER_LOCKED_EQUIPMENT_CRATE_COMMON = "66588b514de4820934746dc6", + BARTER_LOCKED_EQUIPMENT_CRATE_EPIC = "6658285190486915542256c4", + BARTER_LOCKED_EQUIPMENT_CRATE_RARE = "66571bf06a723f7f005a0619", + BARTER_LOCKED_SUPPLY_CRATE_COMMON = "66588ba291f6e93c4c06efef", + BARTER_LOCKED_SUPPLY_CRATE_EPIC = "665828c44de4820934746ce4", + BARTER_LOCKED_SUPPLY_CRATE_RARE = "66572b88ac60f009f270d1dc", + BARTER_LOCKED_VALUABLES_CRATE_COMMON = "66588bb047fbd536a674240e", + BARTER_LOCKED_VALUABLES_CRATE_EPIC = "665828f490486915542256c6", + BARTER_LOCKED_VALUABLES_CRATE_RARE = "66572bb3ac60f009f270d1df", + BARTER_LOCKED_WEAPON_CRATE_COMMON = "66588b6dcb48a73e674b2649", + BARTER_LOCKED_WEAPON_CRATE_EPIC = "66582889efd94e2d665b14a2", + BARTER_LOCKED_WEAPON_CRATE_RARE = "66572b3f6a723f7f005a066c", BARTER_LOOT_LORD_PLUSHIE = "60b0f7057897d47c5b04ab94", BARTER_LVNDMARKS_RAT_POISON = "60b0f561c4449e4cb624c1d7", BARTER_MAGNET = "590a391c86f774385a33c404", @@ -953,8 +984,9 @@ export declare enum ItemTpl { BARTER_PRINTED_CIRCUIT_BOARD = "590a3b0486f7743954552bdb", BARTER_PRINTER_PAPER = "577e1c9d2459773cd707c525", BARTER_PROPANE_TANK_5L = "59fafb5d86f774067a6f2084", + BARTER_RADAR_STATION_SPARE_PARTS = "66d9f7256916142b3b02276e", BARTER_RADIATOR_HELIX = "5d1c774f86f7746d6620f8db", - BARTER_RAM = "57347baf24597738002c6178", + BARTER_RAM_STICK = "57347baf24597738002c6178", BARTER_RATCHET_WRENCH = "60391afc25aff57af81f7085", BARTER_RAVEN_FIGURINE = "5e54f62086f774219b0f1937", BARTER_RECHARGEABLE_BATTERY = "590a358486f77429692b2790", @@ -979,6 +1011,7 @@ export declare enum ItemTpl { BARTER_STRIKE_CIGARETTES = "5734770f24597738025ee254", BARTER_SURVL_SURVIVOR_LIGHTER = "5e2af37686f774755a234b65", BARTER_TAGILLA_FIGURINE = "66572cbdad599021091c611a", + BARTER_TAMATTHI_KUNAI_KNIFE_REPLICA = "66b37ea4c5d72b0277488439", BARTER_TETRIZ_PORTABLE_GAME_CONSOLE = "5c12620d86f7743f8b198b72", BARTER_TOILET_PAPER = "5c13cef886f774072e618e82", BARTER_TOOLSET = "590c2e1186f77425357b6124", @@ -993,6 +1026,7 @@ export declare enum ItemTpl { BARTER_USEC_OPERATIVE_FIGURINE = "655c663a6689c676ce57af85", BARTER_UZRGM_GRENADE_FUZE = "5e2af51086f7746d3f3c3402", BARTER_VERITAS_GUITAR_PICK = "5f745ee30acaeb0d490d8c5b", + BARTER_VIIBIIN_SNEAKER = "66b37eb4acff495a29492407", BARTER_VIRTEX_PROGRAMMABLE_PROCESSOR = "5c05308086f7746b2101e90b", BARTER_VPX_FLASH_STORAGE_MODULE = "5c05300686f7746dce784e5d", BARTER_WATER_FILTER = "5d1b385e86f774252167b98a", @@ -1005,8 +1039,11 @@ export declare enum ItemTpl { BARTER_WRENCH = "590c311186f77424d1667482", BARTER_XENOMORPH_SEALING_FOAM = "590c346786f77423e50ed342", BARTER_ZIBBO_LIGHTER = "56742c2e4bdc2d95058b456d", + BIPOD_ALL_TEST = "665745c8a3c672c7b00bb355", + BIPOD_BT10_V8_ATLAS = "6644920d49817dc7d505ca71", BIPOD_HARRIS_HBR = "5888961624597754281f93f3", BIPOD_HK_G36 = "622b397c9a3d4327e41843b6", + BIPOD_M60 = "66012d9a3dff5074ed002e33", BIPOD_PK = "6464d870bb2c580352070cc4", BIPOD_RPD = "6513f037e06849f06c0957d7", BIPOD_SV98 = "56ea8222d2720b69698b4567", @@ -1058,8 +1095,8 @@ export declare enum ItemTpl { BUILTININSERTS_6B516_LEVEL2_SOFT_ARMOR_COLLAR = "65764c39526e320fbe035777", BUILTININSERTS_6B516_LEVEL3_SOFT_ARMOR_FRONT = "65764a4cd8537eb26a0355ee", BUILTININSERTS_6B516_LEVEL3_SOFT_ARMOR_GROIN = "65764c6b526e320fbe03577b", - BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL3_HELMET_ARMOR_NAPE = "657f9ef6c6679fefb3051e1f", - BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL3_HELMET_ARMOR_TOP = "657f9eb7e9433140ad0baf86", + BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_NAPE = "657f9ef6c6679fefb3051e1f", + BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_TOP = "657f9eb7e9433140ad0baf86", BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_EARS = "657bc107aab96fccee08be9f", BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_NAPE = "657bc0d8a1c61ee0c303632f", BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_TOP = "657bc06daab96fccee08be9b", @@ -1085,6 +1122,8 @@ export declare enum ItemTpl { BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_FRONT = "657322988c1cc6dcd9098b2d", BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "657322acd9d89ff7ac0d961b", BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "657322b7d9d89ff7ac0d961f", + BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_NAPE = "66b61ce0c5d72b027748867e", + BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_TOP = "66b61cfae98be930d701c029", BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_BACK = "6573102b292ecadbfa09b38d", BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_FRONT = "6573101e292ecadbfa09b389", BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "65731038292ecadbfa09b391", @@ -1264,11 +1303,16 @@ export declare enum ItemTpl { BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575d9c40546f8b1de093dee", BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6575da159e27f4a85e081131", BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575d9cf0546f8b1de093df2", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EARS = "65711b706d197c216005b31c", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EYES = "65711b9b65daf6aa960c9b1b", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_JAW = "65711bc79eb8c145180dbba1", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_NAPE = "65711b489eb8c145180dbb9d", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_TOP = "65711b07a330b8c9060f7b01", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EARS = "66bdc2c90b603c26902b2018", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EYES = "66bdc2d051aa8c345646d03f", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_JAW = "66bdc2d9408f1e66eb4fd957", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_NAPE = "66bdc2e25f17154509115d1e", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_TOP = "66bdc2ea8cbd597c9c2f9360", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_EARS = "65711b706d197c216005b31c", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_EYES = "65711b9b65daf6aa960c9b1b", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_JAW = "65711bc79eb8c145180dbba1", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_NAPE = "65711b489eb8c145180dbb9d", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_TOP = "65711b07a330b8c9060f7b01", BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_EARS = "657bc2e7b30eca976305118d", BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_NAPE = "657bc2c5a1c61ee0c3036333", BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_TOP = "657bc285aab96fccee08bea3", @@ -1283,6 +1327,15 @@ export declare enum ItemTpl { BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_EARS = "657119fea330b8c9060f7afc", BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_NAPE = "657119d49eb8c145180dbb95", BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_TOP = "6571199565daf6aa960c9b10", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_BACK = "66b884eaacff495a29492849", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_FRONT = "66b884f4c5d72b02774886eb", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "66b884fd7994640992013b37", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "66b8851678bbc0200425fa03", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "66b88521a7f72d197e70be3b", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_BACK = "66b8b20c5891c84aab75cb96", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_FRONT = "66b8b217c5d72b02774887b4", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "66b8b223a7f72d197e70bed3", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "66b8b22b78bbc0200425fb20", BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_BACK = "6572eb1b04ee6483ef039882", BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_FRONT = "6572eb0e55beba16bc04079f", BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "6572eb865b5eac12f10a03ee", @@ -1345,8 +1398,8 @@ export declare enum ItemTpl { CHARGE_AR15_GEISSELE_ACH_CHARGING_HANDLE_DDC = "5ea16d4d5aad6446a939753d", CHARGE_AR15_HK_EXTENDED_LATCH_CHARGING_HANDLE = "5bb20dbcd4351e44f824c04e", CHARGE_AR15_MASP_INDUSTRIES_AMBIDEXTROUS_BATTLE_CHARGING_HANDLE = "6033749e88382f4fab3fd2c5", - CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE = "5b2240bf5acfc40dc528af69", - CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_GREY = "5d44334ba4b9362b346d1948", + CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_FDE = "5b2240bf5acfc40dc528af69", + CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_TUNGSTEN_GREY = "5d44334ba4b9362b346d1948", CHARGE_AR15_RAINIER_ARMS_AVALANCHE_MOD2_CHARGING_HANDLE = "5f633ff5c444ce7e3c30a006", CHARGE_BENELLI_M3_SUPER_90_CHARGING_HANDLE = "625ec45bb14d7326ac20f572", CHARGE_FN_P90_CHARGING_HANDLE = "5cc6ea78e4a949000e1ea3c1", @@ -1355,8 +1408,8 @@ export declare enum ItemTpl { CHARGE_HK417_E1_EXTENDED_CHARGING_HANDLE = "61702d8a67085e45ef140b24", CHARGE_HK_MP5K_COCKING_HANDLE = "5d2f2d5748f03572ec0c0139", CHARGE_HK_MP5_COCKING_HANDLE = "5926c32286f774616e42de99", + CHARGE_MCXSPEAR_CHARGING_HANDLE = "6529109524cbe3c74a05e5b7", CHARGE_MCX_CHARGING_HANDLE = "5fbcc640016cce60e8341acc", - CHARGE_MCX_SPEAR_CHARGING_HANDLE = "6529109524cbe3c74a05e5b7", CHARGE_MK47_AMBIDEXTROUS_CHARGING_HANDLE = "606587bd6d0bd7580617bacc", CHARGE_MP9_CHARGING_HANDLE = "5de922d4b11454561e39239f", CHARGE_MPX_DOUBLE_LATCH_CHARGING_HANDLE = "58949edd86f77409483e16a9", @@ -1380,6 +1433,7 @@ export declare enum ItemTpl { COLLIMATOR_FN_P90_RING_SIGHT_REFLEX_SIGHT = "5cebec38d7f00c00110a652a", COLLIMATOR_HENSOLDT_RV_RED_DOT_SIGHT = "622efbcb99f4ea1a4d6c9a15", COLLIMATOR_HOLOSUN_HS401G5_REFLEX_SIGHT = "5b30b0dc5acfc400153b7124", + COLLIMATOR_KOMZ_RUSAK_REFLEX_SIGHT = "65f05b9d39dab9e9ec049cfd", COLLIMATOR_LEAPERS_UTG_REFLEX_SIGHT = "6165ac8c290d254f5e6b2f6c", COLLIMATOR_MILKOR_M2A1_GRENADE_LAUNCHER_REFLEX_SIGHT = "6284bd5f95250a29bc628a30", COLLIMATOR_NPZ_PK1_OBZOR_DOVETAIL_REFLEX_SIGHT = "618a5d5852ecee1505530b2a", @@ -1421,6 +1475,7 @@ export declare enum ItemTpl { CONTAINER_MR_HOLODILNICK_THERMAL_BAG = "5c093db286f7740a1b2617e3", CONTAINER_SICC = "5d235bb686f77443f4331278", CONTAINER_SIMPLE_WALLET = "5783c43d2459774bbe137486", + CONTAINER_STREAMER_ITEM_CASE = "66bc98a01a47be227a5e956e", CONTAINER_THICC_ITEM_CASE = "5c0a840b86f7742ffa4f2482", CONTAINER_THICC_WEAPON_CASE = "5b6d9ce188a4501afc1b2b25", CONTAINER_WEAPON_CASE = "59fb023c86f7746d0d4b423c", @@ -1429,7 +1484,7 @@ export declare enum ItemTpl { DRINK_AQUAMARI_WATER_BOTTLE_WITH_FILTER = "5c0fa877d174af02a012e1cf", DRINK_BOTTLE_OF_DAN_JACKIEL_WHISKEY = "5d403f9186f7743cac3f229b", DRINK_BOTTLE_OF_FIERCE_HATCHLING_MOONSHINE = "5d1b376e86f774252519444e", - DRINK_BOTTLE_OF_NORVINSKIY_YADRENIY_PREMIUM_KVASS_06L = "5e8f3423fd7471236e6e3b64", + DRINK_BOTTLE_OF_NORVINSKY_YADRENIY_PREMIUM_KVASS_06L = "5e8f3423fd7471236e6e3b64", DRINK_BOTTLE_OF_PEVKO_LIGHT_BEER = "62a09f32621468534a797acb", DRINK_BOTTLE_OF_TARKOVSKAYA_VODKA = "5d40407c86f774318526545a", DRINK_BOTTLE_OF_TARKOVSKAYA_VODKA_BAD = "614451b71e5874611e2c7ae5", @@ -1495,26 +1550,28 @@ export declare enum ItemTpl { FACECOVER_VENGEFUL_ZRYACHIYS_BALACLAVA = "6530e8587cbfc1e309011e37", FACECOVER_ZRYACHIYS_BALACLAVA = "63626d904aa74b8fe30ab426", FLARE_ROP30_REACTIVE_FLARE_CARTRIDGE_WHITE = "62178be9d0050232da3485d9", + FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_BLUE = "66d98233302686954b0c6f81", FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_GREEN = "6217726288ed9f0845317459", FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_RED = "62178c4d4ecf221597654e3d", + FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_SPECIAL_YELLOW = "66d9f1abb16d9aacf5068468", FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_YELLOW = "624c0b3340357b5f566e8766", FLASHHIDER_AAC_SCARSD_51T_762X51_FLASH_HIDER = "618178aa1cb55961fa0fdc80", FLASHHIDER_AI_338_LM_TACTICAL_MUZZLE_BRAKE = "62812081d23f207deb0ab216", FLASHHIDER_AK101_556X45_MUZZLE_BRAKECOMPENSATOR = "5ac72e615acfc43f67248aa0", - FLASHHIDER_AK102_556X45_MUZZLE_BRAKECOMPENSATOR_6P44_020 = "5ac72e725acfc400180ae701", + FLASHHIDER_AK102_556X45_MUZZLE_BRAKECOMPENSATOR = "5ac72e725acfc400180ae701", FLASHHIDER_AK103_762X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e7d5acfc40016339a02", - FLASHHIDER_AK104_762X39_MUZZLE_BRAKECOMPENSATOR_6P46_020 = "5ac72e895acfc43b321d4bd5", - FLASHHIDER_AK105_545X39_MUZZLE_BRAKECOMPENSATOR_6P44_020 = "5ac72e945acfc43f3b691116", + FLASHHIDER_AK104_762X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e895acfc43b321d4bd5", + FLASHHIDER_AK105_545X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e945acfc43f3b691116", FLASHHIDER_AK12_545X39_MUZZLE_BRAKE = "649ec2af961514b22506b10f", - FLASHHIDER_AK74M_545X39_MUZZLE_BRAKECOMPENSATOR_6P20_020 = "5ac7655e5acfc40016339a19", - FLASHHIDER_AK74_545X39_MUZZLE_BRAKECOMPENSATOR_6P20_020 = "5649aa744bdc2ded0b8b457e", + FLASHHIDER_AK74M_545X39_MUZZLE_BRAKECOMPENSATOR = "5ac7655e5acfc40016339a19", + FLASHHIDER_AK74_545X39_MUZZLE_BRAKECOMPENSATOR = "5649aa744bdc2ded0b8b457e", FLASHHIDER_AK74_PWS_CQB_74_545X39_MUZZLE_BRAKE = "5943eeeb86f77412d6384f6b", FLASHHIDER_AK74_SRVV_MBR_JET_545X39_MUZZLE_BRAKE = "5cc9a96cd7f00c011c04e04a", FLASHHIDER_AK74_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_MULTICALIBER_MUZZLE_BRAKE = "5f633f791b231926f2329f13", FLASHHIDER_AKML_SYSTEM_762X39_FLASH_HIDER = "5a0d716f1526d8000d26b1e2", FLASHHIDER_AKM_762X39_MUZZLE_BRAKECOMPENSATOR_6P1_014 = "59d64fc686f774171b243fe2", FLASHHIDER_AKM_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_762X39_MUZZLE_BRAKE = "5f633f68f5750b524b45f112", - FLASHHIDER_AKS74U_545X39_MUZZLE_BRAKE_6P26_020 = "57dc324a24597759501edc20", + FLASHHIDER_AKS74U_545X39_MUZZLE_BRAKE = "57dc324a24597759501edc20", FLASHHIDER_AK_HEXAGON_REACTOR_545X39_MUZZLE_BRAKE = "615d8f5dd92c473c770212ef", FLASHHIDER_AK_LANTAC_DRAKON_762X39_MUZZLE_BRAKE = "5c878ebb2e2216001219d48a", FLASHHIDER_AK_SPIKES_TACTICAL_DYNACOMP_762X39_MUZZLE_BRAKECOMPENSATOR = "5a9ea27ca2750c00137fa672", @@ -1527,6 +1584,7 @@ export declare enum ItemTpl { FLASHHIDER_AR10_CMMG_SV_BRAKE_762X51_MUZZLE_BRAKE = "6065c6e7132d4d12c81fd8e1", FLASHHIDER_AR10_DANIEL_DEFENSE_WAVE_762X51_MUZZLE_BRAKE = "5d1f819086f7744b355c219b", FLASHHIDER_AR10_DEAD_AIR_KEYMOUNT_762X51_MUZZLE_BRAKE = "628a66b41d5e41750e314f34", + FLASHHIDER_AR10_DELTATEK_DTKAR10_762X51_MUZZLE_BRAKE = "6642f63667f5cb56a00662eb", FLASHHIDER_AR10_FORTIS_RED_BRAKE_762X51_MUZZLE_BRAKE = "5d026791d7ad1a04a067ea63", FLASHHIDER_AR10_KAC_QDC_762X51_FLASH_SUPPRESSOR_KIT = "5dfa3cd1b33c0951220c079b", FLASHHIDER_AR10_KAC_QDC_762X51_MUZZLE_BRAKE_KIT = "6130c43c67085e45ef1405a1", @@ -1547,6 +1605,8 @@ export declare enum ItemTpl { FLASHHIDER_AR15_BULLETEC_ST6012_556X45_MUZZLE_BRAKE = "5cf6937cd7f00c056c53fb39", FLASHHIDER_AR15_COLT_USGI_A2_556X45_FLASH_HIDER = "544a38634bdc2d58388b4568", FLASHHIDER_AR15_DANIEL_DEFENSE_WAVE_556X45_MUZZLE_BRAKE = "5cff9e5ed7ad1a09407397d4", + FLASHHIDER_AR15_DELTATEK_DTKM16_556X45_MUZZLE_BRAKE = "664301213dd83ddae20dda18", + FLASHHIDER_AR15_DOUBLESTAR_CARLSON_TAC_COMP_556X45_COMPENSATOR = "6621455e3aceea9e2b0b01e7", FLASHHIDER_AR15_FERFRANS_CQB_556X45_MUZZLE_BRAKE = "5f6372e2865db925d54f3869", FLASHHIDER_AR15_GRIFFIN_ARMAMENT_GATELOK_HAMMER_556X45_FLASH_HIDER = "6386120cd6baa055ad1e201c", FLASHHIDER_AR15_HK_BLITZ_556X45_FLASH_HIDER = "615d8e2f1cb55961fa0fd9a4", @@ -1601,7 +1661,9 @@ export declare enum ItemTpl { FLASHHIDER_M1A_NATIONAL_MATCH_762X51_FLASH_SUPPRESSOR = "5addbb6e5acfc408fb1393fd", FLASHHIDER_M1A_SMITH_ENTERPRISE_SOCOM_16_762X51_THREADED_MUZZLE_BRAKE_GAS_BLOCK = "5ab3afb2d8ce87001660304d", FLASHHIDER_M1A_SOCOM_16_762X51_MUZZLE_BRAKECOMPENSATOR = "5aafa1c2e5b5b00015042a56", - FLASHHIDER_MCX_SPEAR_CLUTCHLOK_QD_68X51_SHOULDERED_FLASH_HIDER = "6529113b5ae2ae97b80fdf39", + FLASHHIDER_M60E3_762X51_FLASH_HIDER = "6601281fc752a02bbe05e696", + FLASHHIDER_M60E6_762X51_FLASH_HIDER = "66012a1d3dff5074ed002e2a", + FLASHHIDER_MCXSPEAR_CLUTCHLOK_QD_68X51_SHOULDERED_FLASH_HIDER = "6529113b5ae2ae97b80fdf39", FLASHHIDER_MOSIN_RIFLE_TACFIRE_TANKER_STYLE_762X54R_MUZZLE_BRAKE = "5bbdb83fd4351e44f824c44b", FLASHHIDER_MOSIN_RIFLE_TEXAS_PRECISION_PRODUCTS_762X54R_MUZZLE_BRAKE = "5bc5a351d4351e003477a414", FLASHHIDER_MOSIN_RIFLE_WITT_MACHINE_762X54R_MUZZLE_BRAKE = "5bc5a35cd4351e450201232f", @@ -1630,8 +1692,9 @@ export declare enum ItemTpl { FLASHHIDER_SV98_SRVV_MK20_762X54R_MUZZLE_BRAKECOMPENSATOR = "5c4ee3d62e2216152006f302", FLASHHIDER_SVDS_762X54R_MUZZLE_BRAKECOMPENSATOR = "5c471bfc2e221602b21d4e17", FLASHHIDER_SVT40_762X54R_MUZZLE_BRAKE = "64119d1f2c6d6f921a0929f8", - FLASHHIDER_TACCOM_CARBINE_BRAKE_MULTICALIBER_MUZZLE_BRAKE = "5cf6935bd7f00c06585fb791", + FLASHHIDER_TACCOM_CARBINE_BRAKE_9X19_MUZZLE_BRAKE = "5cf6935bd7f00c06585fb791", FLASHHIDER_TT_PMLASER_DTKTT_MUZZLE_BRAKECOMPENSATOR = "5bffd7ed0db834001d23ebf9", + FLASHHIDER_UZI_VENTED_BARREL_SHROUD = "6699370c57df3e2b4e0a0dab", FLASHHIDER_VPO136_VEPRKM_762X39_MUZZLE_BRAKECOMPENSATOR = "59e61eb386f77440d64f5daf", FLASHHIDER_VPO209_THREAD_PROTECTOR = "59e8a00d86f7742ad93b569c", FLASHHIDER_YANKEE_HILL_ANNIHILATOR_MULTICALIBER_FLASH_HIDER = "5b3a16655acfc40016387a2a", @@ -1663,6 +1726,8 @@ export declare enum ItemTpl { FOREGRIP_A3_TACTICAL_MVF001_KEYMOD_VERTICAL_FOREGRIP_BLACK = "5fc0f9b5d724d907e2077d82", FOREGRIP_AI_AXMC_PADDED_HANDGUARD_GRIP = "6281212a09427b40ab14e770", FOREGRIP_ASH12_VERTICAL = "5cda9bcfd7f00c0c0b53e900", + FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_BLACK = "665d5d9e338229cfd6078da1", + FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_FDE = "665edce564fb556f940ab32a", FOREGRIP_BCM_GUNFIGHTER_MOD_3_VERTICAL = "5c7fc87d2e221644f31c0298", FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_BLACK = "651a8bf3a8520e48047bf708", FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_COYOTE_BROWN = "651a8e529829226ceb67c319", @@ -1689,15 +1754,21 @@ export declare enum ItemTpl { FOREGRIP_RTM_PILLAU_TACTICAL = "5cf4fb76d7f00c065703d3ac", FOREGRIP_RTM_PILLAU_TACTICAL_FOREGRIP_SAND = "648067db042be0705c0b3009", FOREGRIP_SIG_SAUER_VERTICAL_FOREGRIP_KEYMOD_BLACK = "5fc0f9cbd6fa9c00c571bb90", + FOREGRIP_SR3M_POLYMER_FOREGRIP_BLACK = "65329ebcc0d50d0c9204ace1", + FOREGRIP_SR3M_POLYMER_FOREGRIP_PLUM = "6565c0c2ff7eb7070409084c", FOREGRIP_STARK_SE5_EXPRESS_FORWARD = "5b057b4f5acfc4771e1bd3e9", FOREGRIP_STARK_SE5_EXPRESS_FORWARD_FOREGRIP_FDE = "655df24fdf80b12750626d0a", FOREGRIP_STEYR_AUG_VERTICAL = "634e61b0767cb15c4601a877", FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL = "5c791e872e2216001219c40a", FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL_FOREGRIP_FDE = "655dccfdbdcc6b5df71382b6", FOREGRIP_TACTICAL_DYNAMICS_SKELETONIZED = "5f6340d3ca442212f4047eb2", + FOREGRIP_TANGODOWN_BGVQDITI_FOREGRIP_BLACK = "661e52e29c8b4dadef008577", + FOREGRIP_TANGODOWN_BGVQDITI_FOREGRIP_FDE = "661e53149c8b4dadef008579", FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_BLACK = "558032614bdc2de7118b4585", FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_FDE = "58c157be86f77403c74b2bb6", FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_STEALTH_GREY = "58c157c886f774032749fb06", + FOREGRIP_TANGODOWN_STUBBY_BGVQDK_FOREGRIP_BLACK = "661e52415be02310ed07a07a", + FOREGRIP_TANGODOWN_STUBBY_BGVQDK_FOREGRIP_FDE = "661e52b5b099f32c28003586", FOREGRIP_VIKING_TACTICS_UVG_TACTICAL = "591af28e86f77414a27a9e1d", FOREGRIP_ZENIT_RK0_TACTICAL = "5c1bc4812e22164bef5cfde7", FOREGRIP_ZENIT_RK1_TACTICAL = "5c1bc5612e221602b5429350", @@ -1707,10 +1778,10 @@ export declare enum ItemTpl { FOREGRIP_ZENIT_RK5_TACTICAL = "5c1bc7432e221602b412949d", FOREGRIP_ZENIT_RK6_TACTICAL = "5c1bc7752e221602b1779b34", GASBLOCK_AK12_GAS_TUBE = "649ec107961514b22506b10c", - GASBLOCK_AK545_SAG_MK_21_GAS_TUBE = "628b8d83717774443b15e248", - GASBLOCK_AK74_GAS_TUBE_6P20_SB12 = "59c6633186f7740cf0493bb9", - GASBLOCK_AKM_GAS_TUBE_6P1_SB12 = "59d64ec286f774171d1e0a42", - GASBLOCK_AKS74U_GAS_TUBE_6P26_SB12 = "59d36a0086f7747e673f3946", + GASBLOCK_AK545_MK_21_GAS_TUBE = "628b8d83717774443b15e248", + GASBLOCK_AK74_GAS_TUBE = "59c6633186f7740cf0493bb9", + GASBLOCK_AKM_GAS_TUBE = "59d64ec286f774171d1e0a42", + GASBLOCK_AKS74U_GAS_TUBE = "59d36a0086f7747e673f3946", GASBLOCK_AK_KIBA_ARMS_VDM_CS_GAS_TUBE = "5a01ad4786f77450561fda02", GASBLOCK_AK_TROY_FULL_LENGTH_RAIL_HANDGUARD_GAS_TUBE_COMBO = "5b237e425acfc4771e1be0b6", GASBLOCK_AK_ULTIMAK_M1B_GAS_TUBE_HANDGUARD = "59ccfdba86f7747f2109a587", @@ -1727,8 +1798,8 @@ export declare enum ItemTpl { GASBLOCK_HK_416A5_LOW_PROFILE_GAS_BLOCK = "5bb20dcad4351e3bac1212da", GASBLOCK_HK_G36_GAS_BLOCK = "622b327b267a1b13a44abea3", GASBLOCK_M4A1_FRONT_SIGHT_WITH_GAS_BLOCK = "5ae30e795acfc408fb139a0b", + GASBLOCK_MCXSPEAR_ADJUSTABLE_GAS_PISTON = "652910bc24cbe3c74a05e5b9", GASBLOCK_MCX_GAS_BLOCK = "5fbc210bf24b94483f726481", - GASBLOCK_MCX_SPEAR_ADJUSTABLE_GAS_PISTON = "652910bc24cbe3c74a05e5b9", GASBLOCK_MK18_GAS_BLOCK = "5fc2360f900b1d5091531e19", GASBLOCK_MOLOT_ARMS_AKMTYPE_GAS_TUBE = "59e649f986f77411d949b246", GASBLOCK_OPSKS_GAS_TUBE = "634f036a517ccc8a960fc746", @@ -1736,7 +1807,7 @@ export declare enum ItemTpl { GASBLOCK_RD704_SLR_ION_LITE_RAILED_GAS_TUBE_HANDGUARD_GAS_TUBE_COMBO = "628a83c29179c324ed269508", GASBLOCK_SKS_GAS_TUBE = "634f02d7517ccc8a960fc744", GASBLOCK_SVDS_GAS_TUBE = "5c471c842e221615214259b5", - GASBLOCK_VPO101_VEPRHUNTER_GAS_TUBE = "5c5039be2e221602b177c9ff", + GASBLOCK_VPO101_GAS_TUBE = "5c5039be2e221602b177c9ff", GRENADELAUNCHER_FN40GL_01 = "5e81ebcd8e146c7080625e15", GRENADELAUNCHER_FN40GL_02 = "639c3fbbd0446708ee622ee9", GRENADELAUNCHER_FN40GL_03 = "639af924d0446708ee62294e", @@ -1754,11 +1825,11 @@ export declare enum ItemTpl { HANDGUARD_9A91 = "644675573d52156624001fc9", HANDGUARD_AI_AXMC_AX_KEYSLOT_16_INCH = "6281209662cba23f6c4d7a19", HANDGUARD_AK12 = "649ec127c93611967b034957", - HANDGUARD_AK545_SAG_MK3 = "628b916469015a4e1711ed8d", - HANDGUARD_AK74_PLUM_POLYMER_HANDGUARD_6P20_SB9 = "5cbda9f4ae9215000e5b9bfc", - HANDGUARD_AK74_POLYMER_HANDGUARD_6P20_SB9 = "5648b1504bdc2d9d488b4584", - HANDGUARD_AK74_WOODEN_HANDGUARD_6P20_SB6 = "5648b0744bdc2d363b8b4578", - HANDGUARD_AKM_WOODEN_HANDGUARD_6P1_SB61 = "59d64f2f86f77417193ef8b3", + HANDGUARD_AK545_MK3 = "628b916469015a4e1711ed8d", + HANDGUARD_AK74M_POLYMER = "5648b1504bdc2d9d488b4584", + HANDGUARD_AK74_POLYMER_HANDGUARD_PLUM = "5cbda9f4ae9215000e5b9bfc", + HANDGUARD_AK74_WOODEN = "5648b0744bdc2d363b8b4578", + HANDGUARD_AKM_WOODEN = "59d64f2f86f77417193ef8b3", HANDGUARD_AKS74U_ALFA_ARMS_GOLIAF = "5d15ce51d7ad1a1eff619092", HANDGUARD_AKS74U_ALFA_ARMS_GOLIAF_MLOK = "647db1eca8d3399c380d195c", HANDGUARD_AKS74U_CAA_XRSU47SU_TACTICAL = "5a957c3fa2750c00137fa5f7", @@ -1862,13 +1933,16 @@ export declare enum ItemTpl { HANDGUARD_HK_MP5_PTR_TRIRAIL = "5d19cd96d7ad1a4a992c9f52", HANDGUARD_HK_MP5_WIDE_TROPICAL_POLYMER = "5926c36d86f77467a92a8629", HANDGUARD_KS23M_FORESTOCK = "5e848d51e4dbc5266a4ec63b", + HANDGUARD_M60E4_MOD_1 = "66012d64c752a02bbe05e69b", + HANDGUARD_M60E4_MOD_1_HANDGUARD_FDE = "661fbe066751ee51930b01f2", + HANDGUARD_M60E6 = "66012d003dff5074ed002e2c", HANDGUARD_M700_AB_ARMS_MODX_GEN_3_KEYMOD = "5cde7afdd7f00c000d36b89d", HANDGUARD_M870_FAB_DEFENSE_PR870_FORESTOCK = "5a788031c585673f2b5c1c79", HANDGUARD_M870_MAGPUL_MOE = "5a788068c5856700137e4c8f", HANDGUARD_M870_SPEEDFEED_SHORT = "5a788089c5856700142fdd9c", + HANDGUARD_MCXSPEAR_11_INCH_MLOK = "652910ef50dc782999054b97", HANDGUARD_MCX_GEN1_KEYMOD_12_INCH = "5fbc227aa56d053a3543f79e", HANDGUARD_MCX_GEN1_KEYMOD_8_INCH = "5fbc226eca32ed67276c155d", - HANDGUARD_MCX_SPEAR_11_INCH_MLOK = "652910ef50dc782999054b97", HANDGUARD_MDR_HANDGUARD_BLACK = "5dcbd6b46ec07c0c4347a564", HANDGUARD_MDR_HANDGUARD_FDE = "5c48a14f2e2216152006edd7", HANDGUARD_MK18_18_INCH = "5fc235db2770a0045c59c683", @@ -1912,24 +1986,38 @@ export declare enum ItemTpl { HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_LONG_TOP_ALUMINUM = "5827272a24597748c74bdeea", HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_SHORT_TOP_ALUMINUM = "58272b392459774b4c7b3ccd", HANDGUARD_SOK12_POLYMER_HANDGUARD_SB71 = "576169e62459773c69055191", - HANDGUARD_SR2M_POLYMER = "62e15547db1a5c41971c1b5e", HANDGUARD_SR2M_POLYMER_HANDGUARD_BLACK = "637ba19df7ca6372bf2613d7", + HANDGUARD_SR2M_POLYMER_HANDGUARD_PLUM = "62e15547db1a5c41971c1b5e", + HANDGUARD_SR3M_POLYMER_HANDGUARD_BLACK = "65144f546ddb773afa0e35e1", + HANDGUARD_SR3M_POLYMER_HANDGUARD_PLUM = "6565c3ab977bcc2dbb01c2e7", + HANDGUARD_SR3M_RAILED_POLYMER_HANDGUARD_BLACK = "6568a6bf2c5fb7afc70bc424", HANDGUARD_SV98_CNC_GUNS_OVSV98_KEYMOD = "623c3c1f37b4b31470357737", HANDGUARD_SVDS_POLYMER = "5c471c6c2e221602b66cd9ae", HANDGUARD_SVD_CAA_XRSDRG = "5e5699df2161e06ac158df6f", HANDGUARD_SVD_MODERNIZATION_KIT = "5e56991336989c75ab4f03f6", HANDGUARD_SVD_SAG_MK1_CHASSIS = "5dfcd0e547101c39625f66f9", + HANDGUARD_UZI_HANDGUARD_WITH_FOREGRIP = "66993149558c59581e03c028", + HANDGUARD_UZI_KGRIP = "6699313af74fef4dfd0b04f6", + HANDGUARD_UZI_POLYMER = "6698c8c736ba38d29101770b", + HANDGUARD_UZI_PRO_A3_TACTICAL_MLOK = "668031bde3e7eb26e8004cd7", HANDGUARD_VPO136_VEPRKM_WOODEN = "59e6284f86f77440d569536f", HANDGUARD_VPO209_WOODEN = "59e898ee86f77427614bd225", HANDGUARD_VSK94 = "6448f2f6d4928d46d30be3f6", + HANDGUARD_VSSVAL_POLYMER_HANDGUARD_BLACK = "6565bb7eb4b12a56eb04b084", + HANDGUARD_VSSVAL_POLYMER_HANDGUARD_PLUM = "651178336cad06c37c049eb4", HANDGUARD_WASR1063_CAF_WOODEN_FOREGRIP = "5d2c829448f0353a5c7d6674", HEADPHONES_GSSH01_ACTIVE_HEADSET = "5b432b965acfc47a8774094e", HEADPHONES_MSA_SORDIN_SUPREME_PROXL_HEADSET = "5aa2ba71e5b5b000137b758f", HEADPHONES_OPSCORE_FAST_RAC_HEADSET = "5a16b9fffcdbcb0176308b34", HEADPHONES_OPSMEN_EARMOR_M32_HEADSET = "6033fa48ffd42c541047f728", - HEADPHONES_PELTOR_COMTAC_2_HEADSET_OD_GREEN = "5645bcc04bdc2d363b8b4572", - HEADPHONES_PELTOR_COMTAC_4_HYBRID_HEADSET_COYOTE_BROWN = "628e4e576d783146b124c64d", + HEADPHONES_PELTOR_COMTAC_II_HEADSET_OD_GREEN = "5645bcc04bdc2d363b8b4572", + HEADPHONES_PELTOR_COMTAC_IV_HYBRID_HEADSET_COYOTE_BROWN = "628e4e576d783146b124c64d", + HEADPHONES_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = "66b5f6985891c84aab75ca76", + HEADPHONES_PELTOR_COMTAC_V_HEADSET_OD_GREEN = "66b5f693acff495a294927e3", HEADPHONES_PELTOR_TACTICAL_SPORT_HEADSET = "5c165d832e2216398b5a7e36", + HEADPHONES_SAFARILAND_LIBERATOR_HP_20_HEARING_PROTECTION_HEADSET_FDE = "66b5f68de98be930d701c00e", + HEADPHONES_TW_EXFIL_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = "66b5f6a28ca68c6461709ed8", + HEADPHONES_TW_EXFIL_PELTOR_COMTAC_V_HEADSET_OD_GREEN = "66b5f69ea7f72d197e70bcdb", HEADPHONES_WALKERS_RAZOR_DIGITAL_HEADSET = "5e4d34ca86f774264f758330", HEADPHONES_WALKERS_XCEL_500BT_DIGITAL_HEADSET = "5f60cd6cf2bcbb675b00dac6", HEADWEAR_6B47_RATNIKBSH_HELMET_DIGITAL_FLORA_COVER = "5aa7cfc0e5b5b00015693143", @@ -1943,6 +2031,9 @@ export declare enum ItemTpl { HEADWEAR_ARMY_CAP_DESERT = "60361b0b5a45383c122086a1", HEADWEAR_ARMY_CAP_FLORA = "60361a7497633951dc245eb4", HEADWEAR_ARMY_CAP_UCP = "60361b5a9a15b10d96792291", + HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_ARMOR_BLACK = "66b5f65ca7f72d197e70bcd6", + HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_MULTICAM = "66b5f666cad6f002ab7214c2", + HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_OD_GREEN = "66b5f661af44ca0014063c05", HEADWEAR_BANDANA = "5b43271c5acfc432ff4dce65", HEADWEAR_BASEBALL_CAP = "572b7d8524597762b472f9d1", HEADWEAR_BASMACH_LEATHER_CAP = "65749ccf33fdc9c0cf06d3ca", @@ -1958,7 +2049,8 @@ export declare enum ItemTpl { HEADWEAR_BOSS_CAP = "60a7acf20c5cb24b01346648", HEADWEAR_CRYE_PRECISION_AIRFRAME_HELMET_TAN = "5c17a7ed2e2216152142459c", HEADWEAR_DED_MOROZ_HAT = "5a43943586f77416ad2f06e2", - HEADWEAR_DEVTAC_RONIN_BALLISTIC_HELMET = "5b4329f05acfc47a86086aa1", + HEADWEAR_DEVTAC_RONIN_BALLISTIC_HELMET = "66bdc28a0b603c26902b2011", + HEADWEAR_DEVTAC_RONIN_RESPIRATOR = "5b4329f05acfc47a86086aa1", HEADWEAR_DIAMOND_AGE_BASTION_HELMET_BLACK = "5ea17ca01412a1425304d1c0", HEADWEAR_DIAMOND_AGE_NEOSTEEL_HIGH_CUT_HELMET_BLACK = "65709d2d21b9f815e208ff95", HEADWEAR_DOOR_KICKER_BOONIE_HAT = "5d96141523f0ea1b7f2aacab", @@ -2015,6 +2107,10 @@ export declare enum ItemTpl { HEADWEAR_ZRYACHIYS_BALACLAVA_FOLDED = "636270263f2495c26f00b007", HEADWEAR_ZSH12M_HELMET_BLACK_COVER = "5aa7e4a4e5b5b000137b76f2", HEADWEAR_ZSH12M_HELMET_OLIVE_DRAB = "5aa7e454e5b5b0214e506fa2", + HIDEOUTAREACONTAINER_CIRCLEOFCULTISTS_STASH_1 = "66740c3739b9da6ce402ee65", + HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_1 = "65e5957613227bb7690ce9f6", + HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_2 = "65e597266017f07a3204b775", + HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_3 = "65e5972a13227bb7690cea07", HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_1 = "63dbd45917fff4dee40fe16e", HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_2 = "65424185a57eea37ed6562e9", HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_3 = "6542435ea57eea37ed6562f0", @@ -2041,16 +2137,16 @@ export declare enum ItemTpl { INFO_TOPOGRAPHIC_SURVEY_MAPS = "62a0a124de7ac81993580542", INFO_VIDEO_CASSETTE_WITH_THE_CYBORG_KILLER_MOVIE = "62a09e974f842e1bd12da3f0", INVENTORY_DEFAULT = "55d7217a4bdc2d86028b456d", - IRONSIGHT_AK105_REAR_SIGHT_6P44_SB130 = "5ac733a45acfc400192630e2", + IRONSIGHT_AK105_REAR_SIGHT = "5ac733a45acfc400192630e2", IRONSIGHT_AK12_REAR_SIGHT = "649ec2cec93611967b03495e", - IRONSIGHT_AK12_REAR_SIGHT_BASE = "649ec2da59cbb3c813042dca", - IRONSIGHT_AK545_SAG_REAR_SIGHT = "628b9471078f94059a4b9bfb", - IRONSIGHT_AK74M_REAR_SIGHT_6P20_SB2 = "5ac72e475acfc400180ae6fe", - IRONSIGHT_AK74_REAR_SIGHT_6P20_SB2 = "5649b0544bdc2d1b2b8b458a", + IRONSIGHT_AK12_REAR_SIGHT_MOUNT = "649ec2da59cbb3c813042dca", + IRONSIGHT_AK545_REAR_SIGHT = "628b9471078f94059a4b9bfb", + IRONSIGHT_AK74M_REAR_SIGHT = "5ac72e475acfc400180ae6fe", + IRONSIGHT_AK74_REAR_SIGHT = "5649b0544bdc2d1b2b8b458a", IRONSIGHT_AKMB_SYSTEM_REAR_SIGHT = "5a0eb980fcdbcb001a3b00a6", IRONSIGHT_AKMP_SYSTEM_FRONT_SIGHT_DEVICE = "5a0f096dfcdbcb0176308b15", IRONSIGHT_AKMP_SYSTEM_REAR_SIGHT_DEVICE = "5a0ed824fcdbcb0176308b0d", - IRONSIGHT_AKM_REAR_SIGHT_6P1_SB21 = "59d650cf86f7741b846413a4", + IRONSIGHT_AKM_REAR_SIGHT = "59d650cf86f7741b846413a4", IRONSIGHT_AK_RD_ENHANCED_V2_REAR_SIGHT = "628a7b23b0f75035732dd565", IRONSIGHT_AK_TAKTIKA_TULA_TT01_REAR_SIGHT_RAIL = "5649d9a14bdc2d79388b4580", IRONSIGHT_APB_REAR_SIGHT = "5aba639ed8ce8700182ece67", @@ -2067,6 +2163,8 @@ export declare enum ItemTpl { IRONSIGHT_CHIAPPA_RHINO_REAR_SIGHT = "619f4cee4c58466fe1228435", IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_FRONT_SIGHT = "619f52454c58466fe122843b", IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_REAR_SIGHT = "619f4f8c4c58466fe1228439", + IRONSIGHT_DESERT_EAGLE_FRONT_SIGHT = "668fe5ec4315934ba10c6f96", + IRONSIGHT_DESERT_EAGLE_REAR_SIGHT = "668fe5e1800f0244f9036e46", IRONSIGHT_FN_FIVESEVEN_MK2_FRONT_SIGHT = "5d3eb536a4b9363b1f22f8e2", IRONSIGHT_FN_FIVESEVEN_MK2_REAR_SIGHT = "5d3eb4aba4b93650d64e497d", IRONSIGHT_FN_SCAR_FLIPUP_FRONT_SIGHT = "61816fcad92c473c770215cc", @@ -2105,6 +2203,9 @@ export declare enum ItemTpl { IRONSIGHT_M1A_SA_XS_POST_125_BLADE_FRONT_SIGHT = "5aafa49ae5b5b00015042a58", IRONSIGHT_M45A1_NOVAK_LOMOUNT_FRONT_SIGHT = "5f3e78a7fbf956000b716b8e", IRONSIGHT_M45A1_NOVAK_LOMOUNT_REAR_SIGHT = "5f3e7897ddc4f03b010e204a", + IRONSIGHT_M60E4_FRONT_SIGHT = "6601268bc752a02bbe05e686", + IRONSIGHT_M60E6_FRONT_SIGHT_RAIL = "660126a98f2b23af220b27e7", + IRONSIGHT_M60_REAR_SIGHT = "6601265f98a610c1aa0ea637", IRONSIGHT_M9A3_FRONT_SIGHT = "5cadd919ae921500126a77f3", IRONSIGHT_M9A3_REAR_SIGHT = "5cadd940ae9215051e1c2316", IRONSIGHT_M9A3_SIGHT_MOUNT_REAR_SIGHT_RAIL = "5cadd954ae921500103bb3c2", @@ -2147,7 +2248,7 @@ export declare enum ItemTpl { IRONSIGHT_SVT40_FRONT_SIGHT = "64119d672c6d6f921a0929fb", IRONSIGHT_SVT40_REAR_SIGHT = "64119d90dcf48d656f0aa275", IRONSIGHT_TRIJICON_ACOG_BACKUP_REAR_SIGHT = "5c05295e0db834001a66acbb", - IRONSIGHT_VPO101_VEPRHUNTER_REAR_SIGHT = "5c503b1c2e221602b21d6e9d", + IRONSIGHT_VPO101_REAR_SIGHT = "5c503b1c2e221602b21d6e9d", IRONSIGHT_VPO209_REAR_SIGHT = "59e8977386f77415a553c453", IRONSIGHT_VSS_REAR_SIGHT = "57838e1b2459774a256959b1", KEYCARD_OBJECT_11SR = "5e42c81886f7742a01529f57", @@ -2159,6 +2260,7 @@ export declare enum ItemTpl { KEYCARD_TERRAGROUP_LABS_KEYCARD_RED = "5c1d0efb86f7744baf2e7b7b", KEYCARD_TERRAGROUP_LABS_KEYCARD_VIOLET = "5c1e495a86f7743109743dfb", KEYCARD_TERRAGROUP_LABS_KEYCARD_YELLOW = "5c1d0d6d86f7744bb2683e1f", + KEYCARD_TERRAGROUP_STORAGE_ROOM = "66acd6702b17692df20144c0", KEYCARD_WITH_A_BLUE_MARKING = "5efde6b4f5448336730dbd61", KEY_ABANDONED_FACTORY_MARKED = "63a3a93f8a56922e82001f5d", KEY_ARCHIVE_ROOM = "63a39e49cd6db0635c1975fc", @@ -2383,14 +2485,17 @@ export declare enum ItemTpl { LOOTCONTAINER_AIRDROP_COMMON_SUPPLY_CRATE = "6223349b3136504a544d1608", LOOTCONTAINER_AIRDROP_MEDICAL_CRATE = "622334c873090231d904a9fc", LOOTCONTAINER_AIRDROP_SUPPLY_CRATE = "622334fa3136504a544d160c", + LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_1 = "66da1b49099cf6adcc07a36b", + LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_2 = "66da1b546916142b3b022777", LOOTCONTAINER_AIRDROP_WEAPON_CRATE = "6223351bb5d97a7b2c635ca7", LOOTCONTAINER_BANK_CASH_REGISTER = "64d116f41a9c6143a956127d", - LOOTCONTAINER_BANK_SAFE = "64d11702dd0cd96ab82c3280", + LOOTCONTAINER_BANK_SAFE_3X3 = "66acff0a1d8e1083b303f5af", + LOOTCONTAINER_BANK_SAFE_4X4 = "64d11702dd0cd96ab82c3280", LOOTCONTAINER_BURIED_BARREL_CACHE = "5d6d2bb386f774785b07a77a", LOOTCONTAINER_CASH_REGISTER = "578f879c24597735401e6bc6", LOOTCONTAINER_CASH_REGISTER_TAR22 = "5ad74cf586f774391278f6f0", + LOOTCONTAINER_CIVILIAN_BODY = "658420d8085fea07e674cdb6", LOOTCONTAINER_COMMON_FUND_STASH = "5d07b91b86f7745a077a9432", - LOOTCONTAINER_DEAD_CIVILIAN = "658420d8085fea07e674cdb6", LOOTCONTAINER_DEAD_SCAV = "5909e4b686f7747f5b744fa4", LOOTCONTAINER_DRAWER = "578f87b7245977356274f2cd", LOOTCONTAINER_DUFFLE_BAG = "578f87a3245977356274f2cb", @@ -2428,7 +2533,11 @@ export declare enum ItemTpl { MACHINEGUN_KALASHNIKOV_PKTM_762X54R_MODERNIZED_TANK_MACHINE_GUN = "657857faeff4c850222dff1b", MACHINEGUN_NSV_UTYOS_127X108_HEAVY_MACHINE_GUN = "5cdeb229d7f00c000e7ce174", MACHINEGUN_RPK16_545X39_LIGHT_MACHINE_GUN = "5beed0f50db834001c062b12", + MACHINEGUN_US_ORDNANCE_M60E4_762X51_LIGHT_MACHINE_GUN = "65fb023261d5829b2d090755", + MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN = "661ceb1b9311543c7104149b", + MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN_FDE = "661cec09b2c6356b4d0c7a36", MAGAZINE_127X108_100_100RND = "5cffa483d7ad1a049e54ef1c", + MAGAZINE_127X33_DE_7RND = "668fe5c5f35310705d02b696", MAGAZINE_127X55_ASH12_10RND = "5caf1041ae92157c28402e3f", MAGAZINE_127X55_ASH12_20RND = "5caf1109ae9215753c44119f", MAGAZINE_127X55_RSH12_CYL_5RND = "633ec6ee025b096d320a3b15", @@ -2515,8 +2624,8 @@ export declare enum ItemTpl { MAGAZINE_556X45_GEN_M3_10RND = "5aaa5e60e5b5b000140293d6", MAGAZINE_556X45_GEN_M3_20RND = "5448c1d04bdc2dff2f8b4569", MAGAZINE_556X45_GEN_M3_30RND = "5aaa5dfee5b5b000140293d3", - MAGAZINE_556X45_GEN_M3_30RND_FDE = "6241c2c2117ad530666a5108", MAGAZINE_556X45_GEN_M3_40RND = "544a378f4bdc2d30388b4567", + MAGAZINE_556X45_GEN_M3_AIRSOFT_30RND = "6241c2c2117ad530666a5108", MAGAZINE_556X45_GEN_M3_FDE_30RND = "5d1340b3d7ad1a0b52682ed7", MAGAZINE_556X45_GEN_M3_FDE_40RND = "5d1340bdd7ad1a0e8d245aab", MAGAZINE_556X45_GEN_M3_WINDOW_30RND = "55802d5f4bdc2dac148b458e", @@ -2542,6 +2651,7 @@ export declare enum ItemTpl { MAGAZINE_762X51_AA70_20RND = "5cf12a15d7f00c05464b293f", MAGAZINE_762X51_AICS_10RND = "5d25a6538abbc306c62e630d", MAGAZINE_762X51_AICS_5RND = "5d25a4a98abbc30b917421a4", + MAGAZINE_762X51_ASSAULT_BOX_100RND = "660ea4453786cc0af808a1be", MAGAZINE_762X51_AXMC_308_10RND = "628120f210e26c1f344e6558", MAGAZINE_762X51_DVL10_10RND = "5888988e24597752fe43a6fa", MAGAZINE_762X51_KAC_762_10RND = "5df8f535bb49d91fb446d6b0", @@ -2612,15 +2722,25 @@ export declare enum ItemTpl { MAGAZINE_9X19_SB7_10RND = "5998529a86f774647f44f421", MAGAZINE_9X19_SG919_20RND = "5c0673fb0db8340023300271", MAGAZINE_9X19_SG919_30RND = "5c0672ed0db834001b7353f3", + MAGAZINE_9X19_UZI_20RND = "66992713ae08c5c29e0c4f97", + MAGAZINE_9X19_UZI_25RND = "6699271b9950f5f4cd060299", + MAGAZINE_9X19_UZI_32RND = "669927203c4fda6471005cbe", + MAGAZINE_9X19_UZI_40RND = "66992725ae08c5c29e0c4f9a", + MAGAZINE_9X19_UZI_50RND = "6699272a3c4fda6471005cc1", + MAGAZINE_9X19_UZI_PRO_20RND = "668031ffe3e7eb26e8004cdd", + MAGAZINE_9X19_UZI_PRO_25RND = "66866f4ec3d473265104f381", + MAGAZINE_9X19_UZI_PRO_32RND = "66866f622a2296a8d9099639", MAGAZINE_9X19_X5_MP5_50RND = "5a351711c4a282000b1521a4", MAGAZINE_9X21_SR1MP_18RND = "59f99a7d86f7745b134aa97b", MAGAZINE_9X21_SR2M_20RND = "633a98eab8b0506e48497c1a", MAGAZINE_9X21_SR2M_30RND = "62e153bcdb1a5c41971c1b5b", MAGAZINE_9X33R_CR_CYL_6RND = "619f54a1d25cbd424731fb99", + MAGAZINE_9X33R_DE_9RND = "669fa435803b94fb5d0e3a76", MAGAZINE_9X39_6L24_10RND = "57838f0b2459774a256959b2", MAGAZINE_9X39_6L25_20RND = "57838f9f2459774a150289a0", MAGAZINE_9X39_9A91_20RND = "6450ec2e7da7133e5a09ca96", MAGAZINE_9X39_SR3M130_30RND = "5a9e81fba2750c00164f6b11", + MAGAZINE_9X39_VSSVAL_30RND = "65118f531b90b4fc77015083", MAP_CUSTOMS_PLAN = "5798a2832459774b53341029", MAP_FACTORY_PLAN = "574eb85c245977648157eec3", MAP_INTERCHANGE_PLAN = "5be4038986f774527d3fae60", @@ -2748,11 +2868,13 @@ export declare enum ItemTpl { MOUNT_M1A_SOCOM_16_UPPER_PART = "5ab24ef9e5b5b00fe93c9209", MOUNT_M700_30MM_INTEGRAL_RING_SCOPE = "5bfebc5e0db834001a6694e5", MOUNT_M700_AB_ARMS_MODX_RAIL = "5cde7b43d7f00c000d36b93e", + MOUNT_M700_BADGER_ORDNANCE_SCOPE_RAIL = "65f064eec4da400cbb0dc1fe", MOUNT_M700_EXTENDED_MULTISLOT_WEAVER_RAIL_BASE = "5bfebc530db834001d23eb65", MOUNT_M700_MAGPUL_PRO_700_CHASSIS_INLINE = "5cdeaca5d7f00c00b61c4b70", MOUNT_M870_LEAPERS_UTG_PRO_MTU028SG_RAIL = "5a7893c1c585673f2b5c374d", MOUNT_M870_MESA_TACTICAL_MAGAZINE_CLAMP = "5a789261c5856700186c65d3", MOUNT_M870_XS_SHOTRAIL_RAIL_WITH_GHOST_RING_REAR_SIGHT = "5a78948ec5856700177b1124", + MOUNT_MAGPUL_MLOK_093_INCH_RAIL = "669a6a4a525be1d2d004b8eb", MOUNT_MAGPUL_MLOK_25_INCH_RAIL = "5b7be47f5acfc400170e2dd2", MOUNT_MAGPUL_MLOK_41_INCH_RAIL = "5b7be4895acfc400170e2dd5", MOUNT_MAGPUL_MLOK_CANTILEVER = "6269220d70b6c02e665f2635", @@ -2805,6 +2927,8 @@ export declare enum ItemTpl { MOUNT_RFB_HANDGUARD_RAIL = "5f2aa493cd375f14e15eea72", MOUNT_RFB_SCOPE_RAIL = "5f2aa49f9b44de6b1b4e68d4", MOUNT_RPK16_HANDGUARD_RAIL = "5beecbb80db834001d2c465e", + MOUNT_RS_REGULATE_AK303M_FULL_LENGTH_LOWER_DOVETAIL = "65f1b1176dbd6c5ba2082eed", + MOUNT_RS_REGULATE_AKR_TOP = "65f1b2a5c14a07890801fc70", MOUNT_SAG_AK_DOVETAIL_SIDE = "63d114019e35b334d82302f7", MOUNT_SAG_BIT_LOW_PROFILE_DOVETAIL_SIDE = "638db77630c4240f9e06f8b6", MOUNT_SIG_ALPHA4_30MM_RING_SCOPE = "6567e751a715f85433025998", @@ -2840,6 +2964,10 @@ export declare enum ItemTpl { MOUNT_TROY_QARS_42_INCH_RAIL = "5b4736b986f77405cb415c10", MOUNT_UM_TACTICAL_UM3_PISTOL_SIGHT = "5a7b4900e899ef197b331a2a", MOUNT_UNV_DLOCIRD_SIGHT = "5a1ead28fcdbcb001912fa9f", + MOUNT_UZI_HANDGUARD_RAIL = "6698c8f4710a4525fe0e9e57", + MOUNT_UZI_PRO_SMG_RAIL_ADAPTER = "668ea3f68117e4968b0cff4a", + MOUNT_UZI_STORMWERKZ_LOWER_HANDGUARD_RAIL = "66992f7d9950f5f4cd0602a8", + MOUNT_UZI_STORMWERKZ_SCOPE = "6698c90829e062525d0ad8ad", MOUNT_VLTOR_CASV_2_INCH_RAIL = "5b7be4575acfc400161d0832", MOUNT_VLTOR_CASV_4_INCH_RAIL = "5b7be4645acfc400170e2dcc", MOUNT_VLTOR_CASV_5_INCH_RAIL = "5b7be46e5acfc400170e2dcf", @@ -2848,13 +2976,14 @@ export declare enum ItemTpl { MOUNT_VLTOR_CASV_KEYMOD_6_INCH_RAIL = "59e0bed186f774156f04ce84", MOUNT_VOMZ_PILAD_04302_DOVETAIL = "57acb6222459771ec34b5cb0", MOUNT_VPO102_ARBALET = "609a4b4fe2ff132951242d04", - MOUNT_VPO215_GORNOSTAY_SCOPE_RAIL = "5de6558e9f98ac2bc65950fc", + MOUNT_VPO215_SCOPE_RAIL = "5de6558e9f98ac2bc65950fc", MOUNT_VSSVAL_TOZ_6P29M = "59eb7ebe86f7740b373438ce", MOUNT_VSSVAL_ZENIT_B3_MOUNT_COMBO = "5a9fc7e6a2750c0032157184", MOUNT_VSSVAL_ZENIT_B3_RING = "57a3459f245977764a01f703", MOUNT_ZENIT_B13V_KLASSIKA_DOVETAIL_RAIL_PLATFORM = "5c90c3622e221601da359851", MOUNT_ZENIT_B13_KLASSIKA_DOVETAIL_RAIL_PLATFORM = "5c61a40d2e2216001403158d", MOUNT_ZENIT_KR2_OLD_GEN = "646f6322f43d0c5d62063715", + MULTITOOLS_LEATHERMAN_MULTITOOL = "544fb5454bdc2df8738b456a", MUZZLECOMBO_9A91_HANDGUARD_RETAINER = "64527a263d52156624001fd7", MUZZLECOMBO_AI_AXMC_THREAD_PROTECTION_CAP = "628120621d5df4475f46a335", MUZZLECOMBO_AKM_762X39_KIBA_ARMS_308_MUZZLE_DEVICE_ADAPTER = "615d8e9867085e45ef1409c6", @@ -2900,10 +3029,15 @@ export declare enum ItemTpl { MUZZLECOMBO_STEYR_AUG_RAT_WORX_556X45_MUZZLE_DEVICE_ADAPTER = "630f27f04f3f6281050b94d7", MUZZLECOMBO_SVDS_ROTOR_43_THREAD_ADAPTER = "5e01e9e273d8eb11426f5bc3", MUZZLECOMBO_TROMIX_MONSTER_CLAW_12GA_MUZZLE_BRAKE = "59fb137a86f7740adb646af1", - MUZZLECOMBO_VPO215_GORNOSTAY_THREAD_PROTECTION_CAP = "5de6556a205ddc616a6bc4f7", - NIGHTVISION_ANPVS14_NIGHT_VISION_MONOCULAR = "57235b6f24597759bf5a30f1", + MUZZLECOMBO_UZI_9X19_3LUG_BARREL_RETAINING_NUT = "6698c9ba29e062525d0ad8b1", + MUZZLECOMBO_UZI_9X19_3LUG_BARREL_THREAD_PROTECTOR = "6698c9c636ba38d291017711", + MUZZLECOMBO_UZI_9X19_BARREL_RETAINING_NUT = "6698c9aa36ba38d29101770f", + MUZZLECOMBO_UZI_PRO_9X19_BARREL_RETAINING_NUT = "668670e3fb75ee4a5e02eb16", + MUZZLECOMBO_UZI_PRO_9X19_MASADA_THREAD_PROTECTOR = "668670f52a2296a8d909963c", + MUZZLECOMBO_VPO215_THREAD_PROTECTOR = "5de6556a205ddc616a6bc4f7", NIGHTVISION_ARMASIGHT_N15_NIGHT_VISION_GOGGLES = "5c066e3a0db834001b7353f0", - NIGHTVISION_GPNVG18_NIGHT_VISION_GOGGLES = "5c0558060db834001b735271", + NIGHTVISION_L3HARRIS_ANPVS14_NIGHT_VISION_MONOCULAR = "57235b6f24597759bf5a30f1", + NIGHTVISION_L3HARRIS_GPNVG18_NIGHT_VISION_GOGGLES = "5c0558060db834001b735271", NIGHTVISION_PNV10T_NIGHT_VISION_GOGGLES = "5c0696830db834001d23f5da", OPTICSCOPE_BELOMO_PSO1M21_4X24_SCOPE = "576fd4ec2459777f0b518431", OPTICSCOPE_BELOMO_PSO1M2_4X24_SCOPE = "5c82343a2e221644f31c0611", @@ -2923,27 +3057,27 @@ export declare enum ItemTpl { OPTICSCOPE_PAG17_SCOPE = "5d53f4b7a4b936793d58c780", OPTICSCOPE_PU_35X_RIFLESCOPE = "5b3f7c1c5acfc40dc5296b1d", OPTICSCOPE_SCHMIDT_BENDER_PM_II_18X24_30MM_RIFLESCOPE = "617151c1d92c473c770214ab", - OPTICSCOPE_SCHMIDT_BENDER_PM_II_312X50_34MM_RIFLESCOPE = "61714eec290d254f5e6b2ffc", + OPTICSCOPE_SCHMIDT_BENDER_PM_II_320X50_34MM_RIFLESCOPE = "61714eec290d254f5e6b2ffc", OPTICSCOPE_SCHMIDT_BENDER_PM_II_525X56_34MM_RIFLESCOPE = "62850c28da09541f43158cca", OPTICSCOPE_SIG_TANGO6T_16X24_30MM_RIFLESCOPE = "6567e7681265c8a131069b0f", OPTICSCOPE_VOMZ_PILAD_4X32_254MM_RIFLESCOPE = "5dff772da3651922b360bf91", OPTICSCOPE_VORTEX_RAZOR_HD_GEN2_16X24_30MM_RIFLESCOPE = "618ba27d9008e4636a67f61d", PISTOLGRIP_9A91_PISTOL_GRIP = "6450f21a3d52156624001fcf", PISTOLGRIP_AK12_PISTOL_GRIP = "5beec8ea0db834001a6f9dbf", + PISTOLGRIP_AK74_BAKELITE_PISTOL_GRIP = "5649ad3f4bdc2df8348b4585", + PISTOLGRIP_AK74_POLYMER_PISTOL_GRIP = "5649ade84bdc2d1b2b8b4587", PISTOLGRIP_AKM_BAKELITE_PISTOL_GRIP = "59e62cc886f77440d40b52a1", PISTOLGRIP_AKM_WOODEN_PISTOL_GRIP = "5a0071d486f77404e23a12b2", + PISTOLGRIP_AKS74U_BAKELITE_PISTOL_GRIP = "57e3dba62459770f0c32322b", PISTOLGRIP_AK_AEROKNOX_SCORPIUS_PISTOL_GRIP = "5f6341043ada5942720e2dc5", - PISTOLGRIP_AK_BAKELITE_PISTOL_GRIP = "59e6318286f77444dd62c4cc", - PISTOLGRIP_AK_BAKELITE_PISTOL_GRIP_6P1_SB8V = "5649ad3f4bdc2df8348b4585", - PISTOLGRIP_AK_BAKELITE_PISTOL_GRIP_6P4_SB9 = "57e3dba62459770f0c32322b", - PISTOLGRIP_AK_CG101_ARTYPE_PISTOL_GRIP_ADAPTER = "648ae3e356c6310a830fc291", PISTOLGRIP_AK_CUSTOM_ARMS_AGS74_PRO_SNIPER_KIT_PISTOL_GRIP = "6087e663132d4d12c81fd96b", - PISTOLGRIP_AK_FAB_DEFENSE_AGR47_PISTOL_GRIP = "623c3be0484b5003161840dc", + PISTOLGRIP_AK_CUSTOM_GUNS_CG101_ARTYPE_PISTOL_GRIP_ADAPTER = "648ae3e356c6310a830fc291", + PISTOLGRIP_AK_FAB_DEFENSE_AGR47_PISTOL_GRIP_FDE = "623c3be0484b5003161840dc", PISTOLGRIP_AK_KGB_MG47_PISTOL_GRIP = "5cf54404d7f00c108840b2ef", PISTOLGRIP_AK_KGB_MG47_PISTOL_GRIP_ANODIZED_RED = "5e2192a498a36665e8337386", PISTOLGRIP_AK_MAGPUL_MOE_PISTOL_GRIP_BLACK = "5b30ac585acfc433000eb79c", PISTOLGRIP_AK_MISSION_FIRST_TACTICAL_ENGAGE_AK47_PISTOL_GRIP = "63f4da90f31d4a33b87bd054", - PISTOLGRIP_AK_POLYMER_PISTOL_GRIP_6P1_SB8 = "5649ade84bdc2d1b2b8b4587", + PISTOLGRIP_AK_MOLOT_BAKELITE_PISTOL_GRIP = "59e6318286f77444dd62c4cc", PISTOLGRIP_AK_PUFGUN_SGM2_PISTOL_GRIP = "651580dc71a4f10aec4b6056", PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_BLACK = "5cf50850d7f00c056e24104c", PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_FDE = "5cf508bfd7f00c056e24104e", @@ -2971,16 +3105,19 @@ export declare enum ItemTpl { PISTOLGRIP_AR15_MAGPUL_MOE_PISTOL_GRIP_BLACK = "55802f5d4bdc2dac148b458f", PISTOLGRIP_AR15_MAGPUL_MOE_PISTOL_GRIP_FDE = "5d15cf3bd7ad1a67e71518b2", PISTOLGRIP_AR15_NAROH_ARMS_GRALS_PISTOL_GRIP = "59db3a1d86f77429e05b4e92", - PISTOLGRIP_AR15_SIG_M400_REDUCED_ANGLE_PISTOL_GRIP_COYOTE_TAN = "652911675ae2ae97b80fdf3c", + PISTOLGRIP_AR15_SIG_REDUCED_ANGLE_PISTOL_GRIP_COYOTE_TAN = "652911675ae2ae97b80fdf3c", PISTOLGRIP_AR15_STARK_AR_RIFLE_GRIP_BLACK = "59db3acc86f7742a2c4ab912", PISTOLGRIP_AR15_STARK_AR_RIFLE_GRIP_FDE = "59db3b0886f77429d72fb895", PISTOLGRIP_AR15_TACTICAL_DYNAMICS_HEXGRIP_PISTOL_GRIP = "615d8faecabb9b7ad90f4d5d", PISTOLGRIP_AR15_TACTICAL_DYNAMICS_SKELETONIZED_PISTOL_GRIP = "5b07db875acfc40dc528a5f6", - PISTOLGRIP_AS_VAL_PISTOL_GRIP = "57c44fa82459772d2d75e415", - PISTOLGRIP_AS_VAL_ROTOR_43_PISTOL_GRIP_BUFFER_TUBE = "5a69a2ed8dc32e000d46d1f1", + PISTOLGRIP_AS_VAL_PISTOL_GRIP_BLACK = "6565b91666492762f5029c0b", + PISTOLGRIP_AS_VAL_PISTOL_GRIP_PLUM = "57c44fa82459772d2d75e415", + PISTOLGRIP_AS_VAL_ROTOR_43_PISTOL_GRIP_WITH_BUFFER_TUBE = "5a69a2ed8dc32e000d46d1f1", PISTOLGRIP_BENELLI_M3_TELESCOPIC_STOCK_PISTOL_GRIP = "6259c3d8012d6678ec38eeb8", PISTOLGRIP_CHIAPPA_RHINO_PLASTIC_PISTOL_GRIP = "619f4ab2d25cbd424731fb95", PISTOLGRIP_CHIAPPA_RHINO_WOODEN_PISTOL_GRIP = "619f4bffd25cbd424731fb97", + PISTOLGRIP_DESERT_EAGLE_HOGUE_RUBBER_GRIP = "668fe5d42a0f85eea407cc16", + PISTOLGRIP_DESERT_EAGLE_HOGUE_RUBBER_GRIP_WITH_FINGER_GROOVES = "66a0da76b6f47fcfeb025e96", PISTOLGRIP_GLOCK_PACHMAYR_TACTICAL_GRIP_GLOVE = "5a7b4960e899ef197b331a2d", PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_BLACK = "57c55efc2459772d2c6271e7", PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_FDE = "57af48872459771f0b2ebf11", @@ -2993,6 +3130,12 @@ export declare enum ItemTpl { PISTOLGRIP_M1911_KIBA_ARMS_GENEBURN_CUSTOM_SIDE_GRIPS = "626a9cb151cb5849f6002890", PISTOLGRIP_M1911_PACHMAYR_AMERICAN_LEGEND_GRIP_423 = "5ef366938cef260c0642acad", PISTOLGRIP_M45A1_MILTAC_GVT_G10_SIDE_GRIPS = "5f3e778efcd9b651187d7201", + PISTOLGRIP_M60E4_PISTOL_GRIP = "660125bf1d087a96c60a54db", + PISTOLGRIP_M60E4_TRIGGER_GROUP = "6601257f1347bc1a5f0f4db6", + PISTOLGRIP_M60E6_PISTOL_GRIP = "66152060a031cbb5570e3466", + PISTOLGRIP_M60E6_PISTOL_GRIP_FDE = "6615211ca031cbb5570e346d", + PISTOLGRIP_M60E6_TRIGGER_GROUP = "6615208aa031cbb5570e346a", + PISTOLGRIP_M60E6_TRIGGER_GROUP_FDE = "66152153a031cbb5570e346f", PISTOLGRIP_M700_MAGPUL_PRO_700_PISTOL_GRIP = "5cdeac5cd7f00c000f261694", PISTOLGRIP_M870_FAB_DEFENSE_AGR870_PISTOL_GRIP = "5bfe86a20db834001d23e8f7", PISTOLGRIP_M9A3_POLYMER_SIDE_GRIPS = "5cadc431ae921500113bb8d5", @@ -3014,9 +3157,10 @@ export declare enum ItemTpl { PISTOLGRIP_PB_BAKELITE_SIDE_GRIPS = "56e05a6ed2720bd0748b4567", PISTOLGRIP_PK_PISTOL_GRIP = "646371779f5f0ea59a04c204", PISTOLGRIP_PK_PISTOL_GRIP_BLACK = "64cbad529f7cf7f75c077fd5", - PISTOLGRIP_PM_BAKELITE_SIDE_GRIPS = "6374a7e7417239a7bf00f042", + PISTOLGRIP_PM_BAKELITE_GRIP = "6374a7e7417239a7bf00f042", PISTOLGRIP_PM_FAB_DEFENSE_PMG_PISTOL_GRIP = "637784c5f7b3f4ac1a0d1a9a", PISTOLGRIP_PM_FAB_DEFENSE_PMG_PISTOL_GRIP_OLIVE_DRAB = "648afce7ec6bb25b2608defb", + PISTOLGRIP_PM_PMLASER_GRIP_WITH_LASER_SIGHT = "661f8995c341ea101e0d33e8", PISTOLGRIP_PM_TACTIC_KIT_PISTOL_GRIP = "637b6d610aef6cfc5e02dd14", PISTOLGRIP_PP1901_VITYAZ_PISTOL_GRIP = "5998517986f7746017232f7e", PISTOLGRIP_PP91_KEDR_POLYMER_PISTOL_GRIP = "57d152ec245977144076ccdf", @@ -3027,8 +3171,8 @@ export declare enum ItemTpl { PISTOLGRIP_SA58_SAWSTYLE_PISTOL_GRIP_BLACK = "5b099b965acfc400186331e6", PISTOLGRIP_SKSVZ58_FAB_DEFENSE_AG58_PISTOL_GRIP = "5d023784d7ad1a049d4aa7f2", PISTOLGRIP_SKS_TAPCO_INTRAFUSE_SAWSTYLE_PISTOL_GRIP = "5afd7e445acfc4001637e35a", - PISTOLGRIP_SR2M_PISTOL_GRIP = "637b9c37b7e3bc41b21ce71a", PISTOLGRIP_SR2M_PISTOL_GRIP_BLACK = "637ba29bf7ca6372bf2613db", + PISTOLGRIP_SR2M_PISTOL_GRIP_PLUM = "637b9c37b7e3bc41b21ce71a", PISTOLGRIP_SVDS_LYNX_ARMS_AKSERIES_PISTOL_GRIP_ADAPTER = "6516b129609aaf354b34b3a8", PISTOLGRIP_SVDS_PISTOL_GRIP = "5c471be12e221602b66cd9ac", PISTOLGRIP_TOZ106_002_PISTOL_GRIP = "5a38eecdc4a282329a73b512", @@ -3037,6 +3181,7 @@ export declare enum ItemTpl { PISTOLGRIP_TT_PMLASER_TT206_SIDE_GRIPS_WITH_LASER_SIGHT = "5bffcf7a0db83400232fea79", PISTOLGRIP_TT_RAZOR_ARMS_RUBBER_GRIP = "5c079ec50db834001966a706", PISTOLGRIP_TT_SIDE_GRIPS = "571a282c2459771fb2755a69", + PISTOLGRIP_UZI_PISTOL_GRIP_COVER = "669946c157df3e2b4e0a0dc5", PISTOL_20X1MM_TOY_GUN = "66015072e9f84d5680039678", PISTOL_APB_9X18PM_SILENCED_MACHINE = "5abccb7dd8ce87001773e277", PISTOL_BERETTA_M9A3_9X19 = "5cadc190ae921500103bb3b6", @@ -3049,6 +3194,11 @@ export declare enum ItemTpl { PISTOL_GLOCK_19X_9X19 = "63088377b5cd696784087147", PISTOL_HK_USP_45_ACP = "6193a720f8ee7e52e42109ed", PISTOL_LEBEDEV_PL15_9X19 = "602a9740da11d6478d5a06dc", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L5_357 = "669fa409933e898cce0c2166", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L5_50_AE = "669fa3f88abd2662d80eee77", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L6_50_AE = "669fa39b48fc9f8db6035a0c", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L6_50_AE_PISTOL_WTS = "669fa3d876116c89840b1217", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_MK_XIX_50_AE = "668fe5a998b5ad715703ddd6", PISTOL_MAKAROV_PM_9X18PM = "5448bd6b4bdc2dfc2f8b4569", PISTOL_MAKAROV_PM_T_9X18PM = "579204f224597773d619e051", PISTOL_PB_9X18PM_SILENCED = "56e0598dd2720bb5668b45a6", @@ -3058,6 +3208,7 @@ export declare enum ItemTpl { PISTOL_TT33_762X25_TT = "571a12c42459771f627b58a0", PISTOL_TT33_762X25_TT_PISTOL_GOLDEN = "5b3b713c5acfc4330140bd8d", PISTOL_YARYGIN_MP443_GRACH_9X19 = "576a581d2459771e7b1bc4f1", + PLANTINGKITS_TRIPWIRE_INSTALLATION_KIT = "666b11055a706400b717cfa5", POCKETS_1X3 = "60c7272c204bc17802313365", POCKETS_1X4 = "557ffd194bdc2d28148b457f", POCKETS_1X4_SPECIAL = "627a4e6b255f7527fb05a0f6", @@ -3071,37 +3222,45 @@ export declare enum ItemTpl { QUEST_ARENA_POSTER_EASY_MONEY = "664b69e8e1238e506d3630af", QUEST_ARENA_POSTER_KILLA = "664b69c5a082271bc46c4e11", QUEST_BANK_CASE = "590dde5786f77405e71908b2", + QUEST_BATTERED_DIARY = "666073159916667083033cb9", QUEST_BLOOD_SAMPLE = "5a687e7886f7740c4a5133fb", + QUEST_BLOOD_SAMPLE_NF2024 = "66a0f0926fee20fa70036da6", QUEST_BOTTLE_OF_LE_JEAN_WINE = "6582bd252b50c61c565828e2", QUEST_CADASTRAL_REGISTRY_RECORDS = "657acb2ac900be5902191ac9", QUEST_CARBON_CASE = "5910922b86f7747d96753483", + QUEST_CASE_WITH_PRECISION_TOOLS = "66b22630a6b4e5ec7c02cdb7", QUEST_CHEFS_DIARY = "64f69b4267e11a7c6206e010", QUEST_CHEMCONT_SAMPLES = "63927b29c115f907b14700b9", + QUEST_CHEMICAL_CONTAINER = "66a0e523e749756c920d02d0", QUEST_CHEMICAL_CONTAINER_1 = "5b43237186f7742f3a4ab252", QUEST_CHEMICAL_CONTAINER_2 = "5b4c81a086f77417d26be63f", QUEST_CHEMICAL_CONTAINER_3 = "5b4c81bd86f77418a75ae159", + QUEST_CHEMICAL_SAMPLE = "669fac549b0ce3feae01a137", QUEST_CLOTHES_DESIGN_HANDBOOK_PART_1 = "5ae9a3f586f7740aab00e4e6", QUEST_CLOTHES_DESIGN_HANDBOOK_PART_2 = "5ae9a4fc86f7746e381e1753", - QUEST_COMPROMISING_INFORMATION_ON_REF = "664fce7a90294949fe2d81cb", + QUEST_EASY_MONEY_POSTER_PACK = "664b69f3a082271bc46c4e13", QUEST_ENCRYPTED_MESSAGE = "5d3ec50586f774183a607442", QUEST_FLASHDRIVE_CAR_SERVICE = "638cbb3ba63f1b49be6a300e", QUEST_FLASHDRIVE_TERRAGROUP_EMPLOYEE = "5eff135be0d3331e9d282b7b", QUEST_FLASHDRIVE_WATCHING_YOU = "638e9d5536b3b72c944e2fc7", QUEST_FLASHDRIVE_WET_JOB_PT_4 = "5a29357286f77409c705e025", QUEST_FLASH_DRIVE_WITH_FAKE_INFO = "5c12301c86f77419522ba7e4", - QUEST_FLYERS4 = "664b69f3a082271bc46c4e13", + QUEST_GAMING_MAGAZINE = "667a8ef464eea5fdef0db135", QUEST_GOLDEN_ZIBBO_LIGHTER = "5939a00786f7742fe8132936", QUEST_GOSHAN_CARGO_MANIFESTS = "5ae9a0dd86f7742e5f454a05", QUEST_HARD_DRIVE = "661666458c2aa9cb1602503b", QUEST_HARD_DRIVE_TERRAGROUP_SCIENTIST = "6575a6ca8778e96ded05a802", QUEST_HDD_SURVEILLANCE = "638dfc803083a019d447768e", QUEST_HDD_TOP_SECRET = "628393620d8524273e7eb028", + QUEST_HDD_UNUSED = "66760b3deb51b08bd40c2b08", QUEST_HDD_WET_JOB = "5a29276886f77435ed1b117c", QUEST_HOUSING_JOURNAL = "638e0057ab150a5f56238960", QUEST_IDEA_CARGO_MANIFESTS = "5ae9a1b886f77404c8537c62", QUEST_INFORMANT_JOURNAL = "63989ced706b793c7d60cfef", QUEST_JOURNAL = "64f07f7726cfa02c506f8ac0", QUEST_KEY_TO_THE_CLOSED_PREMISES_OF_THE_HEALTH_RESORT = "5a0448bc86f774736f14efa8", + QUEST_LAB_JOURNAL = "66c0b39ca1f68fcc1d0c0cc3", + QUEST_LEDX_SKIN_TRANSILLUMINATOR_US_VERSION = "666879d498b97e3a8f09f1ae", QUEST_LETTER_GOT_MAIL = "638cbc68a63f1b49be6a3010", QUEST_LETTER_HERMIT = "61904c9df62c89219a56e034", QUEST_LETTER_POSTMAN_PAT = "591093bb86f7747caa7bb2ee", @@ -3139,8 +3298,10 @@ export declare enum ItemTpl { QUEST_PICTURE_7 = "64e74a3d4d49d23b2c39d319", QUEST_PICTURE_8 = "64e74a44c2b4f829615ec334", QUEST_PICTURE_9 = "64e74a4baac4cd0a7264ecdd", + QUEST_PILOT_LOGBOOK = "66c0b90c8398582e4b0c2e27", QUEST_PUMPING_STATION_OPERATION_REPORT = "619268ad78f4fa33f173dbe5", QUEST_RADIO_TRANSMITTER_BODY = "6399f54b0a36db13c823ad21", + QUEST_REF_DIRT = "664fce7a90294949fe2d81cb", QUEST_SECRET_COMPONENT = "64f5b4f71a5f313cb144c06c", QUEST_SECURED_TAPE = "6398a4cfb5992f573c6562b3", QUEST_SECURE_FLASH_DRIVE = "59f9ddae86f77407ab46e047", @@ -3159,6 +3320,7 @@ export declare enum ItemTpl { QUEST_SURGERY_KIT_MARKED_WITH_A_BLUE_SYMBOL = "5efdafc1e70b5e33f86de058", QUEST_SYRINGE_WITH_A_CHEMICAL = "593a87af86f774122f54a951", QUEST_T90M_COMMANDER_CONTROL_PANEL = "609267a2bb3f46069c3e6c7d", + QUEST_TARKOV_CITY_SOUVENIR_KEY = "66687bc89111279d600b5062", QUEST_TOUGHBOOK_CARGO = "5a29284f86f77463ef3db363", QUEST_TOUGHBOOK_SEASIDE_VACATION = "619252352be33f26043400a7", QUEST_UAV_SAS_DISK_1 = "5a294d7c86f7740651337cf9", @@ -3234,23 +3396,35 @@ export declare enum ItemTpl { RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_48 = "6489cca131a2135f0d7d0fdd", RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_49 = "6489d812cf0cd80b7e749071", RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_50 = "6489d89debac5a4a1b73caf7", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON = "6694f4101ae1778e310f4f8e", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_1 = "66a3896972c8e72507028806", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_2 = "66a3896de45f71bf1009e45a", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC = "6694f423909d2322a8073151", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_1 = "66a389c0705adefa710cdeaa", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_2 = "66a389c60982fc7e4c091c51", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE = "6694f418c74d8a180f0f78c0", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_1 = "66a3898c1df2a447cc0d3c35", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_2 = "66a3898f0982fc7e4c091c4d", RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_BIG = "63a897c6b1ff6e29734fcc95", RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_MEDIUM = "63a898a328e385334e0640a5", RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_SMALL = "63a8970d7108f713591149f5", RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER = "634959225289190e5e773b3b", RANDOMLOOTCONTAINER_RANDOM_LOOT_CONTAINER = "62f10b79e7ee985f386b2f47", RANDOMLOOTCONTAINER_RANDOM_LOOT_QUEST_CONTAINER = "633ffb5d419dbf4bea7004c6", + RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT = "66aa3a180d6ecb50a21a4e1a", + RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_1 = "66aa3a31efb1b8119f0196c7", + RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_2 = "66aa3a3800b2c42adb07d13e", RANGEFINDER_VORTEX_RANGER_1500 = "61605e13ffa6e502ac5e7eef", RECEIVER_AI_AXMC_338_LM_CHASSIS = "6281204f308cb521f87a8f9b", RECEIVER_AI_AXMC_UPPER = "62811fbf09427b40ab14e767", - RECEIVER_AK12_DUST_COVER = "649ec2f3961514b22506b111", - RECEIVER_AK545_SAG_RAILED_DUST_COVER = "628b9be6cff66b70c002b14c", - RECEIVER_AK74M_DUST_COVER_6P34_01 = "5ac50da15acfc4001718d287", - RECEIVER_AK74_DUST_COVER_6P20_01 = "5649af094bdc2df8348b4586", - RECEIVER_AKM_DUST_COVER_6P1_01 = "59d6507c86f7741b846413a2", + RECEIVER_AK12_RAILED_DUST_COVER = "649ec2f3961514b22506b111", + RECEIVER_AK545_RAILED_DUST_COVER = "628b9be6cff66b70c002b14c", + RECEIVER_AK74M_DUST_COVER = "5ac50da15acfc4001718d287", + RECEIVER_AK74_DUST_COVER = "5649af094bdc2df8348b4586", + RECEIVER_AKM_DUST_COVER = "59d6507c86f7741b846413a2", RECEIVER_AKS74UB_DUST_COVER = "5839a7742459773cf9693481", - RECEIVER_AKS74U_DUST_COVER_6P26_SB7 = "57dc334d245977597164366f", - RECEIVER_AKS74U_LEGAL_ARSENAL_PILIGRIM_RAILED_DUST_COVER = "655cb6b5d680a544f30607fa", + RECEIVER_AKS74U_DUST_COVER = "57dc334d245977597164366f", + RECEIVER_AKS74U_LEGAL_ARSENAL_PILGRIM_RAILED_DUST_COVER = "655cb6b5d680a544f30607fa", RECEIVER_AK_AKADEMIA_BASTION_DUST_COVER = "5d2c76ed48f03532f2136169", RECEIVER_AK_FAB_DEFENSE_PDC_DUST_COVER = "5d2c770c48f0354b4a07c100", RECEIVER_AK_TWS_DOG_LEG_RAIL_DUST_COVER = "5d2c772c48f0355d95672c25", @@ -3260,6 +3434,11 @@ export declare enum ItemTpl { RECEIVER_AR15_NOVESKE_GEN3_556X45_UPPER = "5c07a8770db8340023300450", RECEIVER_AR15_VLTOR_MUR1S_556X45_UPPER = "59bfe68886f7746004266202", RECEIVER_AS_VAL_DUST_COVER = "57c44f4f2459772d2c627113", + RECEIVER_DESERT_EAGLE_L5_357_PISTOL_SLIDE = "669fa5127a09bc295603b499", + RECEIVER_DESERT_EAGLE_L5_50_AE_PISTOL_SLIDE = "669fa5019aa2a422600442f6", + RECEIVER_DESERT_EAGLE_L6_PISTOL_SLIDE = "669fa4d97a09bc295603b496", + RECEIVER_DESERT_EAGLE_L6_PISTOL_SLIDE_WTS = "669fa5271bd4416eaa09b3ce", + RECEIVER_DESERT_EAGLE_MK_XIX_PISTOL_SLIDE = "668fe60b56984d93550462c6", RECEIVER_FAL_STANDARD_DUST_COVER = "5b7d6c105acfc40015109a5f", RECEIVER_FN_FIVESEVEN_MK2_PISTOL_SLIDE = "5d3eb44aa4b93650d64e4979", RECEIVER_FN_P90_57X28_UPPER = "5cc70102e4a949035e43ba74", @@ -3294,8 +3473,8 @@ export declare enum ItemTpl { RECEIVER_M45A1_PISTOL_SLIDE = "5f3e7823ddc4f03b010e2045", RECEIVER_M4A1_556X45_UPPER = "55d355e64bdc2d962f8b4569", RECEIVER_M9A3_PISTOL_SLIDE = "5cadc55cae921500103bb3be", + RECEIVER_MCXSPEAR_68X51_UPPER = "6529119424cbe3c74a05e5bb", RECEIVER_MCX_GEN1_300_BLK_UPPER = "5fbcc3e4d6fa9c00c571bb58", - RECEIVER_MCX_SPEAR_68X51_UPPER = "6529119424cbe3c74a05e5bb", RECEIVER_MK18_338_LM_UPPER = "5fc278107283c4046c581489", RECEIVER_MK47_RESOLUTE_762X39_UPPER = "606587a88900dc2d9a55b659", RECEIVER_MOLOT_ARMS_AKMTYPE_DUST_COVER = "59e6449086f7746c9f75e822", @@ -3327,7 +3506,8 @@ export declare enum ItemTpl { RECEIVER_SVDS_DUST_COVER = "5c471bd12e221602b4129c3a", RECEIVER_SVT_DUST_COVER = "64119cdbdcf48d656f0aa272", RECEIVER_TX15_556X45_LIGHTWEIGHT_UPPER = "5d4405aaa4b9361e6a4e6bd3", - RECEIVER_VPO101_VEPRHUNTER_DUST_COVER = "5c503d0a2e221602b542b7ef", + RECEIVER_UZI_PRO_DUST_COVER = "6680326874b8f2050c0b9178", + RECEIVER_VPO101_DUST_COVER = "5c503d0a2e221602b542b7ef", RECEIVER_VSS_DUST_COVER = "578395402459774a256959b5", REPAIRKITS_BODY_ARMOR_REPAIR_KIT = "591094e086f7747caa7bb2ef", REPAIRKITS_WEAPON_REPAIR_KIT = "5910968f86f77425cf569c32", @@ -3343,7 +3523,7 @@ export declare enum ItemTpl { SECURE_CONTAINER_GAMMA = "5857a8bc2459772bad15db29", SECURE_CONTAINER_GAMMA_TUE = "665ee77ccf2d642e98220bca", SECURE_CONTAINER_KAPPA = "5c093ca986f7740a1867ab12", - SECURE_THETA_SECURE_CONTAINER = "664a55d84a90fc2c8a6305c9", + SECURE_CONTAINER_THETA = "664a55d84a90fc2c8a6305c9", SECURE_TOURNAMENT_SECURED_CONTAINER = "64f6f4c5911bcdfe8b03b0dc", SECURE_WAIST_POUCH = "5732ee6a24597719ae0c0281", SHOTGUN_BENELLI_M3_SUPER_90_12GA_DUALMODE = "6259b864ebedf17603599e88", @@ -3399,7 +3579,7 @@ export declare enum ItemTpl { SILENCER_KAC_QDC_65X35_SOUND_SUPPRESSOR = "55d617094bdc2d89028b4568", SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_BLACK = "57da93632459771cb65bf83f", SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_FDE = "57dbb57e2459774673234890", - SILENCER_MCX_SPEAR_SLX68MGQD_68X51_SOUND_SUPPRESSOR = "652911e650dc782999054b9d", + SILENCER_MCXSPEAR_SLX68MGQD_68X51_SOUND_SUPPRESSOR = "652911e650dc782999054b9d", SILENCER_MOSIN_RIFLE_BRAMIT_762X54R_SOUND_SUPPRESSOR = "5b86a0e586f7745b600ccb23", SILENCER_MP9_9X19_SOUND_SUPPRESSOR = "5de8f2d5b74cd90030650c72", SILENCER_MPXSD_9X19_INTEGRATED_SOUND_SUPPRESSOR = "58aeac1b86f77457c419f475", @@ -3407,17 +3587,18 @@ export declare enum ItemTpl { SILENCER_PL15_9X19_SOUND_SUPPRESSOR = "602a97060ddce744014caf6f", SILENCER_PP1901_VITYAZ_9X19_SOUND_SUPPRESSOR = "59bfc5c886f7743bf6794e62", SILENCER_PP9101_KEDRB_9X18PM_SOUND_SUPPRESSOR = "57f3c8cc2459773ec4480328", - SILENCER_ROTOR_43_366_TKM_MUZZLE_BRAKECOMPENSATOR = "5a9fbb74a2750c0032157181", - SILENCER_ROTOR_43_556X45_MUZZLE_BRAKECOMPENSATOR = "5a9fbb84a2750c00137fa685", - SILENCER_ROTOR_43_762X39_MUZZLE_BRAKECOMPENSATOR = "5a9fbacda2750c00141e080f", - SILENCER_ROTOR_43_762X54R_MUZZLE_BRAKECOMPENSATOR = "5e01ea19e9dc277128008c0b", - SILENCER_ROTOR_43_9X19_MUZZLE_BRAKECOMPENSATOR = "5a9fb739a2750c003215717f", + SILENCER_ROTOR_43_366_TKM_SOUND_SUPPRESSOR = "5a9fbb74a2750c0032157181", + SILENCER_ROTOR_43_556X45_SOUND_SUPPRESSOR = "5a9fbb84a2750c00137fa685", + SILENCER_ROTOR_43_762X39_SOUND_SUPPRESSOR = "5a9fbacda2750c00141e080f", + SILENCER_ROTOR_43_762X54R_SOUND_SUPPRESSOR = "5e01ea19e9dc277128008c0b", + SILENCER_ROTOR_43_9X19_SOUND_SUPPRESSOR = "5a9fb739a2750c003215717f", SILENCER_SIG_SAUER_SRD762QD_762X51_SOUND_SUPPRESSOR = "5fbe760793164a5b6278efc8", SILENCER_SIG_SAUER_SRD762TI_762X51_SOUND_SUPPRESSOR = "5fbe7618d6fa9c00c571bb6c", SILENCER_SIG_SAUER_SRD9_9X19_SOUND_SUPPRESSOR = "5c6165902e22160010261b28", SILENCER_SKS_HEXAGON_762X39_SOUND_SUPPRESSOR = "593d490386f7745ee97a1555", SILENCER_SR1MP_9X21_SOUND_SUPPRESSOR = "5a27b6bec4a282000e496f78", - SILENCER_SR2M_9X21_SOUND_SUPPRESSOR_SV1381 = "62e2a7138e1ac9380579c122", + SILENCER_SR2M_9X21_SV1381_SOUND_SUPPRESSOR = "62e2a7138e1ac9380579c122", + SILENCER_SR3M_9X39_SOUND_SUPPRESSOR = "65144ff50e00edc79406836f", SILENCER_STEYR_AUG_ASE_UTRA_S_SERIES_SL7I_556X45_SOUND_SUPPRESSOR = "634eba08f69c710e0108d386", SILENCER_STEYR_AUG_RELFEX_T4AUG_RANGER_556X45_SOUND_SUPPRESSOR = "630f2982cdb9e392db0cbcc7", SILENCER_SUREFIRE_SOCOM556MINI_MONSTER_556X45_SOUND_SUPPRESSOR = "55d6190f4bdc2d87028b4567", @@ -3426,7 +3607,8 @@ export declare enum ItemTpl { SILENCER_SV98_762X54R_SOUND_SUPPRESSOR = "5c4eecc32e221602b412b440", SILENCER_THUNDER_BEAST_ARMS_ULTRA_5_SOUND_SUPPRESSOR = "5d44064fa4b9361e4f6eb8b5", SILENCER_TT_762X25_MAKESHIFT_SOUND_SUPPRESSOR = "571a28e524597720b4066567", - SILENCER_VPO101_VEPRHUNTER_ROTOR_43_762X51_MUZZLE_BRAKECOMPENSATOR = "5f63407e1b231926f2329f15", + SILENCER_UZI_9X19_SOUND_SUPPRESSOR = "66993733f74fef4dfd0b04ff", + SILENCER_VPO101_ROTOR_43_762X51_SOUND_SUPPRESSOR = "5f63407e1b231926f2329f15", SILENCER_VSS_9X39_INTEGRAL_BARRELSUPPRESSOR = "57838c962459774a1651ec63", SMG_BT_MP9N_9X19_SUBMACHINE_GUN = "5de7bd7bfd6b4e6e2276dc25", SMG_BT_MP9_9X19_SUBMACHINE_GUN = "5e00903ae9dc277128008b87", @@ -3436,6 +3618,9 @@ export declare enum ItemTpl { SMG_HK_MP7A1_46X30_SUBMACHINE_GUN = "5ba26383d4351e00334c93d9", SMG_HK_MP7A2_46X30_SUBMACHINE_GUN = "5bd70322209c4d00d7167b8f", SMG_HK_UMP_45_ACP_SUBMACHINE_GUN = "5fc3e272f8b6a877a729eac5", + SMG_IWI_UZI_9X19_SUBMACHINE_GUN = "66992b349950f5f4cd06029f", + SMG_IWI_UZI_PRO_PISTOL_9X19_SUBMACHINE_GUN = "6680304edadb7aa61d00cef0", + SMG_IWI_UZI_PRO_SMG_9X19_SUBMACHINE_GUN = "668e71a8dadf42204c032ce1", SMG_PP1901_VITYAZ_9X19_SUBMACHINE_GUN = "59984ab886f7743e98271174", SMG_PP9101_KEDRB_9X18PM_SUBMACHINE_GUN = "57f3c6bd24597738e730fa2f", SMG_PP91_KEDR_9X18PM_SUBMACHINE_GUN = "57d14d2524597714373db789", @@ -3464,10 +3649,10 @@ export declare enum ItemTpl { SPECIALSCOPE_SIG_SAUER_ECHO1_12X30MM_30HZ_THERMAL_REFLEX_SCOPE = "6478641c19d732620e045e17", SPECIALSCOPE_TORREY_PINES_LOGIC_T12W_30HZ_THERMAL_REFLEX_SIGHT = "609bab8b455afd752b2e6138", SPECIALSCOPE_TRIJICON_REAPIR_THERMAL_SCOPE = "5a1eaa87fcdbcb001865f75e", - SPECITEM_LEATHERMAN_MULTITOOL = "544fb5454bdc2df8738b456a", SPECITEM_MS2000_MARKER = "5991b51486f77447b112d44f", SPECITEM_RADIO_REPEATER = "63a0b2eabea67a6d93009e52", SPECITEM_SIGNAL_JAMMER = "5ac78a9b86f7741cca0bbd8d", + SPECITEM_THE_EYE_MORTAR_STRIKE_SIGNALING_DEVICE = "6655e35b6bc645cb7b059912", SPECITEM_WIFI_CAMERA = "5b4391a586f7745321235ab2", STASH_EDGE_OF_DARKNESS_STASH_10X68 = "5811ce772459770e9e5f9532", STASH_LEFT_BEHIND_STASH_10X40 = "5811ce572459770cba1a34ea", @@ -3504,13 +3689,13 @@ export declare enum ItemTpl { STOCK_AI_AXMC_PISTOL_GRIP = "62811e2510e26c1f344e6554", STOCK_AK12 = "5beec8c20db834001d2c465c", STOCK_AK12_BUFFER_TUBE = "649ec87d8007560a9001ab36", - STOCK_AK545_SAG_BUFFER_TUBE = "628b9a40717774443b15e9f2", + STOCK_AK545_BUFFER_TUBE = "628b9a40717774443b15e9f2", STOCK_AK74MAK100_ZENIT_PT_LOCK = "5ac78eaf5acfc4001926317a", STOCK_AK74M_CAA_AKTS_AK74_BUFFER_TUBE = "5cf50fc5d7f00c056c53f83c", - STOCK_AK74M_POLYMER_STOCK_6P34_SB15 = "5ac50c185acfc400163398d4", - STOCK_AK74_PLUM_POLYMER_STOCK_6P20_SB7 = "5cbdb1b0ae9215000d50e105", - STOCK_AK74_POLYMER_STOCK_6P20_SB7 = "5649b0fc4bdc2d17108b4588", - STOCK_AK74_WOODEN_STOCK_6P20_SB5 = "5649b1c04bdc2d16268b457c", + STOCK_AK74M_POLYMER = "5ac50c185acfc400163398d4", + STOCK_AK74_POLYMER = "5649b0fc4bdc2d17108b4588", + STOCK_AK74_POLYMER_STOCK_PLUM = "5cbdb1b0ae9215000d50e105", + STOCK_AK74_WOODEN = "5649b1c04bdc2d16268b457c", STOCK_AKMAK74_CAA_AKTS_BUFFER_TUBE = "5cf518cfd7f00c065b422214", STOCK_AKMAK74_FAB_DEFENSE_UAS = "5b04473a5acfc40018632f70", STOCK_AKMAK74_HERA_ARMS_CQR47_PISTOL_GRIPBUTT = "619b69037b9de8162902673e", @@ -3520,15 +3705,16 @@ export declare enum ItemTpl { STOCK_AKMAK74_PROMAG_ARCHANGEL_OPFOR_AA47_BUTT = "6087e2a5232e5a31c233d552", STOCK_AKMAK74_RD_AK_TO_M4_BUFFER_TUBE_ADAPTER = "628a6678ccaab13006640e49", STOCK_AKMAK74_ZENIT_PT_LOCK = "5b222d335acfc4771e1be099", - STOCK_AKMSN_SHOULDER_PIECE_6P4N_SB119 = "5abcd472d8ce8700166032ae", - STOCK_AKMS_SHOULDER_PIECE_6P4_SB119 = "59ff3b6a86f77477562ff5ed", - STOCK_AKM_WOODEN_STOCK_6P1_SB5 = "59d6514b86f774171a068a08", + STOCK_AKMSN_FOLDING = "5abcd472d8ce8700166032ae", + STOCK_AKMS_FOLDING = "59ff3b6a86f77477562ff5ed", + STOCK_AKM_WOODEN = "59d6514b86f774171a068a08", STOCK_AKS74AKS74U_ZENIT_PT_LOCK = "59ecc28286f7746d7a68aa8c", - STOCK_AKS74U_METAL_SKELETON_STOCK_6P26_SB5 = "57dc347d245977596754e7a1", - STOCK_AKS74_METAL_SKELETONIZED_STOCK_6P21_SB5 = "5ab626e4d8ce87272e4c6e43", + STOCK_AKS74U_SKELETONIZED = "57dc347d245977596754e7a1", + STOCK_AKS74_SKELETONIZED = "5ab626e4d8ce87272e4c6e43", STOCK_AK_100SERIES_METAL_SKELETONIZED = "6386300124a1dc425c00577a", STOCK_AK_CUSTOM_ARMS_STEF_74_SKELETON_STOCK_EXTENSION = "6494094948796d891603e59f", STOCK_AK_GP25_ACCESSORY_KIT_RECOIL_PAD = "5a0c59791526d8dba737bba7", + STOCK_AK_SKELETONIZED_STOCK_CUSTOMIZED = "66ac9d9740e27931602042d4", STOCK_AK_ZENIT_PT1_KLASSIKA = "5b222d405acfc400153af4fe", STOCK_AK_ZENIT_PT3_KLASSIKA = "59ecc3dd86f7746dc827481c", STOCK_APB_DETACHABLE_WIRE = "5a17fb9dfcdbcbcae6687291", @@ -3624,6 +3810,9 @@ export declare enum ItemTpl { STOCK_M14_TROY_SASS_CHASSIS = "5ab372a310e891001717f0d8", STOCK_M1A_PROMAG_ARCHANGEL_CHASSIS = "5addbf175acfc408fb13965b", STOCK_M1A_SOCOM_16 = "5aaf8e43e5b5b00015693246", + STOCK_M60E4_BUTT = "660126161347bc1a5f0f4dba", + STOCK_M60E6_BUTT = "6615202b96461aa8360271eb", + STOCK_M60E6_BUTTSTOCK_FDE = "661520fb6f8e1a96340afaa6", STOCK_M700_AB_ARMS_MODX_BUFFER_TUBE_SIDE_FOLDER_ADAPTER = "5cde77a9d7f00c000f261009", STOCK_M700_AB_ARMS_MODX_GEN_3_CHASSIS = "5cde739cd7f00c0010373bd3", STOCK_M700_AI_AT_AICS_POLYMER_CHASSIS = "5d25d0ac8abbc3054f3e61f7", @@ -3636,11 +3825,9 @@ export declare enum ItemTpl { STOCK_M870_SHOCKWAVE_RAPTOR_GRIP = "5a788169c5856700142fdd9e", STOCK_M870_SPS_POLYMER = "5a7880d0c5856700142fdd9d", STOCK_MAGPUL_MOE_CARBINE_RUBBER_BUTTPAD = "58d2912286f7744e27117493", - STOCK_MCXMPX_FOLDING_STOCK_ADAPTER_BUFFER_TUBE_COYOTE_TAN = "6529366450dc782999054ba0", - STOCK_MCXMPX_STOCK_LOCKING_HINGE_ASSEMBLY = "6529348224cbe3c74a05e5c4", STOCK_MESA_TACTICAL_CROSSHAIR_HYDRAULIC_BUFFER_TUBE = "5ef1ba28c64c5d0dfc0571a5", STOCK_MOSIN_RIFLE_AIM_SPORTS_RECOIL_PAD = "5bbde409d4351e003562b036", - STOCK_MOSIN_RIFLE_ATI_MONTE_CARLO_CHASSIS = "5bbdb870d4351e00367fb67d", + STOCK_MOSIN_RIFLE_ATI_MONTE_CARLO = "5bbdb870d4351e00367fb67d", STOCK_MOSIN_RIFLE_CARBINE = "5bfd384c0db834001a6691d3", STOCK_MOSIN_RIFLE_INFANTRY = "5bfd35380db83400232fe5cc", STOCK_MOSIN_RIFLE_PROMAG_ARCHANGEL_OPFOR_PRS_CHASSIS = "5bae13bad4351e00320204af", @@ -3664,11 +3851,13 @@ export declare enum ItemTpl { STOCK_MP431C_BUTTPAD = "611a31ce5b7ffe001b4649d1", STOCK_MP9 = "5de910da8b6c4240ba2651b5", STOCK_MPXMCX_COLLAPSINGTELESCOPING = "5894a13e86f7742405482982", - STOCK_MPXMCX_LIGHTWEIGHT = "5fbcc437d724d907e2077d5c", - STOCK_MPXMCX_MAXIM_DEFENSE_CQB_TELESCOPING = "5c5db6ee2e221600113fba54", + STOCK_MPXMCX_FOLDING_KNUCKLE_STOCK_ADAPTER = "58ac1bf086f77420ed183f9f", + STOCK_MPXMCX_MAXIM_DEFENSE_CQB = "5c5db6ee2e221600113fba54", STOCK_MPXMCX_PMM_ULSS_FOLDABLE = "5c5db6f82e2216003a0fe914", - STOCK_MPXMCX_RETRACTABLE_STOCK_ADAPTER = "58ac1bf086f77420ed183f9f", - STOCK_MPXMCX_TELESCOPING = "5fbcc429900b1d5091531dd7", + STOCK_MPXMCX_STOCK_ADAPTER_LOW_PROFILE_TUBE_COYOTE_TAN = "6529366450dc782999054ba0", + STOCK_MPXMCX_STOCK_LOCKING_HINGE_ASSEMBLY = "6529348224cbe3c74a05e5c4", + STOCK_MPXMCX_TELESCOPINGFOLDING = "5fbcc429900b1d5091531dd7", + STOCK_MPXMCX_THIN_SIDEFOLDING = "5fbcc437d724d907e2077d5c", STOCK_MTS25512_WOODEN = "612781056f3d944a17348d60", STOCK_MTS_2001 = "5adf23995acfc400185c2aeb", STOCK_OPSKS_WOODEN = "587e0531245977466077a0f7", @@ -3687,7 +3876,7 @@ export declare enum ItemTpl { STOCK_SA58_FOLDING = "5b7d63cf5acfc4001876c8df", STOCK_SA58_HUMPBACK_POLYMER = "5b7d645e5acfc400170e2f90", STOCK_SA58_SPR = "5b7d63de5acfc400170e2f8d", - STOCK_SKS_ATI_MONTE_CARLO_CHASSIS = "653ecef836fae5a82f02b869", + STOCK_SKS_ATI_MONTE_CARLO = "653ecef836fae5a82f02b869", STOCK_SKS_FAB_DEFENSE_UAS_BUTT = "653ed132896b99b40a0292e6", STOCK_SKS_FAB_DEFENSE_UAS_CHASSIS = "5d0236dad7ad1a0940739d29", STOCK_SKS_TAPCO_INTRAFUSE_BUFFER_TUBE = "5afd7e095acfc40017541f61", @@ -3703,28 +3892,39 @@ export declare enum ItemTpl { STOCK_TOZ106 = "5a38ef1fc4a282000b1521f6", STOCK_TOZ106_CUSTOM_CUT_MOSIN = "5c99f3592e221644fc633070", STOCK_TOZ106_FAB_DEFENSE_GPCP_CHEEK_REST = "626a8ae89e664a2e2a75f409", - STOCK_VPO101_VEPRHUNTER = "5c503af12e221602b177ca02", - STOCK_VPO101_VEPRHUNTER_SVDSTYLE = "5f63405df5750b524b45f114", + STOCK_UZI_PRO_A3_TACTICAL_MODULAR_FOLDING_BRACE = "6686717ffb75ee4a5e02eb19", + STOCK_UZI_PRO_A3_TACTICAL_REAR_STOCK_ADAPTER = "668672b8c99550c6fd0f0b29", + STOCK_UZI_PRO_BACKPLATE = "66881008f23233ee9a0742e7", + STOCK_UZI_PRO_CSM_STOCK_ADAPTER = "669cf78806768ff39504fc1c", + STOCK_UZI_PRO_SBR_BUTT = "66867310f3734a938b077f79", + STOCK_UZI_PRO_STABILIZING_BRACE = "668032ba74b8f2050c0b917d", + STOCK_UZI_STORMWERKZ_STOCK_ADAPTER = "66992f4db9f31ddda10dd1c8", + STOCK_UZI_TYPE_3_BUTT = "6698c9ed36ba38d291017713", + STOCK_UZI_TYPE_5_BUTT = "6699249f3c4fda6471005cba", + STOCK_UZI_TYPE_6_BUTT = "669924a69950f5f4cd060295", + STOCK_UZI_TYPE_7_BUTT = "6698c9e07356874dfe0a0b88", + STOCK_VPO101_SVDSTYLE_WALNUT = "5f63405df5750b524b45f114", + STOCK_VPO101_WOODEN = "5c503af12e221602b177ca02", STOCK_VPO136_VEPRKM_WOODEN = "59e6227d86f77440d64f5dc2", STOCK_VPO209_WOODEN = "59e89d0986f77427600d226e", - STOCK_VPO215_GORNOSTAY = "5de655be4a9f347bc92edb88", + STOCK_VPO215_WOODEN = "5de655be4a9f347bc92edb88", STOCK_VSK94 = "6452519e3d52156624001fd5", STOCK_VSS_WOODEN = "578395e82459774a0e553c7b", - TACTICALCOMBO_ANPEQ15_TACTICAL_DEVICE = "544909bb4bdc2d6f028b4577", - TACTICALCOMBO_ANPEQ2_TACTICAL_DEVICE = "5d10b49bd7ad1a1a560708b0", + TACTICALCOMBO_BE_MEYERS_MAWLC1_TACTICAL_DEVICE = "644a3df63b0b6f03e101e065", TACTICALCOMBO_GLOCK_GTL_21_TACTICAL_FLASHLIGHT_WITH_LASER = "5a800961159bd4315e3a1657", TACTICALCOMBO_HOLOSUN_LS321_TACTICAL_DEVICE = "57fd23e32459772d0805bcf1", + TACTICALCOMBO_INSIGHT_ANPEQ2_TACTICAL_DEVICE = "5d10b49bd7ad1a1a560708b0", TACTICALCOMBO_INSIGHT_WMX200_TACTICAL_FLASHLIGHT = "626becf9582c3e319310b837", - TACTICALCOMBO_LA5BPEQ_TACTICAL_DEVICE = "5c06595c0db834001a66af6c", - TACTICALCOMBO_MAWLC1_TACTICAL_DEVICE = "644a3df63b0b6f03e101e065", - TACTICALCOMBO_NCSTAR_TACTICAL_BLUE_LASER_LAMMODULE = "5cc9c20cd7f00c001336c65d", + TACTICALCOMBO_L3HARRIS_ANPEQ15_TACTICAL_DEVICE = "544909bb4bdc2d6f028b4577", + TACTICALCOMBO_L3HARRIS_LA5BPEQ_TACTICAL_DEVICE = "5c06595c0db834001a66af6c", + TACTICALCOMBO_NCSTAR_TACTICAL_BLUE_LASER = "5cc9c20cd7f00c001336c65d", TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER = "6272370ee4013c5d7e31f418", TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER_TAN = "6272379924e29f06af4d5ecb", TACTICALCOMBO_STEINER_DBALPL_TACTICAL_DEVICE = "5d2369418abbc306c62e0c80", TACTICALCOMBO_STEINER_LASTAC_2_TACTICAL_FLASHLIGHT = "5b07dd285acfc4001754240d", TACTICALCOMBO_SUREFIRE_X400_ULTRA_TACTICAL_FLASHLIGHT_WITH_LASER = "56def37dd2720bec348b456a", TACTICALCOMBO_SUREFIRE_XC1_TACTICAL_FLASHLIGHT = "5a7b483fe899ef0016170d15", - TACTICALCOMBO_TT_DLP_TACTICAL_PRECISION_LAMMODULE = "5c079ed60db834001a66b372", + TACTICALCOMBO_TT_DLP_TACTICAL_PRECISION_LASER_SIGHT = "5c079ed60db834001a66b372", TACTICALCOMBO_WILCOX_RAPTAR_ES_TACTICAL_RANGEFINDER = "61605d88ffa6e502ac5e7eeb", TACTICALCOMBO_ZENIT_KLESCH2IKS_IR_ILLUMINATOR_WITH_LASER = "5a5f1ce64f39f90b401987bc", TACTICALCOMBO_ZENIT_KLESCH2P_FLASHLIGHT_WITH_LASER = "560d657b4bdc2da74d8b4572", @@ -3774,6 +3974,9 @@ export declare enum ItemTpl { VEST_SS_PRECISION_PLATEFRAME_PLATE_CARRIER_GOONS_EDITION = "628b9784bcf6e2659e09b8a2", VEST_STICH_PROFI_CHEST_RIG_MK2_ASSAULT_ATACS_FG = "60a621c49c197e4e8c4455e6", VEST_STICH_PROFI_CHEST_RIG_MK2_RECON_ATACS_FG = "60a6220e953894617404b00a", + VEST_STICH_PROFI_PLATE_CARRIER_V2_BLACK = "66b6296d7994640992013b17", + VEST_STICH_PROFI_STICH_DEFENSE_MOD2_PLATE_CARRIER_MULTICAM = "66b6295178bbc0200425f995", + VEST_TASMANIAN_TIGER_PLATE_CARRIER_MKIII_COYOTE_BROWN = "66b6295a8ca68c6461709efa", VEST_TASMANIAN_TIGER_SK_PLATE_CARRIER_MULTICAM_BLACK = "628cd624459354321c4b7fa2", VEST_TYPE_56_CHICOM_CHEST_HARNESS = "64be7110bf597ba84a0a41ea", VEST_UMKA_M33SET1_HUNTER_VEST_OLIVE_DRAB = "6034cf5fffd42c541047f72e", @@ -3786,8 +3989,8 @@ export declare enum ItemTpl { VEST_ZULU_NYLON_GEAR_M4_REDUCED_SIGNATURE_CHEST_RIG_RANGER_GREEN = "64be7095047e826eae02b0c1", VISORS_6B34_ANTIFRAGMENTATION_GLASSES = "5b432be65acfc433000ed01f", VISORS_ANTIFRAGMENTATION_GLASSES = "59e770b986f7742cbd762754", - VISORS_CROSSBOW_TACTICAL_GLASSES = "5d5fca1ea4b93635fd598c07", VISORS_DUNDUKK_SPORT_SUNGLASSES = "5aa2b986e5b5b00014028f4c", + VISORS_ESS_CROSSBOW_TACTICAL_GLASSES = "5d5fca1ea4b93635fd598c07", VISORS_GAS_WELDER_SAFETY_GOGGLES = "61c18d83b00456371a66814b", VISORS_JOHNB_LIQUID_DNB_GLASSES = "62a09e410b9d3c46de5b6e78", VISORS_NPP_KLASS_CONDOR_GLASSES = "603409c80ca681766b6a0fb2", diff --git a/types/models/enums/QuestRewardType.d.ts b/types/models/enums/QuestRewardType.d.ts index 3f01040..e09f71d 100644 --- a/types/models/enums/QuestRewardType.d.ts +++ b/types/models/enums/QuestRewardType.d.ts @@ -9,5 +9,6 @@ export declare enum QuestRewardType { TRADER_STANDING_RESET = "TraderStandingReset", TRADER_STANDING_RESTORE = "TraderStandingRestore", STASH_ROWS = "StashRows", - ACHIEVEMENT = "Achievement" + ACHIEVEMENT = "Achievement", + POCKETS = "Pockets" } diff --git a/types/models/enums/TraderServiceType.d.ts b/types/models/enums/TraderServiceType.d.ts index f3586dc..f0ca76d 100644 --- a/types/models/enums/TraderServiceType.d.ts +++ b/types/models/enums/TraderServiceType.d.ts @@ -4,5 +4,6 @@ export declare enum TraderServiceType { CULTISTS_AID = "CultistsAid", BTR_ITEMS_DELIVERY = "BtrItemsDelivery", PLAYER_TAXI = "PlayerTaxi", - BTR_BOT_COVER = "BtrBotCover" + BTR_BOT_COVER = "BtrBotCover", + TRANSIT_ITEMS_DELIVERY = "TransitItemsDelivery" } diff --git a/types/models/enums/Weapons.d.ts b/types/models/enums/Weapons.d.ts index 178bc68..ff0ca8e 100644 --- a/types/models/enums/Weapons.d.ts +++ b/types/models/enums/Weapons.d.ts @@ -6,6 +6,7 @@ export declare enum Weapons { ASSAULTCARBINE_762X54R_SVT_40 = "643ea5b23db6f9f57107d9fd", ASSAULTCARBINE_9X39_9A_91 = "644674a13d52156624001fbc", ASSAULTCARBINE_9X39_AS_VAL = "57c44b372459772d2b39b8ce", + ASSAULTCARBINE_9X39_SR_3M = "651450ce0e00edc794068371", ASSAULTCARBINE_9X39_VSK_94 = "645e0c6b3b381ede770e1cc9", ASSAULTRIFLE_127X55_ASH_12 = "5cadfbf7ae92152ac412eeef", ASSAULTRIFLE_366TKM_VPO_209 = "59e6687d86f77411d949b251", @@ -49,9 +50,11 @@ export declare enum Weapons { ASSAULTRIFLE_762X51_MK_17_FDE = "6165ac306ef05c2ce828ef74", ASSAULTRIFLE_762X51_SA_58 = "5b0bbe4e5acfc40dc528a72d", ASSAULTRIFLE_9X18PM_MASTER_HAND = "5ae083b25acfc4001a5fc702", + FLARE_26X75_BLUE = "66d98233302686954b0c6f81", FLARE_26X75_FLARE_WHITE = "62178be9d0050232da3485d9", FLARE_26X75_GREEN = "6217726288ed9f0845317459", FLARE_26X75_RED = "62178c4d4ecf221597654e3d", + FLARE_26X75_S_YELLOW_SPECIAL_YELLOW = "66d9f1abb16d9aacf5068468", FLARE_26X75_YELLOW = "624c0b3340357b5f566e8766", GRENADELAUNCHER_40MMRU_FN40GL = "639af924d0446708ee62294e", GRENADELAUNCHER_40X46_FN40GL = "5e81ebcd8e146c7080625e15", @@ -61,6 +64,9 @@ export declare enum Weapons { MACHINEGUN_545X39_RPK_16 = "5beed0f50db834001c062b12", MACHINEGUN_762X39_RPD = "6513ef33e06849f06c0957ca", MACHINEGUN_762X39_RPDN = "65268d8ecb944ff1e90ea385", + MACHINEGUN_762X51_M60E6 = "661ceb1b9311543c7104149b", + MACHINEGUN_762X51_M60E6_FDE = "661cec09b2c6356b4d0c7a36", + MACHINEGUN_762X51_MK_43_MOD_1 = "65fb023261d5829b2d090755", MACHINEGUN_762X54R_PKM = "64637076203536ad5600c990", MACHINEGUN_762X54R_PKP = "64ca3d3954fc657e230529cc", MACHINEGUN_762X54R_PKTM = "657857faeff4c850222dff1b", @@ -72,6 +78,10 @@ export declare enum Weapons { MARKSMANRIFLE_762X54R_SVDS = "5c46fbd72e2216398b5a8c9c", MARKSMANRIFLE_86X70_MK_18_MJLNIR = "5fc22d7c187fea44d52eda44", MARKSMANRIFLE_9X39_VSS_VINTOREZ = "57838ad32459774a17445cd2", + PISTOL_127X33_DESERT_EAGLE_L5 = "669fa3f88abd2662d80eee77", + PISTOL_127X33_DESERT_EAGLE_L6 = "669fa39b48fc9f8db6035a0c", + PISTOL_127X33_DESERT_EAGLE_L6_WTS = "669fa3d876116c89840b1217", + PISTOL_127X33_DESERT_EAGLE_MK_XIX = "668fe5a998b5ad715703ddd6", PISTOL_20X1MM_BLICKY = "66015072e9f84d5680039678", PISTOL_45ACP_M1911A1 = "5e81c3cbac2bb513793cdc75", PISTOL_45ACP_M45A1 = "5f36a0e5fbf956000b716b65", @@ -93,6 +103,7 @@ export declare enum Weapons { PISTOL_9X19_P226R = "56d59856d2720bd8418b456a", PISTOL_9X19_PL_15 = "602a9740da11d6478d5a06dc", PISTOL_9X21_SR_1MP = "59f98b4986f7746f546d2cef", + PISTOL_9X33R_DESERT_EAGLE_L5 = "669fa409933e898cce0c2166", REVOLVER_127X55_RSH_12 = "633ec7c2a6918cb895019c6c", REVOLVER_12G_MTS_255_12 = "60db29ce99594040e04c4a27", REVOLVER_40X46_MSGL = "6275303a9f372d6ea97f9ec7", @@ -128,6 +139,9 @@ export declare enum Weapons { SMG_9X19_PP_19_01 = "59984ab886f7743e98271174", SMG_9X19_SAIGA_9 = "59f9cabd86f7743a10721f46", SMG_9X19_STM_9 = "60339954d62c9b14ed777c06", + SMG_9X19_UZI = "66992b349950f5f4cd06029f", + SMG_9X19_UZI_PRO_PISTOL = "6680304edadb7aa61d00cef0", + SMG_9X19_UZI_PRO_SMG = "668e71a8dadf42204c032ce1", SMG_9X19_VECTOR_9X19 = "5fc3f2d5900b1d5091531e57", SMG_9X21_SR_2M = "62e14904c2699c0ec93adc47", SNIPERRIFLE_366TKM_VPO_215_GORNOSTAY = "5de652c31b7e3716273428be", diff --git a/types/models/enums/WildSpawnTypeNumber.d.ts b/types/models/enums/WildSpawnTypeNumber.d.ts index 19d0062..ab823cc 100644 --- a/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/types/models/enums/WildSpawnTypeNumber.d.ts @@ -45,12 +45,14 @@ export declare enum WildSpawnTypeNumber { FOLLOWERKOLONTAYASSAULT = 44, FOLLOWERKOLONTAYSECURITY = 45, SHOOTERBTR = 46, - SPIRITWINTER = 47, - SPIRITSPRING = 48, - PMCBEAR = 49, - PMCUSEC = 50, - SKIER = 51, - PEACEMAKER = 52, - SPTUSEC = 100, - SPTBEAR = 101 + BOSSPARTISAN = 47, + SPIRITWINTER = 48, + SPIRITSPRING = 49, + PEACEMAKER = 50, + PMCBEAR = 51, + PMCUSEC = 52, + SKIER = 53, + SECTANTPREDVESTNIK = 57, + SECTANTPRIZRAK = 58, + SECTANTONI = 59 } diff --git a/types/models/enums/hideout/QteEffectType.d.ts b/types/models/enums/hideout/QteEffectType.d.ts index 9ecd1a2..08aa9c6 100644 --- a/types/models/enums/hideout/QteEffectType.d.ts +++ b/types/models/enums/hideout/QteEffectType.d.ts @@ -1,5 +1,5 @@ export declare enum QteEffectType { - FINISH_EFFECT = "FinishEffect", - SINGLE_SUCCESS_EFFECT = "SingleSuccessEffect", - SINGLE_FAIL_EFFECT = "SingleFailEffect" + FINISH_EFFECT = "finishEffect", + SINGLE_SUCCESS_EFFECT = "singleSuccessEffect", + SINGLE_FAIL_EFFECT = "singleFailEffect" } diff --git a/types/models/external/HttpFramework.d.ts b/types/models/external/HttpFramework.d.ts index fda8732..96fb4ed 100644 --- a/types/models/external/HttpFramework.d.ts +++ b/types/models/external/HttpFramework.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; /** @@ -6,7 +5,9 @@ export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) = * @param basePath The base path * @returns The decorator that create the listener proxy */ -export declare const Listen: (basePath: string) => any>(Base: T) => T; +export declare const Listen: (basePath: string) => (Base: T) => T; /** * HTTP DELETE decorator */ diff --git a/types/models/spt/bots/BotGenerationDetails.d.ts b/types/models/spt/bots/BotGenerationDetails.d.ts index 3977ee5..81acc7d 100644 --- a/types/models/spt/bots/BotGenerationDetails.d.ts +++ b/types/models/spt/bots/BotGenerationDetails.d.ts @@ -1,5 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; -export interface BotGenerationDetails { +export interface IBotGenerationDetails { /** Should the bot be generated as a PMC */ isPmc: boolean; /** assault/pmcBot etc */ diff --git a/types/models/spt/bots/GenerateWeaponResult.d.ts b/types/models/spt/bots/GenerateWeaponResult.d.ts deleted file mode 100644 index d4a2526..0000000 --- a/types/models/spt/bots/GenerateWeaponResult.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Mods } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -export declare class GenerateWeaponResult { - weapon: Item[]; - chosenAmmoTpl: string; - chosenUbglAmmoTpl: string; - weaponMods: Mods; - weaponTemplate: ITemplateItem; -} diff --git a/types/models/spt/bots/IGenerateEquipmentProperties.d.ts b/types/models/spt/bots/IGenerateEquipmentProperties.d.ts index 9cf7685..e19a9e0 100644 --- a/types/models/spt/bots/IGenerateEquipmentProperties.d.ts +++ b/types/models/spt/bots/IGenerateEquipmentProperties.d.ts @@ -1,22 +1,22 @@ -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Chances, Mods } from "@spt/models/eft/common/tables/IBotType"; -import { EquipmentFilters, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IChances, IMods } from "@spt/models/eft/common/tables/IBotType"; +import { EquipmentFilters, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { IBotData } from "./IGenerateWeaponRequest"; export interface IGenerateEquipmentProperties { /** Root Slot being generated */ rootEquipmentSlot: string; /** Equipment pool for root slot being generated */ rootEquipmentPool: Record; - modPool: Mods; + modPool: IMods; /** Dictionary of mod items and their chance to spawn for this bot type */ - spawnChances: Chances; - /** Role being generated for */ - botRole: string; - /** Level of bot being generated */ - botLevel: number; + spawnChances: IChances; + /** Bot-specific properties */ + botData: IBotData; inventory: PmcInventory; botEquipmentConfig: EquipmentFilters; /** Settings from bot.json to adjust how item is generated */ - randomisationDetails: RandomisationDetails; + randomisationDetails: IRandomisationDetails; /** OPTIONAL - Do not generate mods for tpls in this array */ generateModsBlacklist?: string[]; + generatingPlayerLevel: number; } diff --git a/types/models/spt/bots/IGenerateWeaponRequest.d.ts b/types/models/spt/bots/IGenerateWeaponRequest.d.ts index 4bc8adf..3be9412 100644 --- a/types/models/spt/bots/IGenerateWeaponRequest.d.ts +++ b/types/models/spt/bots/IGenerateWeaponRequest.d.ts @@ -1,18 +1,18 @@ -import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IMods, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { BotModLimits } from "@spt/services/BotWeaponModLimitService"; export interface IGenerateWeaponRequest { /** Weapon to add mods to / result that is returned */ - weapon: Item[]; + weapon: IItem[]; /** Pool of compatible mods to attach to weapon */ - modPool: Mods; + modPool: IMods; /** ParentId of weapon */ weaponId: string; /** Weapon which mods will be generated on */ parentTemplate: ITemplateItem; /** Chance values mod will be added */ - modSpawnChances: ModsChances; + modSpawnChances: IModsChances; /** Ammo tpl to use when generating magazines/cartridges */ ammoTpl: string; /** Bot-specific properties */ @@ -21,6 +21,8 @@ export interface IGenerateWeaponRequest { modLimits: BotModLimits; /** Info related to the weapon being generated */ weaponStats: IWeaponStats; + /** Array of item tpls the weapon does not support */ + conflictingItemTpls: Set; } export interface IBotData { /** Role of bot weapon is generated for */ diff --git a/types/models/spt/bots/IGenerateWeaponResult.d.ts b/types/models/spt/bots/IGenerateWeaponResult.d.ts new file mode 100644 index 0000000..8e1e318 --- /dev/null +++ b/types/models/spt/bots/IGenerateWeaponResult.d.ts @@ -0,0 +1,10 @@ +import { IMods } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +export interface IGenerateWeaponResult { + weapon: IItem[]; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; + weaponMods: IMods; + weaponTemplate: ITemplateItem; +} diff --git a/types/models/spt/bots/IModToSpawnRequest.d.ts b/types/models/spt/bots/IModToSpawnRequest.d.ts index 58e9a1d..b34bda8 100644 --- a/types/models/spt/bots/IModToSpawnRequest.d.ts +++ b/types/models/spt/bots/IModToSpawnRequest.d.ts @@ -1,8 +1,8 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; -import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; -import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; +import { IBotData, IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; +import { IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; export interface IModToSpawnRequest { /** Slot mod will fit into */ modSlot: string; @@ -11,11 +11,11 @@ export interface IModToSpawnRequest { /** Parent slot the item will be a part of */ botWeaponSightWhitelist: Record; /** Blacklist to prevent mods from being picked */ - botEquipBlacklist: EquipmentFilterDetails; + botEquipBlacklist: IEquipmentFilterDetails; /** Pool of items to pick from */ itemModPool: Record; /** Array with only weapon tpl in it, ready for mods to be added */ - weapon: Item[]; + weapon: IItem[]; /** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */ ammoTpl: string; /** Parent item the mod will go into */ @@ -24,4 +24,7 @@ export interface IModToSpawnRequest { modSpawnResult: ModSpawn; /** Weapon stats for weapon being generated */ weaponStats: IWeaponStats; + /** Array of item tpls the weapon does not support */ + conflictingItemTpls: Set; + botData: IBotData; } diff --git a/types/models/spt/callbacks/IDialogueCallbacks.d.ts b/types/models/spt/callbacks/IDialogueCallbacks.d.ts index b30c042..2ff36dc 100644 --- a/types/models/spt/callbacks/IDialogueCallbacks.d.ts +++ b/types/models/spt/callbacks/IDialogueCallbacks.d.ts @@ -14,11 +14,11 @@ import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest" import { ISetDialogReadRequestData } from "@spt/models/eft/dialog/ISetDialogReadRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { DialogueInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile"; export interface IDialogueCallbacks { getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; - getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; + getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData; getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData; diff --git a/types/models/spt/callbacks/IInraidCallbacks.d.ts b/types/models/spt/callbacks/IInraidCallbacks.d.ts deleted file mode 100644 index b267942..0000000 --- a/types/models/spt/callbacks/IInraidCallbacks.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; -import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; -import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -export interface IInraidCallbacks { - onLoad(sessionID: string): ISptProfile; - registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData; - saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData; - getRaidEndState(): string; - getRaidMenuSettings(url: string, info: IEmptyRequestData, sessionID: string): string; - getWeaponDurability(url: string, info: any, sessionID: string): string; - getAirdropConfig(url: string, info: any, sessionID: string): string; -} diff --git a/types/models/spt/callbacks/IWishlistCallbacks.d.ts b/types/models/spt/callbacks/IWishlistCallbacks.d.ts deleted file mode 100644 index 16f056d..0000000 --- a/types/models/spt/callbacks/IWishlistCallbacks.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IWishlistActionData } from "@spt/models/eft/wishlist/IWishlistActionData"; -export interface IWishlistCallbacks { - addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; - removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; -} diff --git a/types/models/spt/config/IAirdropConfig.d.ts b/types/models/spt/config/IAirdropConfig.d.ts index d438f00..ceca3cc 100644 --- a/types/models/spt/config/IAirdropConfig.d.ts +++ b/types/models/spt/config/IAirdropConfig.d.ts @@ -1,31 +1,15 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +import { AirdropTypeEnum, SptAirdropTypeEnum } from "@spt/models/enums/AirdropType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IAirdropConfig extends IBaseConfig { kind: "spt-airdrop"; - airdropChancePercent: AirdropChancePercent; - airdropTypeWeightings: Record; - /** Lowest point plane will fly at */ - planeMinFlyHeight: number; - /** Highest point plane will fly at */ - planeMaxFlyHeight: number; - /** Loudness of plane engine */ - planeVolume: number; - /** Speed plane flies overhead */ - planeSpeed: number; - /** Speed loot crate falls after being dropped */ - crateFallSpeed: number; - /** Container tpls to use when spawning crate - affects container size, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ - containerIds: Record; - /** Earliest time aircraft will spawn in raid */ - airdropMinStartTimeSeconds: number; - /** Latest time aircraft will spawn in raid */ - airdropMaxStartTimeSeconds: number; + airdropTypeWeightings: Record; /** What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ - loot: Record; + loot: Record; + customAirdropMapping: Record; } /** Chance map will have an airdrop occur out of 100 - locations not included count as 0% */ -export interface AirdropChancePercent { +export interface IAirdropChancePercent { bigmap: number; woods: number; lighthouse: number; @@ -36,7 +20,8 @@ export interface AirdropChancePercent { sandbox: number; } /** Loot inside crate */ -export interface AirdropLoot { +export interface IAirdropLoot { + icon: AirdropTypeEnum; /** Min/max of weapons inside crate */ weaponPresetCount?: MinMax; /** Min/max of armors (head/chest/rig) inside crate */ @@ -57,4 +42,6 @@ export interface AirdropLoot { armorLevelWhitelist?: number[]; /** Should boss items be added to airdrop crate */ allowBossItems: boolean; + useForcedLoot?: boolean; + forcedLoot?: Record; } diff --git a/types/models/spt/config/IBTRConfig.d.ts b/types/models/spt/config/IBTRConfig.d.ts deleted file mode 100644 index 2f56f73..0000000 --- a/types/models/spt/config/IBTRConfig.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MinMax } from "@spt/models/common/MinMax"; -import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; -export interface IBTRConfig extends IBaseConfig { - kind: "spt-btr"; - /** How fast the BTR moves */ - moveSpeed: number; - /** How long the cover fire service lasts for */ - coverFireTime: number; - /** How long the BTR waits at every point in its path */ - pointWaitTime: MinMax; - /** How long after purchasing the taxi service before the BTR leaves */ - taxiWaitTime: number; -} diff --git a/types/models/spt/config/IBotConfig.d.ts b/types/models/spt/config/IBotConfig.d.ts index b8c782a..51a82b3 100644 --- a/types/models/spt/config/IBotConfig.d.ts +++ b/types/models/spt/config/IBotConfig.d.ts @@ -1,11 +1,11 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; import { IBotDurability } from "@spt/models/spt/config/IBotDurability"; export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ - presetBatch: PresetBatch; + presetBatch: IPresetBatch; /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ @@ -44,6 +44,10 @@ export interface IBotConfig extends IBaseConfig { /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ disableLootOnBotTypes: string[]; assaultToBossConversion: IAssaultToBossConversion; + /** Max length a bots name can be */ + botNameLengthLimit: number; + /** Bot roles that must have a unique name when generated vs other bots in raid */ + botRolesThatMustHaveUniqueName: string[]; } export interface IAssaultToBossConversion { bossConvertEnabled: boolean; @@ -51,7 +55,7 @@ export interface IAssaultToBossConversion { bossConvertMinMax: Record; } /** Number of bots to generate and store in cache on raid start per bot type */ -export interface PresetBatch { +export interface IPresetBatch { assault: number; bossBully: number; bossGluhar: number; @@ -100,7 +104,7 @@ export interface IWalletLootSettings { } export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ - weaponModLimits: ModLimits; + weaponModLimits: IModLimits; /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; /** Chance face shield is down/active */ @@ -121,29 +125,30 @@ export interface EquipmentFilters { /** What additional slot ids should be seen as required when choosing a mod to add to a weapon */ weaponSlotIdsToMakeRequired?: string[]; /** Adjust weighting/chances of items on bot by level of bot */ - randomisation: RandomisationDetails[]; + randomisation: IRandomisationDetails[]; /** Blacklist equipment by level of bot */ - blacklist: EquipmentFilterDetails[]; + blacklist: IEquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ - whitelist: EquipmentFilterDetails[]; + whitelist: IEquipmentFilterDetails[]; /** Adjust equipment/ammo */ - weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + weightingAdjustmentsByBotLevel: IWeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ - weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + weightingAdjustmentsByPlayerLevel?: IWeightingAdjustmentDetails[]; /** Should the stock mod be forced to spawn on bot */ forceStock?: boolean; armorPlateWeighting?: IArmorPlateWeights[]; + forceRigWhenNoVest?: boolean; } -export interface ModLimits { +export interface IModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ scopeLimit?: number; /** How many lasers or lights are allowed on a weapon - hard coded to work with TACTICAL_COMBO, and FLASHLIGHT */ lightLaserLimit?: number; } -export interface RandomisationDetails { +export interface IRandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomised -ignores mods from bottype.json and instaed creates a pool using items.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ @@ -154,8 +159,13 @@ export interface RandomisationDetails { weaponMods?: Record; /** Equipment mod chances */ equipmentMods?: Record; + nighttimeChanges?: INighttimeChanges; } -export interface EquipmentFilterDetails { +export interface INighttimeChanges { + /** Applies changes to values stored in equipmentMods */ + equipmentModsModifiers: Record; +} +export interface IEquipmentFilterDetails { /** Between what levels do these equipment filter setting apply to */ levelRange: MinMax; /** Key: mod slot name e.g. mod_magazine, value: item tpls */ @@ -163,7 +173,7 @@ export interface EquipmentFilterDetails { /** Key: cartridge type e.g. Caliber23x75, value: item tpls */ cartridge: Record; } -export interface WeightingAdjustmentDetails { +export interface IWeightingAdjustmentDetails { /** Between what levels do these weight settings apply to */ levelRange: MinMax; /** Key: ammo type e.g. Caliber556x45NATO, value: item tpl + weight */ diff --git a/types/models/spt/config/IBotDurability.d.ts b/types/models/spt/config/IBotDurability.d.ts index 728db97..b7103e1 100644 --- a/types/models/spt/config/IBotDurability.d.ts +++ b/types/models/spt/config/IBotDurability.d.ts @@ -1,45 +1,45 @@ export interface IBotDurability { - default: DefaultDurability; - pmc: PmcDurability; - boss: BotDurability; - follower: BotDurability; - assault: BotDurability; - cursedassault: BotDurability; - marksman: BotDurability; - pmcbot: BotDurability; - arenafighterevent: BotDurability; - arenafighter: BotDurability; - crazyassaultevent: BotDurability; - exusec: BotDurability; - gifter: BotDurability; - sectantpriest: BotDurability; - sectantwarrior: BotDurability; + default: IDefaultDurability; + pmc: IPmcDurability; + boss: IBotDurability; + follower: IBotDurability; + assault: IBotDurability; + cursedassault: IBotDurability; + marksman: IBotDurability; + pmcbot: IBotDurability; + arenafighterevent: IBotDurability; + arenafighter: IBotDurability; + crazyassaultevent: IBotDurability; + exusec: IBotDurability; + gifter: IBotDurability; + sectantpriest: IBotDurability; + sectantwarrior: IBotDurability; } /** Durability values to be used when a more specific bot type cant be found */ -export interface DefaultDurability { - armor: ArmorDurability; - weapon: WeaponDurability; +export interface IDefaultDurability { + armor: IArmorDurability; + weapon: IWeaponDurability; } -export interface PmcDurability { - armor: PmcDurabilityArmor; - weapon: WeaponDurability; +export interface IPmcDurability { + armor: IPmcDurabilityArmor; + weapon: IWeaponDurability; } -export interface PmcDurabilityArmor { +export interface IPmcDurabilityArmor { lowestMaxPercent: number; highestMaxPercent: number; maxDelta: number; minDelta: number; } -export interface BotDurability { - armor: ArmorDurability; - weapon: WeaponDurability; +export interface IBotDurability { + armor: IArmorDurability; + weapon: IWeaponDurability; } -export interface ArmorDurability { +export interface IArmorDurability { maxDelta: number; minDelta: number; minLimitPercent: number; } -export interface WeaponDurability { +export interface IWeaponDurability { lowestMax: number; highestMax: number; maxDelta: number; diff --git a/types/models/spt/config/ICoreConfig.d.ts b/types/models/spt/config/ICoreConfig.d.ts index 6d086f7..39c4f18 100644 --- a/types/models/spt/config/ICoreConfig.d.ts +++ b/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IServerFeatures { } export interface IChatbotFeatures { sptFriendEnabled: boolean; + sptFriendGiftsEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; commandUseLimits: Record; diff --git a/types/models/spt/config/IGiftsConfig.d.ts b/types/models/spt/config/IGiftsConfig.d.ts index 736c4b7..4a9450e 100644 --- a/types/models/spt/config/IGiftsConfig.d.ts +++ b/types/models/spt/config/IGiftsConfig.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { GiftSenderType } from "@spt/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; @@ -7,11 +7,11 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; import { IProfileChangeEvent } from "@spt/models/spt/dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "spt-gifts"; - gifts: Record; + gifts: Record; } -export interface Gift { +export interface IGift { /** Items to send to player */ - items: Item[]; + items: IItem[]; /** Who is sending the gift to player */ sender: GiftSenderType; /** Optinal - supply a users id to send from, not necessary when sending from SYSTEM or TRADER */ diff --git a/types/models/spt/config/IHealthConfig.d.ts b/types/models/spt/config/IHealthConfig.d.ts index b86c208..f7521ca 100644 --- a/types/models/spt/config/IHealthConfig.d.ts +++ b/types/models/spt/config/IHealthConfig.d.ts @@ -1,14 +1,14 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IHealthConfig extends IBaseConfig { kind: "spt-health"; - healthMultipliers: HealthMultipliers; - save: Save; + healthMultipliers: IHealthMultipliers; + save: ISave; } -export interface HealthMultipliers { +export interface IHealthMultipliers { death: number; blacked: number; } -export interface Save { +export interface ISave { health: boolean; effects: boolean; } diff --git a/types/models/spt/config/IHideoutConfig.d.ts b/types/models/spt/config/IHideoutConfig.d.ts index c1967c0..5257777 100644 --- a/types/models/spt/config/IHideoutConfig.d.ts +++ b/types/models/spt/config/IHideoutConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "@spt/models/common/MinMax"; import { IBaseConfig, IRunIntervalValues } from "@spt/models/spt/config/IBaseConfig"; export interface IHideoutConfig extends IBaseConfig { kind: "spt-hideout"; @@ -11,4 +12,28 @@ export interface IHideoutConfig extends IBaseConfig { overrideBuildTimeSeconds: number; /** Only process a profiles hideout crafts when it has been active in the last x minutes */ updateProfileHideoutWhenActiveWithinMinutes: number; + cultistCircle: ICultistCircleSettings; +} +export interface ICultistCircleSettings { + maxRewardItemCount: number; + maxAttemptsToPickRewardsWithinBudget: number; + rewardPriceMultiplerMinMax: MinMax; + craftTimeThreshholds: ICraftTimeThreshhold[]; + /** -1 means no override */ + craftTimeOverride: number; + /** Specific reward pool when player sacrificed one specific item */ + directRewards: Record; + directRewardStackSize: Record; + /** Item tpls to exclude from the reward pool */ + rewardItemBlacklist: string[]; + /** Item tpls to include in the reward pool */ + additionalRewardItemPool: string[]; + currencyRewards: Record; +} +export interface ICraftTimeThreshhold extends MinMax { + craftTimeSeconds: number; +} +export interface IDirectRewardSettings { + rewardTpls: string[]; + craftTimeSeconds: number; } diff --git a/types/models/spt/config/IInRaidConfig.d.ts b/types/models/spt/config/IInRaidConfig.d.ts index 7d6befd..d70f638 100644 --- a/types/models/spt/config/IInRaidConfig.d.ts +++ b/types/models/spt/config/IInRaidConfig.d.ts @@ -1,11 +1,10 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInRaidConfig extends IBaseConfig { kind: "spt-inraid"; - MIAOnRaidEnd: boolean; /** Overrides to apply to the pre-raid settings screen */ - raidMenuSettings: RaidMenuSettings; + raidMenuSettings: IRaidMenuSettings; /** What effects should be saved post-raid */ - save: Save; + save: ISave; /** Names of car extracts */ carExtracts: string[]; /** Names of coop extracts */ @@ -15,15 +14,17 @@ export interface IInRaidConfig extends IBaseConfig { /** Fence rep gain from a single coop extract */ coopExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ - scavExtractGain: number; + scavExtractStandingGain: number; /** The likelihood of PMC eliminating a minimum of 2 scavs while you engage them as a pscav. */ pmcKillProbabilityForScavGain: number; /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ keepFiRSecureContainerOnDeath: boolean; + /** If enabled always keep found in raid status on items */ + alwaysKeepFoundInRaidonRaidEnd: boolean; /** Percentage chance a player scav hot is hostile to the player when scavving */ playerScavHostileChancePercent: number; } -export interface RaidMenuSettings { +export interface IRaidMenuSettings { aiAmount: string; aiDifficulty: string; bossEnabled: boolean; @@ -33,7 +34,7 @@ export interface RaidMenuSettings { randomWeather: boolean; randomTime: boolean; } -export interface Save { +export interface ISave { /** Should loot gained from raid be saved */ loot: boolean; } diff --git a/types/models/spt/config/IInsuranceConfig.d.ts b/types/models/spt/config/IInsuranceConfig.d.ts index 2bbd7b3..6c90fe0 100644 --- a/types/models/spt/config/IInsuranceConfig.d.ts +++ b/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,5 @@ export interface IInsuranceConfig extends IBaseConfig { runIntervalSeconds: number; minAttachmentRoublePriceToBeTaken: number; chanceNoAttachmentsTakenPercent: number; + simulateItemsBeingTaken: boolean; } diff --git a/types/models/spt/config/IInventoryConfig.d.ts b/types/models/spt/config/IInventoryConfig.d.ts index b489393..af0ec79 100644 --- a/types/models/spt/config/IInventoryConfig.d.ts +++ b/types/models/spt/config/IInventoryConfig.d.ts @@ -4,18 +4,18 @@ export interface IInventoryConfig extends IBaseConfig { kind: "spt-inventory"; /** Should new items purchased by flagged as found in raid */ newItemsMarkedFound: boolean; - randomLootContainers: Record; + randomLootContainers: Record; sealedAirdropContainer: ISealedAirdropContainerSettings; /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ customMoneyTpls: string[]; /** Multipliers for skill gain when inside menus, NOT in-game */ skillGainMultiplers: Record; } -export interface RewardDetails { +export interface IRewardDetails { rewardCount: number; foundInRaid: boolean; rewardTplPool?: Record; - rewardTypePool?: Record; + rewardTypePool?: string[]; } export interface ISealedAirdropContainerSettings { weaponRewardWeight: Record; diff --git a/types/models/spt/config/ILocationConfig.d.ts b/types/models/spt/config/ILocationConfig.d.ts index 1e113b2..55123d6 100644 --- a/types/models/spt/config/ILocationConfig.d.ts +++ b/types/models/spt/config/ILocationConfig.d.ts @@ -1,5 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { BossLocationSpawn, Wave } from "@spt/models/eft/common/ILocationBase"; +import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "spt-location"; @@ -9,10 +9,10 @@ export interface ILocationConfig extends IBaseConfig { rogueLighthouseSpawnTimeSettings: IRogueLighthouseSpawnTimeSettings; /** When a map has hit max alive bots, any wave that should spawn will be reduced to 1 bot in size and placed in a spawn queue, this splits waves into smaller sizes to reduce the impact of this behaviour */ splitWaveIntoSingleSpawnsSettings: ISplitWaveSettings; - looseLootMultiplier: LootMultiplier; - staticLootMultiplier: LootMultiplier; + looseLootMultiplier: ILootMultiplier; + staticLootMultiplier: ILootMultiplier; /** Custom bot waves to add to a locations base json on game start if addCustomBotWavesToMaps is true */ - customWaves: CustomWaves; + customWaves: ICustomWaves; /** Open zones to add to map */ openZones: Record; /** Key = map id, value = item tpls that should only have one forced loot spawn position */ @@ -44,8 +44,6 @@ export interface ILocationConfig extends IBaseConfig { scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ - sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { modSpawnChancePercent: Record; @@ -63,16 +61,16 @@ export interface ISplitWaveSettings { ignoreMaps: string[]; waveSizeThreshold: number; } -export interface CustomWaves { +export interface ICustomWaves { /** Bosses spawn on raid start */ - boss: Record; - normal: Record; + boss: Record; + normal: Record; } export interface IBotTypeLimit extends MinMax { type: string; } /** Multiplier to apply to the loot count for a given map */ -export interface LootMultiplier { +export interface ILootMultiplier { bigmap: number; develop: number; factory4_day: number; diff --git a/types/models/spt/config/ILootConfig.d.ts b/types/models/spt/config/ILootConfig.d.ts index e22c3ea..4e73ea0 100644 --- a/types/models/spt/config/ILootConfig.d.ts +++ b/types/models/spt/config/ILootConfig.d.ts @@ -1,9 +1,9 @@ -import { Spawnpoint } from "@spt/models/eft/common/ILooseLoot"; +import { ISpawnpoint } from "@spt/models/eft/common/ILooseLoot"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILootConfig extends IBaseConfig { kind: "spt-loot"; /** Spawn positions to add into a map, key=mapid */ - looseLoot: Record; + looseLoot: Record; /** Loose loot probability adjustments to apply on game start */ looseLootSpawnPointAdjustments: Record>; } diff --git a/types/models/spt/config/ILostOnDeathConfig.d.ts b/types/models/spt/config/ILostOnDeathConfig.d.ts index 8574646..71408ce 100644 --- a/types/models/spt/config/ILostOnDeathConfig.d.ts +++ b/types/models/spt/config/ILostOnDeathConfig.d.ts @@ -2,13 +2,13 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILostOnDeathConfig extends IBaseConfig { kind: "spt-lostondeath"; /** What equipment in each slot should be lost on death */ - equipment: Equipment; + equipment: ILostEquipment; /** Should special slot items be removed from quest inventory on death e.g. wifi camera/markers */ specialSlotItems: boolean; /** Should quest items be removed from quest inventory on death */ questItems: boolean; } -export interface Equipment { +export interface ILostEquipment { ArmBand: boolean; Headwear: boolean; Earpiece: boolean; diff --git a/types/models/spt/config/IPlayerScavConfig.d.ts b/types/models/spt/config/IPlayerScavConfig.d.ts index 8834768..f684f45 100644 --- a/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,25 +1,25 @@ -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "spt-playerscav"; - karmaLevel: Record; + karmaLevel: Record; } -export interface KarmaLevel { +export interface IKarmaLevel { botTypeForLoot: string; - modifiers: Modifiers; + modifiers: IModifiers; itemLimits: ItemLimits; equipmentBlacklist: Record; lootItemsToAddChancePercent: Record; } -export interface Modifiers { +export interface IModifiers { equipment: Record; mod: Record; } export interface ItemLimits { - healing: GenerationData; - drugs: GenerationData; - stims: GenerationData; - looseLoot: GenerationData; - magazines: GenerationData; - grenades: GenerationData; + healing: IGenerationData; + drugs: IGenerationData; + stims: IGenerationData; + looseLoot: IGenerationData; + magazines: IGenerationData; + grenades: IGenerationData; } diff --git a/types/models/spt/config/IPmcConfig.d.ts b/types/models/spt/config/IPmcConfig.d.ts index 00fabb3..2e68219 100644 --- a/types/models/spt/config/IPmcConfig.d.ts +++ b/types/models/spt/config/IPmcConfig.d.ts @@ -1,4 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; +import { IChancedEnemy } from "@spt/models/eft/common/ILocationBase"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IPmcConfig extends IBaseConfig { @@ -8,11 +9,11 @@ export interface IPmcConfig extends IBaseConfig { /** What account type should the PMC have */ accountTypeWeight: Record; /** Global whitelist/blacklist of vest loot for PMCs */ - vestLoot: SlotLootSettings; + vestLoot: ISlotLootSettings; /** Global whitelist/blacklist of pocket loot for PMCs */ - pocketLoot: SlotLootSettings; + pocketLoot: ISlotLootSettings; /** Global whitelist/blacklist of backpack loot for PMCs */ - backpackLoot: SlotLootSettings; + backpackLoot: ISlotLootSettings; /** Use difficulty defined in config/bot.json/difficulty instead of chosen difficulty dropdown value */ useDifficultyOverride: boolean; /** Difficulty override e.g. "AsOnline/Hard" */ @@ -29,32 +30,45 @@ export interface IPmcConfig extends IBaseConfig { usecType: string; /** WildSpawnType enum value BEAR PMCs use */ bearType: string; - chanceSameSideIsHostilePercent: number; /** What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear */ pmcType: Record>>; - maxBackpackLootTotalRub: number; + maxBackpackLootTotalRub: IMinMaxLootValue[]; maxPocketLootTotalRub: number; maxVestLootTotalRub: number; - /** Percentage chance a bot from a wave is converted into a PMC, key = bot wildspawn tpye (assault/exusec), value: min+max chance to be converted */ - convertIntoPmcChance: Record; - /** WildSpawnType bots PMCs should see as hostile */ - enemyTypes: string[]; + /** Percentage chance a bot from a wave is converted into a PMC, first key = map, second key = bot wildspawn type (assault/exusec), value: min+max chance to be converted */ + convertIntoPmcChance: Record>; /** How many levels above player level can a PMC be */ botRelativeLevelDeltaMax: number; /** How many levels below player level can a PMC be */ botRelativeLevelDeltaMin: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + hostilitySettings: Record; allPMCsHavePlayerNameWithRandomPrefixChance: number; locationSpecificPmcLevelOverride: Record; /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ addSecureContainerLootFromBotConfig: boolean; } -export interface PmcTypes { +export interface IHostilitySettings { + /** Bot roles that are 100% an enemy */ + additionalEnemyTypes?: string[]; + /** Objects that determine the % chance another bot type is an enemy */ + chancedEnemies?: IChancedEnemy[]; + bearEnemyChance?: number; + usecEnemyChance?: number; + savageEnemyChance?: number; + /** Bot roles that are 100% an friendly */ + additionalFriendlyTypes?: string[]; + savagePlayerBehaviour?: string; +} +export interface IPmcTypes { usec: string; bear: string; } -export interface SlotLootSettings { +export interface ISlotLootSettings { whitelist: string[]; blacklist: string[]; } +export interface IMinMaxLootValue extends MinMax { + value: number; +} diff --git a/types/models/spt/config/IQuestConfig.d.ts b/types/models/spt/config/IQuestConfig.d.ts index a4257cf..e4e76eb 100644 --- a/types/models/spt/config/IQuestConfig.d.ts +++ b/types/models/spt/config/IQuestConfig.d.ts @@ -13,6 +13,10 @@ export interface IQuestConfig extends IBaseConfig { locationIdMap: Record; bearOnlyQuests: string[]; usecOnlyQuests: string[]; + /** Quests that the keyed game version do not see/access */ + profileBlacklist: Record; + /** Quests that only the keyed game version can see/access */ + profileWhitelist: Record; } export interface IPlayerTypeQuestIds { pmc: IQuestTypeIds; @@ -49,6 +53,7 @@ export interface IRepeatableQuestConfig { rewardAmmoStackMinSize: number; freeChangesAvailable: number; freeChanges: number; + keepDailyQuestTypeOnReplacement: boolean; } export interface IRewardScaling { levels: number[]; diff --git a/types/models/spt/config/IRagfairConfig.d.ts b/types/models/spt/config/IRagfairConfig.d.ts index bb318de..9b17861 100644 --- a/types/models/spt/config/IRagfairConfig.d.ts +++ b/types/models/spt/config/IRagfairConfig.d.ts @@ -7,12 +7,13 @@ export interface IRagfairConfig extends IBaseConfig { /** Default values used to hydrate `runIntervalSeconds` with */ runIntervalValues: IRunIntervalValues; /** Player listing settings */ - sell: Sell; + sell: ISell; /** Trader ids + should their assorts be listed on flea */ traders: Record; - dynamic: Dynamic; + dynamic: IDynamic; + tieredFlea: ITieredFlea; } -export interface Sell { +export interface ISell { /** Should a fee be deducted from player when liting an item for sale */ fees: boolean; /** Settings to control chances of offer being sold */ @@ -32,7 +33,7 @@ export interface Chance { /** Min possible sell chance % for a player listed offer */ minSellChancePercent: number; } -export interface Dynamic { +export interface IDynamic { purchasesAreFoundInRaid: boolean; /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ useTraderPriceForOffersIfHigher: boolean; @@ -40,7 +41,7 @@ export interface Dynamic { barter: IBarterDetails; pack: IPackDetails; /** Dynamic offer price below handbook adjustment values */ - offerAdjustment: OfferAdjustment; + offerAdjustment: IOfferAdjustment; /** How many offers should expire before an offer regeneration occurs */ expiredOfferThreshold: number; /** How many offers should be listed */ @@ -69,7 +70,7 @@ export interface Dynamic { /** Should christmas/halloween items be removed from flea when not within the seasonal bounds */ removeSeasonalItemsWhenNotInEvent: boolean; /** Flea blacklist settings */ - blacklist: Blacklist; + blacklist: IRagfairBlacklist; /** Dict of price limits keyed by item type */ unreasonableModPrices: Record; } @@ -102,7 +103,7 @@ export interface IPackDetails { /** item types to allow being a pack */ itemTypeWhitelist: string[]; } -export interface OfferAdjustment { +export interface IOfferAdjustment { /** Shuld offer price be adjusted when below handbook price */ adjustPriceWhenBelowHandbookPrice: boolean; /** How big a percentage difference does price need to vary from handbook to be considered for adjustment */ @@ -118,7 +119,7 @@ export interface Condition { current: MinMax; max: MinMax; } -export interface Blacklist { +export interface IRagfairBlacklist { /** Damaged ammo packs */ damagedAmmoPacks: boolean; /** Custom blacklist for item Tpls */ @@ -156,3 +157,12 @@ export interface IArmorSettings { /** What slots are to be removed when removeRemovablePlateChance is true */ plateSlotIdToRemovePool: string[]; } +export interface ITieredFlea { + enabled: boolean; + /** key: tpl, value: playerlevel */ + unlocksTpl: Record; + /** key: item type id, value: playerlevel */ + unlocksType: Record; + ammoTiersEnabled: boolean; + ammoTplUnlocks: Record; +} diff --git a/types/models/spt/config/IRepairConfig.d.ts b/types/models/spt/config/IRepairConfig.d.ts index 12a87fa..eca8e6c 100644 --- a/types/models/spt/config/IRepairConfig.d.ts +++ b/types/models/spt/config/IRepairConfig.d.ts @@ -10,7 +10,7 @@ export interface IRepairConfig extends IBaseConfig { repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; weaponTreatment: IWeaponTreatmentRepairValues; - repairKit: RepairKit; + repairKit: IRepairKit; } export interface IIntellectGainValues { weapon: number; @@ -30,17 +30,17 @@ export interface IWeaponTreatmentRepairValues { /** The multiplier used for calculating weapon maintenance XP */ pointGainMultiplier: number; } -export interface RepairKit { - armor: BonusSettings; - weapon: BonusSettings; +export interface IRepairKit { + armor: IBonusSettings; + weapon: IBonusSettings; } -export interface BonusSettings { +export interface IBonusSettings { rarityWeight: Record; bonusTypeWeight: Record; - common: Record; - rare: Record; + common: Record; + rare: Record; } -export interface BonusValues { +export interface IBonusValues { valuesMinMax: MinMax; /** What dura is buff active between (min max of current max) */ activeDurabilityPercentMinMax: MinMax; diff --git a/types/models/spt/config/IScavCaseConfig.d.ts b/types/models/spt/config/IScavCaseConfig.d.ts index f2ff2f2..949180e 100644 --- a/types/models/spt/config/IScavCaseConfig.d.ts +++ b/types/models/spt/config/IScavCaseConfig.d.ts @@ -3,27 +3,27 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IScavCaseConfig extends IBaseConfig { kind: "spt-scavcase"; rewardItemValueRangeRub: Record; - moneyRewards: MoneyRewards; - ammoRewards: AmmoRewards; + moneyRewards: IMoneyRewards; + ammoRewards: IAmmoRewards; rewardItemParentBlacklist: string[]; rewardItemBlacklist: string[]; allowMultipleMoneyRewardsPerRarity: boolean; allowMultipleAmmoRewardsPerRarity: boolean; allowBossItemsAsRewards: boolean; } -export interface MoneyRewards { +export interface IMoneyRewards { moneyRewardChancePercent: number; - rubCount: MoneyLevels; - usdCount: MoneyLevels; - eurCount: MoneyLevels; - gpCount: MoneyLevels; + rubCount: IMoneyLevels; + usdCount: IMoneyLevels; + eurCount: IMoneyLevels; + gpCount: IMoneyLevels; } -export interface MoneyLevels { +export interface IMoneyLevels { common: MinMax; rare: MinMax; superrare: MinMax; } -export interface AmmoRewards { +export interface IAmmoRewards { ammoRewardChancePercent: number; ammoRewardBlacklist: Record; ammoRewardValueRangeRub: Record; diff --git a/types/models/spt/config/ISeasonalEventConfig.d.ts b/types/models/spt/config/ISeasonalEventConfig.d.ts index da7070b..1280bc5 100644 --- a/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -1,4 +1,4 @@ -import { BossLocationSpawn } from "@spt/models/eft/common/ILocationBase"; +import { IBossLocationSpawn } from "@spt/models/eft/common/ILocationBase"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ISeasonalEventConfig extends IBaseConfig { @@ -8,8 +8,8 @@ export interface ISeasonalEventConfig extends IBaseConfig { eventGear: Record>>>; events: ISeasonalEvent[]; eventBotMapping: Record; - eventBossSpawns: Record>; - gifterSettings: GifterSetting[]; + eventBossSpawns: Record>; + gifterSettings: IGifterSetting[]; } export interface ISeasonalEvent { name: string; @@ -19,7 +19,7 @@ export interface ISeasonalEvent { endDay: number; endMonth: number; } -export interface GifterSetting { +export interface IGifterSetting { map: string; zones: string; spawnChance: number; diff --git a/types/models/spt/config/ITraderConfig.d.ts b/types/models/spt/config/ITraderConfig.d.ts index d60b496..31a213b 100644 --- a/types/models/spt/config/ITraderConfig.d.ts +++ b/types/models/spt/config/ITraderConfig.d.ts @@ -1,23 +1,24 @@ import { MinMax } from "@spt/models/common/MinMax"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; -import { LootRequest } from "@spt/models/spt/services/LootRequest"; +import { ILootRequest } from "@spt/models/spt/services/ILootRequest"; export interface ITraderConfig extends IBaseConfig { kind: "spt-trader"; - updateTime: UpdateTime[]; + updateTime: IUpdateTime[]; purchasesAreFoundInRaid: boolean; /** Should trader reset times be set based on server start time (false = bsg time - on the hour) */ tradersResetFromServerStart: boolean; updateTimeDefault: number; traderPriceMultipler: number; - fence: FenceConfig; + fence: IFenceConfig; + moddedTraders: IModdedTraders; } -export interface UpdateTime { +export interface IUpdateTime { traderId: string; /** Seconds between trader resets */ seconds: MinMax; } -export interface FenceConfig { - discountOptions: DiscountOptions; +export interface IFenceConfig { + discountOptions: IDiscountOptions; partialRefreshTimeSeconds: number; partialRefreshChangePercent: number; assortSize: number; @@ -44,22 +45,27 @@ export interface FenceConfig { /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ ammoMaxPenLimit: number; blacklist: string[]; - coopExtractGift: CoopExtractReward; + coopExtractGift: ICoopExtractReward; btrDeliveryExpireHours: number; } export interface IItemDurabilityCurrentMax { current: MinMax; max: MinMax; } -export interface CoopExtractReward extends LootRequest { +export interface ICoopExtractReward extends ILootRequest { sendGift: boolean; messageLocaleIds: string[]; giftExpiryHours: number; } -export interface DiscountOptions { +export interface IDiscountOptions { assortSize: number; itemPriceMult: number; presetPriceMult: number; weaponPresetMinMax: MinMax; equipmentPresetMinMax: MinMax; } +/** Custom trader data needed client side for things such as the clothing service */ +export interface IModdedTraders { + /** Trader Ids to enable the clothing service for */ + clothingService: string[]; +} diff --git a/types/models/spt/config/IWeatherConfig.d.ts b/types/models/spt/config/IWeatherConfig.d.ts index 970ade5..012f26c 100644 --- a/types/models/spt/config/IWeatherConfig.d.ts +++ b/types/models/spt/config/IWeatherConfig.d.ts @@ -5,7 +5,7 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IWeatherConfig extends IBaseConfig { kind: "spt-weather"; acceleration: number; - weather: Weather; + weather: IWeatherValues; seasonDates: ISeasonDateTimes[]; overrideSeason?: Season; } @@ -17,7 +17,9 @@ export interface ISeasonDateTimes { endDay: number; endMonth: number; } -export interface Weather { +export interface IWeatherValues { + /** How many hours to generate weather data into the future */ + generateWeatherAmountHours: number; clouds: WeatherSettings; windSpeed: WeatherSettings; windDirection: WeatherSettings; @@ -25,8 +27,14 @@ export interface Weather { rain: WeatherSettings; rainIntensity: MinMax; fog: WeatherSettings; - temp: MinMax; + temp: Record; pressure: MinMax; + /** Length of each weather period */ + timePeriod: WeatherSettings; +} +export interface ITempDayNight { + day: MinMax; + night: MinMax; } export interface WeatherSettings { values: T[]; diff --git a/types/models/spt/controllers/IBotController.d.ts b/types/models/spt/controllers/IBotController.d.ts index e577497..329dd43 100644 --- a/types/models/spt/controllers/IBotController.d.ts +++ b/types/models/spt/controllers/IBotController.d.ts @@ -1,10 +1,10 @@ import { IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; +import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; export interface IBotController { getBotLimit(type: string): number; - getBotDifficulty(type: string, difficulty: string): IBotCore | Difficulty; + getBotDifficulty(type: string, difficulty: string): IBotCore | IDifficultyCategories; isBotPmc(botRole: string): boolean; isBotBoss(botRole: string): boolean; isBotFollower(botRole: string): boolean; diff --git a/types/models/spt/dialog/ISendMessageDetails.d.ts b/types/models/spt/dialog/ISendMessageDetails.d.ts index 1625f47..8cb11f2 100644 --- a/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -1,5 +1,5 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ISystemData, IUserDialogInfo, MessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IMessageContentRagfair, ISystemData, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; export interface ISendMessageDetails { @@ -16,7 +16,7 @@ export interface ISendMessageDetails { /** Optional - used in player/system messages, otherwise templateId is used */ messageText?: string; /** Optinal - Items to send to player */ - items?: Item[]; + items?: IItem[]; /** Optional - How long items will be stored in mail before expiry */ itemsMaxStorageLifetimeSeconds?: number; /** Optional - Used when sending messages from traders who send text from locale json */ @@ -24,7 +24,7 @@ export interface ISendMessageDetails { /** Optional - ragfair related */ systemData?: ISystemData; /** Optional - Used by ragfair messages */ - ragfairDetails?: MessageContentRagfair; + ragfairDetails?: IMessageContentRagfair; /** OPTIONAL - allows modification of profile settings via mail */ profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/types/models/spt/fence/ICreateFenceAssortsResult.d.ts index 553f4e2..1af9f84 100644 --- a/types/models/spt/fence/ICreateFenceAssortsResult.d.ts +++ b/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -1,7 +1,7 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; export interface ICreateFenceAssortsResult { - sptItems: Item[][]; + sptItems: IItem[][]; barter_scheme: Record; loyal_level_items: Record; } diff --git a/types/models/spt/generators/IBotGenerator.d.ts b/types/models/spt/generators/IBotGenerator.d.ts index e46ce24..ebc954d 100644 --- a/types/models/spt/generators/IBotGenerator.d.ts +++ b/types/models/spt/generators/IBotGenerator.d.ts @@ -1,5 +1,5 @@ -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Chances, Generation, Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IChances, IGeneration, IInventory } from "@spt/models/eft/common/tables/IBotType"; export interface IBotGenerator { - generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory; + generateInventory(templateInventory: IInventory, equipmentChances: IChances, generation: IGeneration, botRole: string, isPmc: boolean): PmcInventory; } diff --git a/types/models/spt/generators/ILocationGenerator.d.ts b/types/models/spt/generators/ILocationGenerator.d.ts index 2df98e7..8090538 100644 --- a/types/models/spt/generators/ILocationGenerator.d.ts +++ b/types/models/spt/generators/ILocationGenerator.d.ts @@ -1,6 +1,6 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "@spt/models/eft/common/ILocation"; -import { ILooseLoot, SpawnpointTemplate } from "@spt/models/eft/common/ILooseLoot"; +import { ILooseLoot, ISpawnpointTemplate } from "@spt/models/eft/common/ILooseLoot"; export interface ILocationGenerator { generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; - generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): SpawnpointTemplate[]; + generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[]; } diff --git a/types/models/spt/generators/IRagfairAssortGenerator.d.ts b/types/models/spt/generators/IRagfairAssortGenerator.d.ts index 193b685..380387e 100644 --- a/types/models/spt/generators/IRagfairAssortGenerator.d.ts +++ b/types/models/spt/generators/IRagfairAssortGenerator.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IRagfairAssortGenerator { - getAssortItems(): Item[]; + getAssortItems(): IItem[]; } diff --git a/types/models/spt/generators/IRagfairOfferGenerator.d.ts b/types/models/spt/generators/IRagfairOfferGenerator.d.ts index 66d28e9..e3d3f1b 100644 --- a/types/models/spt/generators/IRagfairOfferGenerator.d.ts +++ b/types/models/spt/generators/IRagfairOfferGenerator.d.ts @@ -1,6 +1,6 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export interface IRagfairOfferGenerator { - createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece: boolean): IRagfairOffer; + createOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece: boolean): IRagfairOffer; } diff --git a/types/models/spt/hideout/IHideout.d.ts b/types/models/spt/hideout/IHideout.d.ts index 57fed47..e93f748 100644 --- a/types/models/spt/hideout/IHideout.d.ts +++ b/types/models/spt/hideout/IHideout.d.ts @@ -1,11 +1,11 @@ import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutProductionData } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IQteData } from "@spt/models/eft/hideout/IQteData"; export interface IHideout { areas: IHideoutArea[]; - production: IHideoutProduction[]; + production: IHideoutProductionData; scavcase: IHideoutScavCase[]; settings: IHideoutSettingsBase; qte: IQteData[]; diff --git a/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts b/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts index ee1893d..3b4174f 100644 --- a/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts +++ b/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts @@ -1,9 +1,9 @@ -export interface ScavCaseRewardCountsAndPrices { - Common: RewardCountAndPriceDetails; - Rare: RewardCountAndPriceDetails; - Superrare: RewardCountAndPriceDetails; +export interface IScavCaseRewardCountsAndPrices { + Common: IRewardCountAndPriceDetails; + Rare: IRewardCountAndPriceDetails; + Superrare: IRewardCountAndPriceDetails; } -export interface RewardCountAndPriceDetails { +export interface IRewardCountAndPriceDetails { minCount: number; maxCount: number; minPriceRub: number; diff --git a/types/models/spt/inventory/IOwnerInventoryItems.d.ts b/types/models/spt/inventory/IOwnerInventoryItems.d.ts index dd4efab..95ed39e 100644 --- a/types/models/spt/inventory/IOwnerInventoryItems.d.ts +++ b/types/models/spt/inventory/IOwnerInventoryItems.d.ts @@ -1,9 +1,9 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IOwnerInventoryItems { /** Inventory items from source */ - from: Item[]; + from: IItem[]; /** Inventory items at destination */ - to: Item[]; + to: IItem[]; sameInventory: boolean; isMail: boolean; } diff --git a/types/models/spt/mod/NewItemDetails.d.ts b/types/models/spt/mod/NewItemDetails.d.ts index 65996c1..87de429 100644 --- a/types/models/spt/mod/NewItemDetails.d.ts +++ b/types/models/spt/mod/NewItemDetails.d.ts @@ -1,4 +1,4 @@ -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; export declare abstract class NewItemDetailsBase { /** Price of the item on flea market */ fleaPriceRoubles: number; @@ -16,7 +16,7 @@ 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; + overrideProperties: IProps; /** ParentId for the new item (item type) */ parentId: string; /** diff --git a/types/models/spt/ragfair/ITplWithFleaPrice.d.ts b/types/models/spt/ragfair/ITplWithFleaPrice.d.ts new file mode 100644 index 0000000..4b76836 --- /dev/null +++ b/types/models/spt/ragfair/ITplWithFleaPrice.d.ts @@ -0,0 +1,5 @@ +export interface ITplWithFleaPrice { + tpl: string; + /** Roubles */ + price: number; +} diff --git a/types/models/spt/server/ExhaustableArray.d.ts b/types/models/spt/server/ExhaustableArray.d.ts index c27f41f..50a6b68 100644 --- a/types/models/spt/server/ExhaustableArray.d.ts +++ b/types/models/spt/server/ExhaustableArray.d.ts @@ -1,5 +1,5 @@ -import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class ExhaustableArray implements IExhaustableArray { private itemPool; private randomUtil; diff --git a/types/models/spt/server/ISettingsBase.d.ts b/types/models/spt/server/ISettingsBase.d.ts index 2bca633..4e98dd5 100644 --- a/types/models/spt/server/ISettingsBase.d.ts +++ b/types/models/spt/server/ISettingsBase.d.ts @@ -1,25 +1,25 @@ export interface ISettingsBase { - config: Config; + config: IConfig; } -export interface Config { +export interface IConfig { AFKTimeoutSeconds: number; AdditionalRandomDelaySeconds: number; ClientSendRateLimit: number; CriticalRetriesCount: number; DefaultRetriesCount: number; FirstCycleDelaySeconds: number; - FramerateLimit: FramerateLimit; + FramerateLimit: IFramerateLimit; GroupStatusInterval: number; GroupStatusButtonInterval: number; KeepAliveInterval: number; LobbyKeepAliveInterval: number; Mark502and504AsNonImportant: boolean; - MemoryManagementSettings: MemoryManagementSettings; + MemoryManagementSettings: IMemoryManagementSettings; NVidiaHighlights: boolean; NextCycleDelaySeconds: number; PingServerResultSendInterval: number; PingServersInterval: number; - ReleaseProfiler: ReleaseProfiler; + ReleaseProfiler: IReleaseProfiler; RequestConfirmationTimeouts: number[]; RequestsMadeThroughLobby: string[]; SecondCycleDelaySeconds: number; @@ -30,12 +30,12 @@ export interface Config { NetworkStateView: INetworkStateView; WsReconnectionDelays: string[]; } -export interface FramerateLimit { +export interface IFramerateLimit { MaxFramerateGameLimit: number; MaxFramerateLobbyLimit: number; MinFramerateLimit: number; } -export interface MemoryManagementSettings { +export interface IMemoryManagementSettings { AggressiveGC: boolean; GigabytesRequiredToDisableGCDuringRaid: number; HeapPreAllocationEnabled: boolean; @@ -43,7 +43,7 @@ export interface MemoryManagementSettings { OverrideRamCleanerSettings: boolean; RamCleanerEnabled: boolean; } -export interface ReleaseProfiler { +export interface IReleaseProfiler { Enabled: boolean; MaxRecords: number; RecordTriggerValue: number; diff --git a/types/models/spt/services/CustomPreset.d.ts b/types/models/spt/services/CustomPreset.d.ts deleted file mode 100644 index 3301a55..0000000 --- a/types/models/spt/services/CustomPreset.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IPreset } from "@spt/models/eft/common/IGlobals"; -export interface CustomPreset { - key: string; - preset: IPreset; -} diff --git a/types/models/spt/services/CustomTraderAssortData.d.ts b/types/models/spt/services/CustomTraderAssortData.d.ts deleted file mode 100644 index 7ad6341..0000000 --- a/types/models/spt/services/CustomTraderAssortData.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; -import { Traders } from "@spt/models/enums/Traders"; -export interface CustomTraderAssortData { - traderId: Traders; - assorts: ITraderAssort; -} diff --git a/types/models/spt/services/IInsuranceEquipmentPkg.d.ts b/types/models/spt/services/IInsuranceEquipmentPkg.d.ts index 92d0565..93aecfa 100644 --- a/types/models/spt/services/IInsuranceEquipmentPkg.d.ts +++ b/types/models/spt/services/IInsuranceEquipmentPkg.d.ts @@ -1,8 +1,8 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IInsuranceEquipmentPkg { sessionID: string; pmcData: IPmcData; - itemToReturnToPlayer: Item; + itemToReturnToPlayer: IItem; traderId: string; } diff --git a/types/models/spt/services/ILootRequest.d.ts b/types/models/spt/services/ILootRequest.d.ts new file mode 100644 index 0000000..22bff2f --- /dev/null +++ b/types/models/spt/services/ILootRequest.d.ts @@ -0,0 +1,33 @@ +import { MinMax } from "@spt/models/common/MinMax"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +export interface ILootRequest { + /** Count of weapons to generate */ + weaponPresetCount: MinMax; + /** Count of armor to generate */ + armorPresetCount: MinMax; + /** Count of items to generate */ + itemCount: MinMax; + /** Count of sealed weapon crates to generate */ + weaponCrateCount: MinMax; + /** Item tpl blacklist to exclude */ + itemBlacklist: string[]; + /** Item tpl whitelist to pick from */ + itemTypeWhitelist: string[]; + /** key: item base type: value: max count */ + itemLimits: Record; + itemStackLimits: Record; + /** Allowed armor plate levels 2/3/4/5/6 for armor generated */ + armorLevelWhitelist: number[]; + /** Should boss items be included in allowed items */ + allowBossItems: boolean; + /** Should item.json item reward blacklist be used */ + useRewardItemBlacklist?: boolean; + /** Should forced loot be used instead of randomised loot */ + useForcedLoot?: boolean; + /** Item tpls + count of items to force include */ + forcedLoot?: Record; +} +export interface IAirdropLootRequest extends ILootRequest { + /** Airdrop icon used by client to show crate type */ + icon?: AirdropTypeEnum; +} diff --git a/types/models/spt/services/LootItem.d.ts b/types/models/spt/services/LootItem.d.ts index acb7606..2d2f236 100644 --- a/types/models/spt/services/LootItem.d.ts +++ b/types/models/spt/services/LootItem.d.ts @@ -1,4 +1,4 @@ -export declare class LootItem { +export declare class ILootItem { id?: string; tpl: string; isPreset: boolean; diff --git a/types/models/spt/services/LootRequest.d.ts b/types/models/spt/services/LootRequest.d.ts deleted file mode 100644 index c52a876..0000000 --- a/types/models/spt/services/LootRequest.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { MinMax } from "@spt/models/common/MinMax"; -export interface LootRequest { - weaponPresetCount: MinMax; - armorPresetCount: MinMax; - itemCount: MinMax; - weaponCrateCount: MinMax; - itemBlacklist: string[]; - itemTypeWhitelist: string[]; - /** key: item base type: value: max count */ - itemLimits: Record; - itemStackLimits: Record; - armorLevelWhitelist: number[]; - allowBossItems: boolean; - useRewarditemBlacklist?: boolean; -} diff --git a/types/models/spt/templates/ITemplates.d.ts b/types/models/spt/templates/ITemplates.d.ts index c2ebbf9..9f9b0d5 100644 --- a/types/models/spt/templates/ITemplates.d.ts +++ b/types/models/spt/templates/ITemplates.d.ts @@ -1,6 +1,7 @@ import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { ILocationServices } from "@spt/models/eft/common/tables/ILocationServices"; import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; import { IQuest } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; @@ -21,4 +22,6 @@ export interface ITemplates { defaultEquipmentPresets: IDefaultEquipmentPreset[]; /** Achievements */ achievements: IAchievement[]; + /** Location services data */ + locationServices: ILocationServices; } diff --git a/types/models/spt/utils/ILogger.d.ts b/types/models/spt/utils/ILogger.d.ts index 1b9726d..32c4941 100644 --- a/types/models/spt/utils/ILogger.d.ts +++ b/types/models/spt/utils/ILogger.d.ts @@ -1,8 +1,8 @@ -import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; +import { IDaum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; export interface ILogger { - writeToLogFile(data: string | Daum): void; + writeToLogFile(data: string | IDaum): void; log(data: string | Record | Error, color: string, backgroundColor?: string): void; logWithColor(data: string | Record, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): void; error(data: string): void; diff --git a/types/models/spt/weather/IGetLocalWeatherResponseData.d.ts b/types/models/spt/weather/IGetLocalWeatherResponseData.d.ts new file mode 100644 index 0000000..ba1782b --- /dev/null +++ b/types/models/spt/weather/IGetLocalWeatherResponseData.d.ts @@ -0,0 +1,5 @@ +import { IWeather } from "@spt/models/eft/weather/IWeatherData"; +export interface IGetLocalWeatherResponseData { + season: number; + weather: IWeather[]; +} diff --git a/types/routers/EventOutputHolder.d.ts b/types/routers/EventOutputHolder.d.ts index ef20706..88ffb5d 100644 --- a/types/routers/EventOutputHolder.d.ts +++ b/types/routers/EventOutputHolder.d.ts @@ -1,10 +1,10 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IHideoutImprovement, Productive, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; -import { TraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; +import { IHideoutImprovement, IMoneyTransferLimits, IProductive, ITraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { ITraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; @@ -12,7 +12,7 @@ export declare class EventOutputHolder { /** * What has client been informed of this game session * Key = sessionId, then second key is prod id - */ + */ protected clientActiveSessionStorage: Record>; @@ -30,12 +30,13 @@ export declare class EventOutputHolder { * @param sessionId Session id */ updateOutputProperties(sessionId: string): void; + protected resetMoneyTransferLimit(limit: IMoneyTransferLimits): void; /** * Convert the internal trader data object into an object we can send to the client * @param traderData server data for traders * @returns dict of trader id + TraderData */ - protected constructTraderRelations(traderData: Record): Record; + protected constructTraderRelations(traderData: Record): Record; /** * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true * @param pmcData Player profile @@ -47,10 +48,10 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile */ - protected cleanUpCompleteCraftsInProfile(productions: Record): void; + protected cleanUpCompleteCraftsInProfile(productions: Record): void; } diff --git a/types/routers/HttpRouter.d.ts b/types/routers/HttpRouter.d.ts index 3fdb53f..5eb9af3 100644 --- a/types/routers/HttpRouter.d.ts +++ b/types/routers/HttpRouter.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage } from "node:http"; import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router"; export declare class HttpRouter { diff --git a/types/routers/ImageRouter.d.ts b/types/routers/ImageRouter.d.ts index eb3697f..ca9afad 100644 --- a/types/routers/ImageRouter.d.ts +++ b/types/routers/ImageRouter.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService"; import { HttpFileUtil } from "@spt/utils/HttpFileUtil"; diff --git a/types/routers/item_events/WishlistItemEventRouter.d.ts b/types/routers/item_events/WishlistItemEventRouter.d.ts index bc6d257..712f484 100644 --- a/types/routers/item_events/WishlistItemEventRouter.d.ts +++ b/types/routers/item_events/WishlistItemEventRouter.d.ts @@ -6,5 +6,5 @@ export declare class WishlistItemEventRouter extends ItemEventRouterDefinition { protected wishlistCallbacks: WishlistCallbacks; constructor(wishlistCallbacks: WishlistCallbacks); getHandledRoutes(): HandledRoute[]; - handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): Promise; + handleItemEvent(url: string, pmcData: IPmcData, request: any, sessionID: string): Promise; } diff --git a/types/routers/serializers/BundleSerializer.d.ts b/types/routers/serializers/BundleSerializer.d.ts index dc71cd8..91332ff 100644 --- a/types/routers/serializers/BundleSerializer.d.ts +++ b/types/routers/serializers/BundleSerializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { Serializer } from "@spt/di/Serializer"; import { BundleLoader } from "@spt/loaders/BundleLoader"; diff --git a/types/routers/serializers/ImageSerializer.d.ts b/types/routers/serializers/ImageSerializer.d.ts index 5c77243..92f06e3 100644 --- a/types/routers/serializers/ImageSerializer.d.ts +++ b/types/routers/serializers/ImageSerializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { Serializer } from "@spt/di/Serializer"; import { ImageRouter } from "@spt/routers/ImageRouter"; diff --git a/types/routers/serializers/NotifySerializer.d.ts b/types/routers/serializers/NotifySerializer.d.ts index 8c07f81..4e1f28d 100644 --- a/types/routers/serializers/NotifySerializer.d.ts +++ b/types/routers/serializers/NotifySerializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { NotifierController } from "@spt/controllers/NotifierController"; import { Serializer } from "@spt/di/Serializer"; diff --git a/types/routers/static/GameStaticRouter.d.ts b/types/routers/static/GameStaticRouter.d.ts index bf045af..f7287a2 100644 --- a/types/routers/static/GameStaticRouter.d.ts +++ b/types/routers/static/GameStaticRouter.d.ts @@ -1,6 +1,8 @@ import { GameCallbacks } from "@spt/callbacks/GameCallbacks"; import { StaticRouter } from "@spt/di/Router"; +import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class GameStaticRouter extends StaticRouter { + protected httpResponse: HttpResponseUtil; protected gameCallbacks: GameCallbacks; - constructor(gameCallbacks: GameCallbacks); + constructor(httpResponse: HttpResponseUtil, gameCallbacks: GameCallbacks); } diff --git a/types/servers/HttpServer.d.ts b/types/servers/HttpServer.d.ts index b00fe68..e54d4a8 100644 --- a/types/servers/HttpServer.d.ts +++ b/types/servers/HttpServer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { ApplicationContext } from "@spt/context/ApplicationContext"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; @@ -6,8 +5,8 @@ import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { IHttpListener } from "@spt/servers/http/IHttpListener"; import { WebSocketServer } from "@spt/servers/WebSocketServer"; +import { IHttpListener } from "@spt/servers/http/IHttpListener"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; @@ -25,7 +24,7 @@ export declare class HttpServer { * Handle server loading event */ load(): void; - protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + protected handleRequest(req: IncomingMessage, resp: ServerResponse): Promise; /** * Check against hardcoded values that determine its from a local address * @param remoteAddress Address to check diff --git a/types/servers/WebSocketServer.d.ts b/types/servers/WebSocketServer.d.ts index f4e07bb..f936d0f 100644 --- a/types/servers/WebSocketServer.d.ts +++ b/types/servers/WebSocketServer.d.ts @@ -1,12 +1,11 @@ -/// import http, { IncomingMessage } from "node:http"; -import { WebSocket, Server } from "ws"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; import { LocalisationService } from "@spt/services/LocalisationService"; import { JsonUtil } from "@spt/utils/JsonUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { Server, WebSocket } from "ws"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; diff --git a/types/servers/http/IHttpListener.d.ts b/types/servers/http/IHttpListener.d.ts index ff148d6..5010148 100644 --- a/types/servers/http/IHttpListener.d.ts +++ b/types/servers/http/IHttpListener.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; export interface IHttpListener { canHandle(sessionId: string, req: IncomingMessage): boolean; diff --git a/types/servers/http/SptHttpListener.d.ts b/types/servers/http/SptHttpListener.d.ts index ef68143..9311f82 100644 --- a/types/servers/http/SptHttpListener.d.ts +++ b/types/servers/http/SptHttpListener.d.ts @@ -1,5 +1,3 @@ -/// -/// import { IncomingMessage, ServerResponse } from "node:http"; import { Serializer } from "@spt/di/Serializer"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -21,14 +19,26 @@ export declare class SptHttpListener implements IHttpListener { canHandle(_: string, req: IncomingMessage): boolean; handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): Promise; /** - * Send http response to the client - * @param sessionID Player id + * Send HTTP response back to sender + * @param sessionID Player id making request * @param req Incoming request * @param resp Outgoing response * @param body Buffer * @param output Server generated response data */ sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; + /** + * Is request flagged as debug enabled + * @param req Incoming request + * @returns True if request is flagged as debug + */ + protected isDebugRequest(req: IncomingMessage): boolean; + /** + * Log request if enabled + * @param req Incoming message request + * @param output Output string + */ + protected logRequest(req: IncomingMessage, output: string): void; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): Promise; protected getBodyInfo(body: Buffer, requestUrl?: any): any; sendJson(resp: ServerResponse, output: string, sessionID: string): void; diff --git a/types/servers/ws/IWebSocketConnectionHandler.d.ts b/types/servers/ws/IWebSocketConnectionHandler.d.ts index 920dad4..9045dca 100644 --- a/types/servers/ws/IWebSocketConnectionHandler.d.ts +++ b/types/servers/ws/IWebSocketConnectionHandler.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage } from "node:http"; import { WebSocket } from "ws"; export interface IWebSocketConnectionHandler { diff --git a/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 98d0898..cdfc42d 100644 --- a/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,7 +1,4 @@ -/// -/// -import { IncomingMessage } from "http"; -import { WebSocket } from "ws"; +import { IncomingMessage } from "node:http"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; @@ -11,6 +8,7 @@ import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectio import { ISptWebSocketMessageHandler } from "@spt/servers/ws/message/ISptWebSocketMessageHandler"; import { LocalisationService } from "@spt/services/LocalisationService"; import { JsonUtil } from "@spt/utils/JsonUtil"; +import { WebSocket } from "ws"; export declare class SptWebSocketConnectionHandler implements IWebSocketConnectionHandler { protected logger: ILogger; protected profileHelper: ProfileHelper; diff --git a/types/servers/ws/message/DefaultSptWebSocketMessageHandler.d.ts b/types/servers/ws/message/DefaultSptWebSocketMessageHandler.d.ts index d5247ec..5556129 100644 --- a/types/servers/ws/message/DefaultSptWebSocketMessageHandler.d.ts +++ b/types/servers/ws/message/DefaultSptWebSocketMessageHandler.d.ts @@ -1,6 +1,6 @@ -import { RawData, WebSocket } from "ws"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ISptWebSocketMessageHandler } from "@spt/servers/ws/message/ISptWebSocketMessageHandler"; +import { RawData, WebSocket } from "ws"; export declare class DefaultSptWebSocketMessageHandler implements ISptWebSocketMessageHandler { protected logger: ILogger; constructor(logger: ILogger); diff --git a/types/services/AirdropService.d.ts b/types/services/AirdropService.d.ts new file mode 100644 index 0000000..02e6fad --- /dev/null +++ b/types/services/AirdropService.d.ts @@ -0,0 +1,56 @@ +import { LootGenerator } from "@spt/generators/LootGenerator"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; +import { AirdropTypeEnum, SptAirdropTypeEnum } from "@spt/models/enums/AirdropType"; +import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; +import { IAirdropLootRequest } from "@spt/models/spt/services/ILootRequest"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class AirdropService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected itemHelper: ItemHelper; + protected weightedRandomHelper: WeightedRandomHelper; + protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; + protected lootGenerator: LootGenerator; + protected databaseService: DatabaseService; + protected configServer: ConfigServer; + protected cloner: ICloner; + protected airdropConfig: IAirdropConfig; + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); + generateCustomAirdropLoot(request: IGetAirdropLootRequest): IGetAirdropLootResponse; + /** + * Handle client/location/getAirdropLoot + * Get loot for an airdrop container + * Generates it randomly based on config/airdrop.json values + * @param forcedAirdropType OPTIONAL - Desired airdrop type, randomised when not provided + * @returns Array of LootItem objects + */ + generateAirdropLoot(forcedAirdropType?: any): IGetAirdropLootResponse; + /** + * Create a container create item based on passed in airdrop type + * @param airdropType What tpye of container: weapon/common etc + * @returns Item + */ + protected getAirdropCrateItem(airdropType: SptAirdropTypeEnum): IItem; + /** + * Randomly pick a type of airdrop loot using weighted values from config + * @returns airdrop type value + */ + protected chooseAirdropType(): SptAirdropTypeEnum; + /** + * Get the configuration for a specific type of airdrop + * @param airdropType Type of airdrop to get settings for + * @returns LootRequest + */ + protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): IAirdropLootRequest; +} diff --git a/types/services/BotEquipmentFilterService.d.ts b/types/services/BotEquipmentFilterService.d.ts index 780d7a2..10b8af6 100644 --- a/types/services/BotEquipmentFilterService.d.ts +++ b/types/services/BotEquipmentFilterService.d.ts @@ -1,8 +1,8 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; -import { EquipmentFilterDetails, EquipmentFilters, IAdjustmentDetails, IBotConfig, WeightingAdjustmentDetails } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentChances, IBotType, IGeneration, IGenerationData, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { EquipmentFilters, IAdjustmentDetails, IBotConfig, IEquipmentFilterDetails, IWeightingAdjustmentDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; export declare class BotEquipmentFilterService { @@ -20,19 +20,19 @@ export declare class BotEquipmentFilterService { * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: IBotGenerationDetails): void; /** * Iterate over the changes passed in and apply them to baseValues parameter * @param equipmentChanges Changes to apply * @param baseValues data to update */ - protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void; + protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | IModsChances): void; /** * Iterate over the Generation changes and alter data in baseValues.Generation * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: IGeneration): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return @@ -51,28 +51,28 @@ export declare class BotEquipmentFilterService { * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): IEquipmentFilterDetails | undefined; /** * 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 | undefined; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): IEquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): IWeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): IWeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored @@ -80,7 +80,7 @@ export declare class BotEquipmentFilterService { * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: IEquipmentFilterDetails, whitelist: IEquipmentFilterDetails): void; /** * Filter bot cartridges based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored @@ -89,7 +89,7 @@ export declare class BotEquipmentFilterService { * @param whitelist equipment on this list should be used exclusively * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: IEquipmentFilterDetails, whitelist: IEquipmentFilterDetails): void; /** * Add/Edit weighting changes to bot items using values from config/bot.json/equipment * @param weightingAdjustments Weighting change to apply to bot diff --git a/types/services/BotEquipmentModPoolService.d.ts b/types/services/BotEquipmentModPoolService.d.ts index 7b2b442..080dc7b 100644 --- a/types/services/BotEquipmentModPoolService.d.ts +++ b/types/services/BotEquipmentModPoolService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Mods } from "@spt/models/eft/common/tables/IBotType"; +import { IMods } from "@spt/models/eft/common/tables/IBotType"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -16,8 +16,8 @@ export declare class BotEquipmentModPoolService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected weaponModPool: Mods; - protected gearModPool: Mods; + protected weaponModPool: IMods; + protected gearModPool: IMods; protected weaponPoolGenerated: boolean; protected armorPoolGenerated: boolean; constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseService: DatabaseService, localisationService: LocalisationService, configServer: ConfigServer); diff --git a/types/services/BotGenerationCacheService.d.ts b/types/services/BotGenerationCacheService.d.ts index ba27266..181031a 100644 --- a/types/services/BotGenerationCacheService.d.ts +++ b/types/services/BotGenerationCacheService.d.ts @@ -43,5 +43,7 @@ export declare class BotGenerationCacheService { * Does cache have a bot with requested key * @returns false if empty */ - cacheHasBotOfRole(key: string): boolean; + cacheHasBotWithKey(key: string, size?: number): boolean; + getCachedBotCount(key: string): number; + createCacheKey(role: string, difficulty: string): string; } diff --git a/types/services/BotLootCacheService.d.ts b/types/services/BotLootCacheService.d.ts index 2b51c5b..815d2ab 100644 --- a/types/services/BotLootCacheService.d.ts +++ b/types/services/BotLootCacheService.d.ts @@ -1,7 +1,7 @@ import { PMCLootGenerator } from "@spt/generators/PMCLootGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBotLootCache, LootCacheType } from "@spt/models/spt/bots/IBotLootCache"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; @@ -50,25 +50,25 @@ export declare class BotLootCacheService { * @param props * @returns */ - protected isBulletOrGrenade(props: Props): boolean; + protected isBulletOrGrenade(props: IProps): boolean; /** * Internal and external magazine have this property * @param props * @returns */ - protected isMagazine(props: Props): boolean; + protected isMagazine(props: IProps): boolean; /** * Medical use items (e.g. morphine/lip balm/grizzly) * @param props * @returns */ - protected isMedicalItem(props: Props): boolean; + protected isMedicalItem(props: IProps): boolean; /** * Grenades have this property (e.g. smoke/frag/flash grenades) * @param props * @returns */ - protected isGrenade(props: Props): boolean; + protected isGrenade(props: IProps): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; protected isCurrency(tpl: string): boolean; diff --git a/types/services/BotNameService.d.ts b/types/services/BotNameService.d.ts new file mode 100644 index 0000000..056bd0f --- /dev/null +++ b/types/services/BotNameService.d.ts @@ -0,0 +1,47 @@ +import { BotHelper } from "@spt/helpers/BotHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +import { DatabaseService } from "./DatabaseService"; +import { LocalisationService } from "./LocalisationService"; +export declare class BotNameService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected profileHelper: ProfileHelper; + protected botHelper: BotHelper; + protected databaseService: DatabaseService; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected cloner: ICloner; + protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; + protected usedNameCache: Set; + constructor(logger: ILogger, randomUtil: RandomUtil, profileHelper: ProfileHelper, botHelper: BotHelper, databaseService: DatabaseService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + /** + * Clear out any entries in Name Set + */ + clearNameCache(): void; + /** + * Create a unique bot nickname + * @param botJsonTemplate bot JSON data from db + * @param botGenerationDetails + * @param botRole role of bot e.g. assault + * @param uniqueRoles Lowercase roles to always make unique + * @param sessionId OPTIONAL: profile session id + * @returns Nickname for bot + */ + generateUniqueBotNickname(botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails, botRole: string, uniqueRoles?: string[]): string; + /** + * Should this bot have a name like "name (Pmc Name)" + * @param botRole Role bot has + * @returns True if name should be simulated pscav + */ + protected shouldSimulatePlayerScavName(botRole: string): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; +} diff --git a/types/services/BotWeaponModLimitService.d.ts b/types/services/BotWeaponModLimitService.d.ts index 63c4967..cce8f29 100644 --- a/types/services/BotWeaponModLimitService.d.ts +++ b/types/services/BotWeaponModLimitService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -39,7 +39,7 @@ export declare class BotWeaponModLimitService { * @param modsParent The parent of the mod to be checked * @returns true if over item limit */ - weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: Item[]): boolean; + weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: IItem[]): boolean; /** * Check if the specific item type on the weapon has reached the set limit * @param modTpl log mod tpl if over type limit diff --git a/types/services/CircleOfCultistService.d.ts b/types/services/CircleOfCultistService.d.ts new file mode 100644 index 0000000..e4d3410 --- /dev/null +++ b/types/services/CircleOfCultistService.d.ts @@ -0,0 +1,132 @@ +import { HideoutHelper } from "@spt/helpers/HideoutHelper"; +import { InventoryHelper } from "@spt/helpers/InventoryHelper"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { PresetHelper } from "@spt/helpers/PresetHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { IBotHideoutArea } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IStageRequirement } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; +import { IHideoutProduction, IHideoutProductionData, IRequirement, IRequirementBase } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; +import { IDirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class CircleOfCultistService { + protected logger: ILogger; + protected timeUtil: TimeUtil; + protected cloner: ICloner; + protected eventOutputHolder: EventOutputHolder; + protected randomUtil: RandomUtil; + protected hashUtil: HashUtil; + protected itemHelper: ItemHelper; + protected presetHelper: PresetHelper; + protected profileHelper: ProfileHelper; + protected inventoryHelper: InventoryHelper; + protected hideoutHelper: HideoutHelper; + protected databaseService: DatabaseService; + protected itemFilterService: ItemFilterService; + protected seasonalEventService: SeasonalEventService; + protected configServer: ConfigServer; + protected static circleOfCultistSlotId: string; + protected hideoutConfig: IHideoutConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, cloner: ICloner, eventOutputHolder: EventOutputHolder, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, hideoutHelper: HideoutHelper, databaseService: DatabaseService, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + /** + * Start a sacrifice event + * Generate rewards + * Delete sacrificed items + * @param sessionId Session id + * @param pmcData Player profile doing sacrifice + * @param request Client request + * @returns IItemEventRouterResponse + */ + startSacrifice(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse; + /** + * Register production inside player profile + * @param sessionId Session id + * @param pmcData Player profile + * @param recipeId Recipe id + * @param sacrificedItems Items player sacrificed + * @param rewardAmountRoubles Rouble amount to reward player in items with + * @param directRewardSettings OPTIONAL: If craft is giving direct rewards + */ + protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: IItem[], rewardAmountRoubles: number, directRewardSettings?: IDirectRewardSettings): void; + /** + * Get the circle craft time as seconds, value is based on reward item value + * OR rewards are direct, then use custom craft time defined in oarameter object + * @param rewardAmountRoubles Value of rewards in roubles + * @param directRewardSettings OPTIONAL: If craft is giving direct rewards + * @returns craft time seconds + */ + protected getCircleCraftTimeSeconds(rewardAmountRoubles: number, directRewardSettings?: IDirectRewardSettings): number; + /** + * Get the items player sacrificed in circle + * @param pmcData Player profile + * @returns Array of its from player inventory + */ + protected getSacrificedItems(pmcData: IPmcData): IItem[]; + /** + * Given a pool of items + rouble budget, pick items until the budget is reached + * @param rewardItemTplPool Items that can be picekd + * @param rewardBudget Rouble budget to reach + * @param cultistCircleStashId Id of stash item + * @returns Array of item arrays + */ + protected getRewardsWithinBudget(rewardItemTplPool: string[], rewardBudget: number, cultistCircleStashId: string): IItem[][]; + /** + * Give every item as a reward that's passed in + * @param rewardTpls Item tpls to turn into reward items + * @param cultistCircleStashId Id of stash item + * @returns Array of item arrays + */ + protected getExplicitRewards(explicitRewardSettings: IDirectRewardSettings, cultistCircleStashId: string): IItem[][]; + /** + * Explicit rewards have thier own stack sizes as they dont use a reward rouble pool + * @param rewardTpl Item being rewarded to get stack size of + * @returns stack size of item + */ + protected getExplicitRewardBaseTypeStackSize(rewardTpl: string): number; + /** + * Get the size of a reward items stack + * 1 for everything except ammo, ammo can be between min stack and max stack + * @param itemTpl Item chosen + * @param rewardPoolRemaining Rouble amount of pool remaining to fill + * @returns Size of stack + */ + protected getRewardStackSize(itemTpl: string, rewardPoolRemaining: number): number; + /** + * Get a pool of tpl IDs of items the player needs to complete hideout crafts/upgrade areas + * @param sessionId Session id + * @param pmcData Profile of player who will be getting the rewards + * @returns Array of tpls + */ + protected getCultistCircleRewardPool(sessionId: string, pmcData: IPmcData): string[]; + /** + * Get all active hideout areas + * @param areas Hideout areas to iterate over + * @returns Active area array + */ + protected getPlayerAccessibleHideoutAreas(areas: IBotHideoutArea[]): IBotHideoutArea[]; + /** + * Get all recipes the player has access to, includes base + unlocked recipes + * @param unlockedRecipes Recipes player has flagged as unlocked + * @param allRecipes All recipes + * @returns Array of recipes + */ + protected getPlayerAccessibleRecipes(unlockedRecipes: string[], allRecipes: IHideoutProductionData): IHideoutProduction[]; + /** + * Iterate over passed in hideout requirements and return the Item + * @param requirements Requirements to iterate over + * @returns Array of item requirements + */ + protected getItemRequirements(requirements: IRequirementBase[]): (IStageRequirement | IRequirement)[]; +} diff --git a/types/services/CustomLocationWaveService.d.ts b/types/services/CustomLocationWaveService.d.ts index c72d5bb..f69ce2b 100644 --- a/types/services/CustomLocationWaveService.d.ts +++ b/types/services/CustomLocationWaveService.d.ts @@ -1,4 +1,4 @@ -import { BossLocationSpawn, Wave } from "@spt/models/eft/common/ILocationBase"; +import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -16,13 +16,13 @@ export declare class CustomLocationWaveService { * @param locationId e.g. factory4_day, bigmap * @param waveToAdd Boss wave to add to map */ - addBossWaveToMap(locationId: string, waveToAdd: BossLocationSpawn): void; + addBossWaveToMap(locationId: string, waveToAdd: IBossLocationSpawn): void; /** * Add a normal bot wave to a map * @param locationId e.g. factory4_day, bigmap * @param waveToAdd Wave to add to map */ - addNormalWaveToMap(locationId: string, waveToAdd: Wave): void; + addNormalWaveToMap(locationId: string, waveToAdd: IWave): void; /** * Clear all custom boss waves from a map * @param locationId e.g. factory4_day, bigmap diff --git a/types/services/DatabaseService.d.ts b/types/services/DatabaseService.d.ts index 711a069..cbe3307 100644 --- a/types/services/DatabaseService.d.ts +++ b/types/services/DatabaseService.d.ts @@ -3,6 +3,7 @@ import { ILocation } from "@spt/models/eft/common/ILocation"; import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { ILocationServices } from "@spt/models/eft/common/tables/ILocationServices"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; import { IQuest } from "@spt/models/eft/common/tables/IQuest"; @@ -110,4 +111,8 @@ export declare class DatabaseService { * @returns assets/database/traders/ */ getTrader(traderId: string): ITrader; + /** + * @returns assets/database/locationServices/ + */ + getLocationServices(): ILocationServices; } diff --git a/types/services/FenceService.d.ts b/types/services/FenceService.d.ts index c156122..b4079e6 100644 --- a/types/services/FenceService.d.ts +++ b/types/services/FenceService.d.ts @@ -3,8 +3,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IItem, IUpdRepairable } from "@spt/models/eft/common/tables/IItem"; +import { ISlot, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -13,9 +13,9 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** * Handle actions surrounding Fence * e.g. generating or refreshing assorts / get next refresh time @@ -79,21 +79,21 @@ export declare class FenceService { * @param items the items to add with all its childrens * @param mainItem the most parent item of the array */ - addItemsToFenceAssort(items: Item[], mainItem: Item): void; + addItemsToFenceAssort(items: IItem[], mainItem: IItem): void; /** * Calculates the overall price for an item (with all its children) * @param itemTpl the item tpl to calculate the fence price for * @param items the items (with its children) to calculate fence price for * @returns the fence price of the item */ - getItemPrice(itemTpl: string, items: Item[]): number; + getItemPrice(itemTpl: string, items: IItem[]): number; /** * Calculate the overall price for an ammo box, where only one item is * the ammo box itself and every other items are the bullets in that box * @param items the ammo box (and all its children ammo items) * @returns the price of the ammo box */ - protected getAmmoBoxPrice(items: Item[]): number; + protected getAmmoBoxPrice(items: IItem[]): number; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -115,7 +115,7 @@ export declare class FenceService { * @param modifier value to multiply item price by * @param presetModifier value to multiply preset price by */ - protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void; + protected adjustItemPriceByModifier(item: IItem, assort: ITraderAssort, modifier: number, presetModifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -146,7 +146,7 @@ export declare class FenceService { * @param generationValues Base counts assorts should be adjusted to * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; + protected getItemCountsToGenerate(assortItems: IItem[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -158,7 +158,7 @@ export declare class FenceService { * @param assort Trader assort to remove item from * @param rootItems Pool of root items to pick from to remove */ - protected removeRandomItemFromAssorts(assort: ITraderAssort, rootItems: Item[]): void; + protected removeRandomItemFromAssorts(assort: ITraderAssort, rootItems: IItem[]): void; /** * Get an integer rounded count of items to replace based on percentrage from traderConfig value * @param totalItemCount total item count @@ -217,14 +217,14 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; + protected getMatchingItem(rootItemBeingAdded: IItem, itemDbDetails: ITemplateItem, itemsWithChildren: IItem[][]): IItem | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort * @param itemDbDetails Item we want to add db details * @returns True item should be force stacked */ - protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemShouldBeForceStacked(existingItem: IItem, itemDbDetails: ITemplateItem): boolean; protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) @@ -232,7 +232,7 @@ export declare class FenceService { * @param itemRoot Root item having price adjusted * @param itemTemplate Db template of item */ - protected adjustItemPriceByQuality(barterSchemes: Record, itemRoot: Item, itemTemplate: ITemplateItem): void; + protected adjustItemPriceByQuality(barterSchemes: Record, itemRoot: IItem, itemTemplate: ITemplateItem): void; protected getMatchingItemLimit(itemTypeLimits: Record; + getGifts(): Record; /** * Get an array of all gift ids * @returns string array of gift ids @@ -47,13 +47,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string | undefined; + protected getSenderId(giftData: IGift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType | undefined; + protected getMessageType(giftData: IGift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/types/services/InMemoryCacheService.d.ts b/types/services/InMemoryCacheService.d.ts new file mode 100644 index 0000000..6f11dd7 --- /dev/null +++ b/types/services/InMemoryCacheService.d.ts @@ -0,0 +1,29 @@ +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class InMemoryCacheService { + protected cloner: ICloner; + protected cacheData: Record; + constructor(cloner: ICloner); + /** + * Store data into an in-memory object + * @param key key to store data against + * @param dataToCache - Data to store in cache + */ + storeByKey(key: string, dataToCache: any): void; + /** + * Retreve data stored by a key + * @param key key + * @returns Stored data + */ + getDataByKey(key: string): any | undefined; + /** + * Does data exists against the provided key + * @param key Key to check for data against + * @returns true if exists + */ + hasStoredDataByKey(key: string): boolean; + /** + * Remove data stored against key + * @param key Key to remove data against + */ + clearDataStoredByKey(key: string): void; +} diff --git a/types/services/InsuranceService.d.ts b/types/services/InsuranceService.d.ts index 0000e66..8b7b1b3 100644 --- a/types/services/InsuranceService.d.ts +++ b/types/services/InsuranceService.d.ts @@ -1,81 +1,59 @@ -import { DialogueHelper } from "@spt/helpers/DialogueHelper"; -import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { SecureContainerHelper } from "@spt/helpers/SecureContainerHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderBase } from "@spt/models/eft/common/tables/ITrader"; -import { IInsuredItemsData } from "@spt/models/eft/inRaid/IInsuredItemsData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; -import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { IInsuranceEquipmentPkg } from "@spt/models/spt/services/IInsuranceEquipmentPkg"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; -import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class InsuranceService { protected logger: ILogger; protected databaseService: DatabaseService; - protected secureContainerHelper: SecureContainerHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected traderHelper: TraderHelper; - protected dialogueHelper: DialogueHelper; - protected handbookHelper: HandbookHelper; + protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; - protected localeService: LocaleService; protected mailSendService: MailSendService; protected configServer: ConfigServer; protected cloner: ICloner; - protected insured: Record>; + protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - protected lostOnDeathConfig: ILostOnDeathConfig; - constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, profileHelper: ProfileHelper, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); /** * Does player have insurance array * @param sessionId Player id * @returns True if exists */ - insuranceExists(sessionId: string): boolean; + isuranceDictionaryExists(sessionId: string): boolean; /** * Get all insured items by all traders for a profile * @param sessionId Profile id (session id) * @returns Item array */ - getInsurance(sessionId: string): Record; - /** - * Get insured items by profile id + trader id - * @param sessionId Profile id (session id) - * @param traderId Trader items were insured with - * @returns Item array - */ - getInsuranceItems(sessionId: string, traderId: string): Item[]; + getInsurance(sessionId: string): Record; resetInsurance(sessionId: string): void; /** - * Sends stored insured items as message to player - * @param pmcData profile to send insured items to + * Sends `i will go look for your stuff` trader message + + * Store lost insurance items inside profile for later retreval + * @param pmcData Profile to send insured items to * @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; - /** - * Check all root insured items and remove location property + set slotId to 'hideout' - * @param sessionId Session id - * @param traderId Trader id + * @param mapId Id of the location player died/exited that caused the insurance to be issued on */ - protected removeLocationProperty(sessionId: string, traderId: string): void; + startPostRaidInsuranceLostProcess(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Get a timestamp of when insurance items should be sent to player based on trader used to insure * Apply insurance return bonus if found in profile @@ -84,23 +62,6 @@ export declare class InsuranceService { * @returns Timestamp to return items to player in seconds */ protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number; - /** - * Create insurance equipment packages that should be sent to the user. The packages should contain items that have - * been lost in a raid and should be returned to the player through the insurance system. - * - * NOTE: We do not have data on items that were dropped in a raid. This means we have to pull item data from the - * profile at the start of the raid to return to the player in insurance. Because of this, the item - * positioning may differ from the position the item was in when the player died. Apart from removing all - * positioning, this is the best we can do. >:{} - * - * @param pmcData Player profile - * @param offraidData Post-raid data - * @param preRaidGear Pre-raid data - * @param sessionID Session id - * @param playerDied Did player die in raid - * @returns Array of insured items lost in raid - */ - getGearLostInRaid(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string, playerDied: boolean): IInsuranceEquipmentPkg[]; /** * Take the insurance item packages within a profile session and ensure that each of the items in that package are * not orphaned from their parent ID. @@ -115,19 +76,20 @@ export declare class InsuranceService { */ storeGearLostInRaidToSendLater(sessionID: string, equipmentPkg: IInsuranceEquipmentPkg[]): void; /** - * Take preraid item and update properties to ensure its ready to be given to player in insurance return mail - * @param pmcData Player profile - * @param preRaidItemWithChildren Insured item (with children) as it was pre-raid - * @param allItemsFromClient Item data when player left raid (durability values) - * @returns Item (with children) to send to player + * For the passed in items, find the trader it was insured against + * @param sessionId Session id + * @param lostInsuredItems Insured items lost in a raid + * @param pmcProfile Player profile + * @returns IInsuranceEquipmentPkg array */ - protected getInsuredItemDetails(pmcData: IPmcData, preRaidItem: Item, insuredItemFromClient: IInsuredItemsData): Item; + mapInsuredItemsToTrader(sessionId: string, lostInsuredItems: IItem[], pmcProfile: IPmcData): IInsuranceEquipmentPkg[]; /** - * Reset slotId property to "hideout" when necessary (used to be in ) - * @param pmcData Players pmcData.Inventory.equipment value - * @param itemToReturn item we will send to player as insurance return + * Some items should never be returned in insurance but BSG send them in the request + * @param lostItem Item being returned in insurance + * @param inventoryItems Player inventory + * @returns True if item */ - protected updateSlotIdValue(playerBaseInventoryEquipmentId: string, itemToReturn: Item): void; + protected itemCannotBeLostOnDeath(lostItem: IItem, inventoryItems: IItem[]): boolean; /** * Add gear item to InsuredItems array in player profile * @param sessionID Session id @@ -155,7 +117,7 @@ export declare class InsuranceService { * @param traderId Trader item insured with * @param itemToAdd Insured item (with children) */ - addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: Item): void; + addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: IItem): void; /** * Get price of insurance * multiplier from config * @param pmcData Player profile @@ -163,7 +125,7 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: IItem, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. * @param sessionID Players id diff --git a/types/services/LegacyLocationLifecycleService.d.ts b/types/services/LegacyLocationLifecycleService.d.ts new file mode 100644 index 0000000..b3c20df --- /dev/null +++ b/types/services/LegacyLocationLifecycleService.d.ts @@ -0,0 +1,105 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; +import { LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; +import { LootGenerator } from "@spt/generators/LootGenerator"; +import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; +import { HealthHelper } from "@spt/helpers/HealthHelper"; +import { InRaidHelper } from "@spt/helpers/InRaidHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { IEndOfflineRaidRequestData } from "@spt/models/eft/match/IEndOfflineRaidRequestData"; +import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IMatchConfig } from "@spt/models/spt/config/IMatchConfig"; +import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { MailSendService } from "@spt/services/MailSendService"; +import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; +import { PmcChatResponseService } from "@spt/services/PmcChatResponseService"; +import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class LegacyLocationLifecycleService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected saveServer: SaveServer; + protected timeUtil: TimeUtil; + protected randomUtil: RandomUtil; + protected profileHelper: ProfileHelper; + protected databaseService: DatabaseService; + protected inRaidHelper: InRaidHelper; + protected healthHelper: HealthHelper; + protected matchBotDetailsCacheService: MatchBotDetailsCacheService; + protected pmcChatResponseService: PmcChatResponseService; + protected playerScavGenerator: PlayerScavGenerator; + protected traderHelper: TraderHelper; + protected localisationService: LocalisationService; + protected insuranceService: InsuranceService; + protected botLootCacheService: BotLootCacheService; + protected configServer: ConfigServer; + protected botGenerationCacheService: BotGenerationCacheService; + protected mailSendService: MailSendService; + protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected lootGenerator: LootGenerator; + protected applicationContext: ApplicationContext; + protected locationLootGenerator: LocationLootGenerator; + protected cloner: ICloner; + protected matchConfig: IMatchConfig; + protected inRaidConfig: IInRaidConfig; + protected traderConfig: ITraderConfig; + protected ragfairConfig: IRagfairConfig; + protected hideoutConfig: IHideoutConfig; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + /** + * Handle client/match/offline/end + * @deprecated + */ + endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void; + /** + * Handle when a player extracts using a car - Add rep to fence + * @param extractName name of the extract used + * @param pmcData Player profile + * @param sessionId Session id + */ + protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void; + /** + * Get the fence rep gain from using a car or coop extract + * @param pmcData Profile + * @param baseGain amount gained for the first extract + * @param extractCount Number of times extract was taken + * @returns Fence standing after taking extract + */ + protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number; + /** + * Was extract by car + * @param extractName name of extract + * @returns true if car extract + */ + protected extractWasViaCar(extractName: string): boolean; + /** + * Did player take a COOP extract + * @param extractName Name of extract player took + * @returns True if coop extract + */ + protected extractWasViaCoop(extractName: string): boolean; + /** + * Handle when a player extracts using a coop extract - add rep to fence + * @param sessionId Session/player id + * @param pmcData Profile + * @param extractName Name of extract taken + */ + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; + protected sendCoopTakenFenceMessage(sessionId: string): void; +} diff --git a/types/services/LocalisationService.d.ts b/types/services/LocalisationService.d.ts index 42dfa4e..855c138 100644 --- a/types/services/LocalisationService.d.ts +++ b/types/services/LocalisationService.d.ts @@ -1,8 +1,8 @@ -import { I18n } from "i18n"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { LocaleService } from "@spt/services/LocaleService"; import { RandomUtil } from "@spt/utils/RandomUtil"; +import { I18n } from "i18n"; /** * Handles translating server text into different langauges */ diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts new file mode 100644 index 0000000..ba90302 --- /dev/null +++ b/types/services/LocationLifecycleService.d.ts @@ -0,0 +1,199 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; +import { LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; +import { LootGenerator } from "@spt/generators/LootGenerator"; +import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; +import { HealthHelper } from "@spt/helpers/HealthHelper"; +import { InRaidHelper } from "@spt/helpers/InRaidHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { Common, IQuestStatus, ITraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IEndLocalRaidRequestData, IEndRaidResult } from "@spt/models/eft/match/IEndLocalRaidRequestData"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; +import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; +import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { BotNameService } from "@spt/services/BotNameService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { MailSendService } from "@spt/services/MailSendService"; +import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; +import { PmcChatResponseService } from "@spt/services/PmcChatResponseService"; +import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class LocationLifecycleService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected saveServer: SaveServer; + protected timeUtil: TimeUtil; + protected randomUtil: RandomUtil; + protected profileHelper: ProfileHelper; + protected databaseService: DatabaseService; + protected inRaidHelper: InRaidHelper; + protected healthHelper: HealthHelper; + protected matchBotDetailsCacheService: MatchBotDetailsCacheService; + protected pmcChatResponseService: PmcChatResponseService; + protected playerScavGenerator: PlayerScavGenerator; + protected traderHelper: TraderHelper; + protected localisationService: LocalisationService; + protected insuranceService: InsuranceService; + protected botLootCacheService: BotLootCacheService; + protected configServer: ConfigServer; + protected botGenerationCacheService: BotGenerationCacheService; + protected mailSendService: MailSendService; + protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected botNameService: BotNameService; + protected lootGenerator: LootGenerator; + protected applicationContext: ApplicationContext; + protected locationLootGenerator: LocationLootGenerator; + protected cloner: ICloner; + protected inRaidConfig: IInRaidConfig; + protected traderConfig: ITraderConfig; + protected ragfairConfig: IRagfairConfig; + protected hideoutConfig: IHideoutConfig; + protected locationConfig: ILocationConfig; + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, botNameService: BotNameService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + /** Handle client/match/local/start */ + startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData; + /** + * Replace map exits with scav exits when player is scavving + * @param playerSide Playders side (savage/usec/bear) + * @param location id of map being loaded + * @param locationData Maps locationbase data + */ + protected adjustExtracts(playerSide: string, location: string, locationData: ILocationBase): void; + /** + * Adjust the bot hostility values prior to entering a raid + * @param location map to adjust values of + */ + protected adjustBotHostilitySettings(location: ILocationBase): void; + /** + * Generate a maps base location (cloned) and loot + * @param name Map name + * @param generateLoot OPTIONAL - Should loot be generated for the map before being returned + * @returns ILocationBase + */ + protected generateLocationAndLoot(name: string, generateLoot?: boolean): ILocationBase; + /** Handle client/match/local/end */ + endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void; + /** + * Was extract by car + * @param extractName name of extract + * @returns True if extract was by car + */ + protected extractWasViaCar(extractName: string): boolean; + /** + * Handle when a player extracts using a car - Add rep to fence + * @param extractName name of the extract used + * @param pmcData Player profile + * @param sessionId Session id + */ + protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void; + /** + * Handle when a player extracts using a coop extract - add rep to fence + * @param sessionId Session/player id + * @param pmcData Profile + * @param extractName Name of extract taken + */ + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; + /** + * Get the fence rep gain from using a car or coop extract + * @param pmcData Profile + * @param baseGain amount gained for the first extract + * @param extractCount Number of times extract was taken + * @returns Fence standing after taking extract + */ + protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number; + protected sendCoopTakenFenceMessage(sessionId: string): void; + /** + * Did player take a COOP extract + * @param extractName Name of extract player took + * @returns True if coop extract + */ + protected extractTakenWasCoop(extractName: string): boolean; + protected handlePostRaidPlayerScav(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, isTransfer: boolean, request: IEndLocalRaidRequestData): void; + /** + * + * @param sessionId Player id + * @param pmcProfile Pmc profile + * @param scavProfile Scav profile + * @param isDead Player died/got left behind in raid + * @param isSurvived Not same as opposite of `isDead`, specific status + * @param request + * @param locationName + */ + protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, isSurvived: boolean, isTransfer: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + /** + * Convert post-raid quests into correct format + * Quest status comes back as a string version of the enum `Success`, not the expected value of 1 + * @param questsToProcess + * @returns IQuestStatus + */ + protected processPostRaidQuests(questsToProcess: IQuestStatus[]): IQuestStatus[]; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; + /** + * Check if player used BTR or transit item sending service and send items to player via mail if found + * @param sessionId Session id + * @param request End raid request + */ + protected handleItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; + protected transferItemDelivery(sessionId: string, traderId: string, items: IItem[]): void; + protected handleInsuredItemLostEvent(sessionId: string, preRaidPmcProfile: IPmcData, request: IEndLocalRaidRequestData, locationName: string): void; + /** + * Return the equipped items from a players inventory + * @param items Players inventory to search through + * @returns an array of equipped items + */ + protected getEquippedGear(items: IItem[]): IItem[]; + /** + * Checks to see if player survives. run through will return false + * @param statusOnExit Exit value from offraidData object + * @returns true if Survived + */ + protected isPlayerSurvived(results: IEndRaidResult): boolean; + /** + * Is the player dead after a raid - dead = anything other than "survived" / "runner" + * @param results Post raid request + * @returns true if dead + */ + protected isPlayerDead(results: IEndRaidResult): boolean; + /** + * Has the player moved from one map to another + * @param results Post raid request + * @returns True if players transfered + */ + protected isMapToMapTransfer(results: IEndRaidResult): boolean; + /** + * Reset the skill points earned in a raid to 0, ready for next raid + * @param commonSkills Profile common skills to update + */ + protected resetSkillPointsEarnedDuringRaid(commonSkills: Common[]): void; + /** + * merge two dictionaries together + * Prioritise pair that has true as a value + * @param primary main dictionary + * @param secondary Secondary dictionary + */ + protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void; +} diff --git a/types/services/MailSendService.d.ts b/types/services/MailSendService.d.ts index 8f1f974..5887ee7 100644 --- a/types/services/MailSendService.d.ts +++ b/types/services/MailSendService.d.ts @@ -3,8 +3,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IDialogue, IMessage, IMessageContentRagfair, IMessageItems, ISystemData, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: IMessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: IMessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -55,7 +55,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: IItem[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void; /** * Send a message from SYSTEM to the player with or without items with localised text * @param sessionId The session ID to send the message to @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: IItem[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: IItem[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -92,34 +92,34 @@ export declare class MailSendService { * @param messageDetails Various details on what the message must contain/do * @returns Message */ - protected createDialogMessage(dialogId: string, messageDetails: ISendMessageDetails): Message; + protected createDialogMessage(dialogId: string, messageDetails: ISendMessageDetails): IMessage; /** * Add items to message and adjust various properties to reflect the items being added * @param message Message to add items to * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; + protected addRewardItemsToMessage(message: IMessage, itemsToSendToPlayer: IMessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed * @param messageDetails * @returns Sanitised items */ - protected processItemsBeforeAddingToMail(dialogType: MessageType, messageDetails: ISendMessageDetails): MessageItems; + protected processItemsBeforeAddingToMail(dialogType: MessageType, messageDetails: ISendMessageDetails): IMessageItems; /** * Try to find the most correct item to be the 'primary' item in a reward mail * @param items Possible items to choose from * @returns Chosen 'primary' item */ - protected getBaseItemFromRewards(items: Item[]): Item; + protected getBaseItemFromRewards(items: IItem[]): IItem; /** * Get a dialog with a specified entity (user/trader) * Create and store empty dialog if none exists in profile * @param messageDetails Data on what message should do * @returns Relevant Dialogue */ - protected getDialog(messageDetails: ISendMessageDetails): Dialogue; + protected getDialog(messageDetails: ISendMessageDetails): IDialogue; /** * Get the appropriate sender id by the sender enum type * @param messageDetails diff --git a/types/services/MapMarkerService.d.ts b/types/services/MapMarkerService.d.ts index aed5430..a3ef6df 100644 --- a/types/services/MapMarkerService.d.ts +++ b/types/services/MapMarkerService.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; import { IInventoryDeleteMarkerRequestData } from "@spt/models/eft/inventory/IInventoryDeleteMarkerRequestData"; import { IInventoryEditMarkerRequestData } from "@spt/models/eft/inventory/IInventoryEditMarkerRequestData"; @@ -13,21 +13,21 @@ export declare class MapMarkerService { * @param request Add marker request * @returns Item */ - createMarkerOnMap(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData): Item; + createMarkerOnMap(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData): IItem; /** * Delete a map marker * @param pmcData Player profile * @param request Delete marker request * @returns Item */ - deleteMarkerFromMap(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData): Item; + deleteMarkerFromMap(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData): IItem; /** * Edit an existing map marker * @param pmcData Player profile * @param request Edit marker request * @returns Item */ - editMarkerOnMap(pmcData: IPmcData, request: IInventoryEditMarkerRequestData): Item; + editMarkerOnMap(pmcData: IPmcData, request: IInventoryEditMarkerRequestData): IItem; /** * Strip out characters from note string that are not: letter/numbers/unicode/spaces * @param mapNoteText Marker text to sanitise diff --git a/types/services/PaymentService.d.ts b/types/services/PaymentService.d.ts index 61d5731..51fced1 100644 --- a/types/services/PaymentService.d.ts +++ b/types/services/PaymentService.d.ts @@ -4,7 +4,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "@spt/models/eft/trade/IProcessSellTradeRequestData"; @@ -66,7 +66,7 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns Sorting money items */ - protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string, playerStashId: string): Item[]; + protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string, playerStashId: string): IItem[]; /** * Prioritise player stash first over player inventory * Post-raid healing would often take money out of the players pockets/secure container @@ -76,7 +76,7 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns sort order */ - protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[], playerStashId: string): number; + protected prioritiseStashSort(a: IItem, b: IItem, inventoryItems: IItem[], playerStashId: string): number; /** * Recursivly check items parents to see if it is inside the players inventory, not stash * @param itemId item id to check @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: IItem[], playerStashId: string): boolean; } diff --git a/types/services/PmcChatResponseService.d.ts b/types/services/PmcChatResponseService.d.ts index 4a22f10..f44b12d 100644 --- a/types/services/PmcChatResponseService.d.ts +++ b/types/services/PmcChatResponseService.d.ts @@ -1,7 +1,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; +import { IAggressor, IVictim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; @@ -31,14 +31,14 @@ export declare class PmcChatResponseService { * @param pmcVictims Array of bots killed by player * @param pmcData Player profile */ - sendVictimResponse(sessionId: string, pmcVictims: Victim[], pmcData: IPmcData): void; + sendVictimResponse(sessionId: string, pmcVictims: IVictim[], pmcData: IPmcData): void; /** * Not fully implemented yet, needs method of acquiring killers details after raid * @param sessionId Session id * @param pmcData Players profile * @param killer The bot who killed the player */ - sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: Aggressor): void; + sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: IAggressor): void; /** * Choose a localised message to send the player (different if sender was killed or killed player) * @param isVictim Is the message coming from a bot killed by the player @@ -87,11 +87,11 @@ export declare class PmcChatResponseService { * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ - protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + protected chooseRandomVictim(pmcVictims: IVictim[]): IUserDialogInfo; /** * Convert a victim object into a IUserDialogInfo object * @param pmcVictim victim to convert * @returns IUserDialogInfo */ - protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; + protected getVictimDetails(pmcVictim: IVictim): IUserDialogInfo; } diff --git a/types/services/ProfileFixerService.d.ts b/types/services/ProfileFixerService.d.ts index 525b867..43d1d11 100644 --- a/types/services/ProfileFixerService.d.ts +++ b/types/services/ProfileFixerService.d.ts @@ -4,11 +4,11 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Bonus, HideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; +import { IBonus, IHideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; -import { ISptProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt/models/eft/profile/ISptProfile"; +import { IStageBonus } from "@spt/models/eft/hideout/IHideoutArea"; +import { IEquipmentBuild, IMagazineBuild, ISptProfile, IWeaponBuild } from "@spt/models/eft/profile/ISptProfile"; import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; @@ -16,11 +16,11 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; import { Watermark } from "@spt/utils/Watermark"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class ProfileFixerService { protected logger: ILogger; protected watermark: Watermark; @@ -49,73 +49,46 @@ export declare class ProfileFixerService { * @param scavProfile profile to check and fix */ checkForAndFixScavProfileIssues(scavProfile: IPmcData): void; - protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; - protected addMissingHallOfFameContainerImprovements(pmcProfile: IPmcData): void; - protected ensureGunStandLevelsMatch(pmcProfile: IPmcData): void; - protected addHideoutAreaStashes(pmcProfile: IPmcData): void; - protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; /** - * Add tag to profile to indicate when it was made - * @param fullProfile + * Attempt to fix common item issues that corrupt profiles + * @param pmcProfile Profile to check items of */ - addMissingSptVersionTagToProfile(fullProfile: ISptProfile): void; + fixProfileBreakingInventoryItemIssues(pmcProfile: IPmcData): void; /** * TODO - make this non-public - currently used by RepeatableQuestController * Remove unused condition counters * @param pmcProfile profile to remove old counters from */ removeDanglingConditionCounters(pmcProfile: IPmcData): void; - addLighthouseKeeperIfMissing(pmcProfile: IPmcData): void; - protected addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void; /** * Repeatable quests leave behind TaskConditionCounter objects that make the profile bloat with time, remove them * @param pmcProfile Player profile to check */ protected removeDanglingTaskConditionCounters(pmcProfile: IPmcData): void; 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 profile profile to update - */ - protected updateProfileQuestDataValues(profile: IPmcData): void; - protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; /** - * Some profiles have hideout maxed and therefore no improvements - * @param pmcProfile Profile to add improvement data to - */ - protected addMissingWallImprovements(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 + * After removing mods that add quests, the quest panel will break without removing these + * @param pmcProfile Profile to remove dead quests from */ - protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void; + protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** - * Hideout slots need to be in a specific order, locationIndex in ascending order - * @param pmcProfile profile to edit + * If the profile has elite Hideout Managment skill, add the additional slots from globals + * NOTE: This seems redundant, but we will leave it here just incase. + * @param pmcProfile profile to add slots to */ - protected reorderHideoutAreasWithResouceInputs(pmcProfile: IPmcData): void; + protected addHideoutEliteSlots(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[]; - /** - * Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing - * @param pmcProfile Profile to update - */ - addMissingHideoutBonusesToProfile(pmcProfile: IPmcData): void; + protected addObjectsToArray(count: number, slots: IHideoutSlot[]): IHideoutSlot[]; /** - * @param profileBonuses bonuses from profile - * @param bonus bonus to find - * @returns matching bonus + * Check for and cap profile skills at 5100. + * @param pmcProfile profile to check and fix */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; + protected checkForSkillsOverMaxLevel(pmcProfile: IPmcData): void; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -136,58 +109,15 @@ export declare class ProfileFixerService { */ protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; /** - * Attempt to fix common item issues that corrupt profiles - * @param pmcProfile Profile to check items of - */ - fixProfileBreakingInventoryItemIssues(pmcProfile: IPmcData): void; - /** - * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 - * @param pmcProfile profile to update - */ - addMissingUpgradesPropertyToHideout(pmcProfile: IPmcData): void; - /** - * Iterate over associated profile template and check all hideout areas exist, add if not - * @param fullProfile Profile to update - */ - addMissingHideoutAreasToProfile(fullProfile: ISptProfile): void; - /** - * These used to be used for storing scav case rewards, rewards are now generated on pickup + * REQUIRED for dev profiles + * Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing * @param pmcProfile Profile to update */ - removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void; - /** - * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated - * We store the old AID value in new field `sessionId` - * @param fullProfile Profile to update - */ - fixIncorrectAidValue(fullProfile: ISptProfile): void; - /** - * Bsg nested `stats` into a sub object called 'eft' - * @param fullProfile Profile to check for and migrate stats data - */ - migrateStatsToNewStructure(fullProfile: ISptProfile): void; - /** - * 26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets - * @param pmcProfile Profile to add missing IDs to - */ - addMissingIdsToBonuses(pmcProfile: IPmcData): void; - /** - * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found - */ - fixBitcoinProductionTime(pmcProfile: IPmcData): void; - /** - * At some point the property name was changed,migrate data across to new name - * @param pmcProfile Profile to migrate improvements in - */ - protected migrateImprovements(pmcProfile: IPmcData): void; - /** - * After removing mods that add quests, the quest panel will break without removing these - * @param pmcProfile Profile to remove dead quests from - */ - protected removeOrphanedQuests(pmcProfile: IPmcData): void; + addMissingHideoutBonusesToProfile(pmcProfile: IPmcData): void; /** - * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's undefined + * @param profileBonuses bonuses from profile + * @param bonus bonus to find + * @returns matching bonus */ - protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; + protected getBonusFromProfile(profileBonuses: IBonus[], bonus: IStageBonus): IBonus | undefined; } diff --git a/types/services/ProfileSnapshotService.d.ts b/types/services/ProfileSnapshotService.d.ts deleted file mode 100644 index 4492dda..0000000 --- a/types/services/ProfileSnapshotService.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -import { ICloner } from "@spt/utils/cloners/ICloner"; -export declare class ProfileSnapshotService { - protected cloner: ICloner; - protected storedProfileSnapshots: Record; - constructor(cloner: ICloner); - /** - * Store a profile into an in-memory object - * @param sessionID session id - acts as the key - * @param profile - profile to save - */ - storeProfileSnapshot(sessionID: string, profile: ISptProfile): void; - /** - * Retreve a stored profile - * @param sessionID key - * @returns A player profile object - */ - getProfileSnapshot(sessionID: string): ISptProfile | undefined; - /** - * Does a profile exists against the provided key - * @param sessionID key - * @returns true if exists - */ - hasProfileSnapshot(sessionID: string): boolean; - /** - * Remove a stored profile by key - * @param sessionID key - */ - clearProfileSnapshot(sessionID: string): void; -} diff --git a/types/services/RagfairLinkedItemService.d.ts b/types/services/RagfairLinkedItemService.d.ts index 0d03459..c9509d0 100644 --- a/types/services/RagfairLinkedItemService.d.ts +++ b/types/services/RagfairLinkedItemService.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; export declare class RagfairLinkedItemService { protected databaseService: DatabaseService; protected itemHelper: ItemHelper; + protected logger: ILogger; protected linkedItemsCache: Record>; - constructor(databaseService: DatabaseService, itemHelper: ItemHelper); + constructor(databaseService: DatabaseService, itemHelper: ItemHelper, logger: ILogger); getLinkedItems(linkedSearchId: string): Set; /** * Use ragfair linked item service to get an array of items that can fit on or in designated itemtpl diff --git a/types/services/RagfairOfferService.d.ts b/types/services/RagfairOfferService.d.ts index 6c13b1d..7f28fe0 100644 --- a/types/services/RagfairOfferService.d.ts +++ b/types/services/RagfairOfferService.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -10,13 +10,15 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; +import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairOfferService { protected logger: ILogger; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected databaseService: DatabaseService; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; @@ -32,7 +34,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, databaseService: DatabaseService, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Get all offers * @returns IRagfairOffer array @@ -51,7 +53,7 @@ export declare class RagfairOfferService { * Get an array of arrays of expired offer items + children * @returns Expired offer assorts */ - getExpiredOfferAssorts(): Item[][]; + getExpiredOfferAssorts(): IItem[][]; /** * Clear out internal expiredOffers dictionary of all items */ @@ -95,5 +97,5 @@ export declare class RagfairOfferService { * @param items Offer items to unstack * @returns Unstacked array of items */ - protected unstackOfferItems(items: Item[]): Item[]; + protected unstackOfferItems(items: IItem[]): IItem[]; } diff --git a/types/services/RagfairPriceService.d.ts b/types/services/RagfairPriceService.d.ts index 0a2f26e..0284aee 100644 --- a/types/services/RagfairPriceService.d.ts +++ b/types/services/RagfairPriceService.d.ts @@ -5,8 +5,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { MinMax } from "@spt/models/common/MinMax"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { HandbookItem } from "@spt/models/eft/common/tables/IHandbookBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IHandbookItem } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IRagfairConfig, IUnreasonableModPrices } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairServerPrices } from "@spt/models/spt/ragfair/IRagfairServerPrices"; @@ -56,7 +56,7 @@ export declare class RagfairPriceService implements OnLoad { * @param offerItems offer item + children to process * @returns Rouble price */ - getFleaPriceForOfferItems(offerItems: Item[]): number; + getFleaPriceForOfferItems(offerItems: IItem[]): number; /** * get the dynamic (flea) price for an item * @param itemTpl item template id to look up @@ -96,7 +96,7 @@ export declare class RagfairPriceService implements OnLoad { * @param isPackOffer Price is for a pack type offer * @returns cost of item in desired currency */ - getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + getDynamicOfferPriceForOffer(offerItems: IItem[], desiredCurrency: string, isPackOffer: boolean): number; /** * @param itemTemplateId items tpl value * @param desiredCurrency Currency to return result in @@ -105,7 +105,7 @@ export declare class RagfairPriceService implements OnLoad { * @param isPackOffer * @returns */ - getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: IItem, offerItems?: IItem[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook @@ -114,7 +114,7 @@ export declare class RagfairPriceService implements OnLoad { * @param price Current price of item * @returns Adjusted price of item */ - protected adjustUnreasonablePrice(handbookPrices: HandbookItem[], unreasonableItemChange: IUnreasonableModPrices, itemTpl: string, price: number): number; + protected adjustUnreasonablePrice(handbookPrices: IHandbookItem[], unreasonableItemChange: IUnreasonableModPrices, itemTpl: string, price: number): number; /** * Get different min/max price multipliers for different offer types (preset/pack/default) * @param isPreset Offer is a preset @@ -143,7 +143,7 @@ export declare class RagfairPriceService implements OnLoad { * @param existingPrice price of existing base weapon * @returns price of weapon in roubles */ - protected getWeaponPresetPrice(weaponRootItem: Item, weaponWithChildren: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(weaponRootItem: IItem, weaponWithChildren: IItem[], existingPrice: number): number; /** * Get the highest price for an item that is stored in handbook or trader assorts * @param itemTpl Item to get highest price of @@ -156,7 +156,7 @@ export declare class RagfairPriceService implements OnLoad { * @param presets weapon presets to choose from * @returns Default preset object */ - protected getWeaponPreset(weapon: Item): { + protected getWeaponPreset(weapon: IItem): { isDefault: boolean; preset: IPreset; }; diff --git a/types/services/RagfairTaxService.d.ts b/types/services/RagfairTaxService.d.ts index effb9f0..f42f1e8 100644 --- a/types/services/RagfairTaxService.d.ts +++ b/types/services/RagfairTaxService.d.ts @@ -1,18 +1,22 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IStorePlayerOfferTaxAmountRequestData } from "@spt/models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairTaxService { protected logger: ILogger; protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected itemHelper: ItemHelper; + protected profileHelper: ProfileHelper; + protected cloner: ICloner; protected playerOfferTaxCache: Record; - constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper); + constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper, profileHelper: ProfileHelper, cloner: ICloner); storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void; clearStoredOfferTaxById(offerIdToRemove: string): void; getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData; @@ -26,6 +30,6 @@ export declare class RagfairTaxService { * @param sellInOnePiece * @returns Tax in roubles */ - calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number; - protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number; + calculateTax(item: IItem, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number; + protected calculateItemWorth(item: IItem, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number; } diff --git a/types/services/RaidTimeAdjustmentService.d.ts b/types/services/RaidTimeAdjustmentService.d.ts index bfc099a..3f32776 100644 --- a/types/services/RaidTimeAdjustmentService.d.ts +++ b/types/services/RaidTimeAdjustmentService.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest"; import { ExtractChange, IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse"; -import { ILocationConfig, IScavRaidTimeLocationSettings, LootMultiplier } from "@spt/models/spt/config/ILocationConfig"; +import { ILocationConfig, ILootMultiplier, IScavRaidTimeLocationSettings } from "@spt/models/spt/config/ILocationConfig"; import { IRaidChanges } from "@spt/models/spt/location/IRaidChanges"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -30,7 +30,7 @@ export declare class RaidTimeAdjustmentService { * @param mapLootMultiplers Multiplers to adjust * @param loosePercent Percent to change values to */ - protected adjustLootMultipliers(mapLootMultiplers: LootMultiplier, loosePercent: number): void; + protected adjustLootMultipliers(mapLootMultiplers: ILootMultiplier, loosePercent: number): void; /** * Adjust bot waves to act as if player spawned later * @param mapBase map to adjust diff --git a/types/services/RaidWeatherService.d.ts b/types/services/RaidWeatherService.d.ts new file mode 100644 index 0000000..fd82da2 --- /dev/null +++ b/types/services/RaidWeatherService.d.ts @@ -0,0 +1,43 @@ +import { WeatherGenerator } from "@spt/generators/WeatherGenerator"; +import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { IWeather } from "@spt/models/eft/weather/IWeatherData"; +import { Season } from "@spt/models/enums/Season"; +import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +export declare class RaidWeatherService { + protected logger: ILogger; + protected databaseService: DatabaseService; + protected timeUtil: TimeUtil; + protected weatherGenerator: WeatherGenerator; + protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; + protected configServer: ConfigServer; + protected weatherConfig: IWeatherConfig; + protected weatherForecast: IWeather[]; + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, weatherGenerator: WeatherGenerator, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + /** + * Generate 24 hours of weather data starting from midnight today + */ + generateWeather(currentSeason: Season): void; + /** + * Get a time period to increment by, e.g 15 or 30 minutes as milliseconds + * @returns milliseconds + */ + protected getWeightedWeatherTimePeriodMs(): number; + /** + * Find the first matching weather object that applies to the current time + */ + getCurrentWeather(): IWeather; + /** + * Find the first matching weather object that applies to the current time + all following weather data generated + */ + getUpcomingWeather(): IWeather[]; + /** + * Ensure future weather data exists + */ + protected validateWeatherDataExists(currentSeason: Season): void; +} diff --git a/types/services/RepairService.d.ts b/types/services/RepairService.d.ts index 48f306e..c4772cf 100644 --- a/types/services/RepairService.d.ts +++ b/types/services/RepairService.d.ts @@ -4,14 +4,14 @@ import { RepairHelper } from "@spt/helpers/RepairHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { RepairKitsInfo } from "@spt/models/eft/repair/IRepairActionDataRequest"; -import { RepairItem } from "@spt/models/eft/repair/ITraderRepairActionDataRequest"; +import { IRepairKitsInfo } from "@spt/models/eft/repair/IRepairActionDataRequest"; +import { IRepairItem } from "@spt/models/eft/repair/ITraderRepairActionDataRequest"; import { BonusType } from "@spt/models/enums/BonusType"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; -import { BonusSettings, IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; +import { IBonusSettings, IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -40,7 +40,7 @@ export declare class RepairService { * @param traderId Trader being used to repair item * @returns RepairDetails object */ - repairItemByTrader(sessionID: string, pmcData: IPmcData, repairItemDetails: RepairItem, traderId: string): RepairDetails; + repairItemByTrader(sessionID: string, pmcData: IPmcData, repairItemDetails: IRepairItem, traderId: string): RepairDetails; /** * @param sessionID Session id * @param pmcData profile to take money from @@ -72,7 +72,7 @@ export declare class RepairService { * @param output IItemEventRouterResponse * @returns Details of repair, item/price */ - repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: RepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; + repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: IRepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; /** * Calculate value repairkit points need to be divided by to get the durability points to be added to an item * @param itemToRepairDetails Item to repair details @@ -100,7 +100,7 @@ export declare class RepairService { * @param repairKitDetails Repair kit details from db * @param repairKitInInventory Repair kit to update */ - protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: Item): void; + protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: IItem): void; /** * Chance to apply buff to an item (Armor/weapon) if repaired by armor kit * @param repairDetails Repair details of item @@ -112,7 +112,7 @@ export declare class RepairService { * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - addBuff(itemConfig: BonusSettings, item: Item): void; + addBuff(itemConfig: IBonusSettings, item: IItem): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired @@ -138,7 +138,7 @@ export declare class RepairService { export declare class RepairDetails { repairCost?: number; repairPoints?: number; - repairedItem: Item; + repairedItem: IItem; repairedItemIsArmor: boolean; repairAmount: number; repairedByKit: boolean; diff --git a/types/services/SeasonalEventService.d.ts b/types/services/SeasonalEventService.d.ts index 0750f38..281bf99 100644 --- a/types/services/SeasonalEventService.d.ts +++ b/types/services/SeasonalEventService.d.ts @@ -1,7 +1,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IConfig } from "@spt/models/eft/common/IGlobals"; -import { Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory } from "@spt/models/eft/common/tables/IBotType"; import { Season } from "@spt/models/enums/Season"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; @@ -109,7 +109,7 @@ export declare class SeasonalEventService { * @param botInventory Bots inventory to iterate over * @param botRole the role of the bot being processed */ - removeChristmasItemsFromBotInventory(botInventory: Inventory, botRole: string): void; + removeChristmasItemsFromBotInventory(botInventory: IInventory, botRole: string): void; /** * Make adjusted to server code based on the name of the event passed in * @param sessionId Player id @@ -117,8 +117,18 @@ export declare class SeasonalEventService { * @param eventName Name of the event to enable. e.g. Christmas */ protected updateGlobalEvents(sessionId: string, globalConfig: IConfig, eventType: SeasonalEventType): void; + /** + * Force zryachiy to always have a melee weapon + */ protected adjustZryachiyMeleeChance(): void; + /** + * Enable the halloween zryachiy summon event + */ protected enableHalloweenSummonEvent(): void; + /** + * Add event bosses to maps + * @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS + */ protected addEventBossesToMaps(eventType: SeasonalEventType): void; /** * Change trader icons to be more event themed (Halloween only so far) @@ -134,6 +144,9 @@ export declare class SeasonalEventService { * @param eventName Name of the event to read equipment in from config */ protected addEventGearToBots(eventType: SeasonalEventType): void; + /** + * Add pumpkin loot boxes to scavs + */ protected addPumpkinsToScavBackpacks(): void; /** * Set Khorovod(dancing tree) chance to 100% on all maps that support it @@ -155,5 +168,8 @@ export declare class SeasonalEventService { * @returns Bot role as string */ getBaseRoleForEventBot(eventBotRole: string): string; + /** + * Force the weather to be snow + */ enableSnow(): void; } diff --git a/types/services/TraderPurchasePersisterService.d.ts b/types/services/TraderPurchasePersisterService.d.ts index 6bef9f5..ba85a67 100644 --- a/types/services/TraderPurchasePersisterService.d.ts +++ b/types/services/TraderPurchasePersisterService.d.ts @@ -1,5 +1,5 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { TraderPurchaseData } from "@spt/models/eft/profile/ISptProfile"; +import { ITraderPurchaseData } from "@spt/models/eft/profile/ISptProfile"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): ITraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/types/services/TraderServicesService.d.ts b/types/services/TraderServicesService.d.ts deleted file mode 100644 index e441eb6..0000000 --- a/types/services/TraderServicesService.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseService } from "@spt/services/DatabaseService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; -export declare class TraderServicesService { - protected profileHelper: ProfileHelper; - protected logger: ILogger; - protected databaseService: DatabaseService; - protected cloner: ICloner; - constructor(profileHelper: ProfileHelper, logger: ILogger, databaseService: DatabaseService, cloner: ICloner); - getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[]; -} diff --git a/types/services/mod/CustomItemService.d.ts b/types/services/mod/CustomItemService.d.ts index 1926bed..bbc0453 100644 --- a/types/services/mod/CustomItemService.d.ts +++ b/types/services/mod/CustomItemService.d.ts @@ -1,11 +1,11 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class CustomItemService { protected logger: ILogger; protected hashUtil: HashUtil; @@ -47,7 +47,7 @@ export declare class CustomItemService { * @param overrideProperties new properties to apply * @param itemClone item to update */ - protected updateBaseItemPropertiesWithOverrides(overrideProperties: Props, itemClone: ITemplateItem): void; + protected updateBaseItemPropertiesWithOverrides(overrideProperties: IProps, 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 diff --git a/types/services/mod/dynamicRouter/DynamicRouterModService.d.ts b/types/services/mod/dynamicRouter/DynamicRouterModService.d.ts index 3c9d955..91c84d9 100644 --- a/types/services/mod/dynamicRouter/DynamicRouterModService.d.ts +++ b/types/services/mod/dynamicRouter/DynamicRouterModService.d.ts @@ -1,5 +1,5 @@ -import { DependencyContainer } from "tsyringe"; import { RouteAction } from "@spt/di/Router"; +import { DependencyContainer } from "tsyringe"; export declare class DynamicRouterModService { private container; constructor(container: DependencyContainer); diff --git a/types/services/mod/httpListener/HttpListenerMod.d.ts b/types/services/mod/httpListener/HttpListenerMod.d.ts index 75e42ee..84c46c3 100644 --- a/types/services/mod/httpListener/HttpListenerMod.d.ts +++ b/types/services/mod/httpListener/HttpListenerMod.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { IHttpListener } from "@spt/servers/http/IHttpListener"; export declare class HttpListenerMod implements IHttpListener { diff --git a/types/services/mod/httpListener/HttpListenerModService.d.ts b/types/services/mod/httpListener/HttpListenerModService.d.ts index 23abfbe..ba73afe 100644 --- a/types/services/mod/httpListener/HttpListenerModService.d.ts +++ b/types/services/mod/httpListener/HttpListenerModService.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { DependencyContainer } from "tsyringe"; export declare class HttpListenerModService { diff --git a/types/services/mod/staticRouter/StaticRouterModService.d.ts b/types/services/mod/staticRouter/StaticRouterModService.d.ts index f60432d..0c3d4d8 100644 --- a/types/services/mod/staticRouter/StaticRouterModService.d.ts +++ b/types/services/mod/staticRouter/StaticRouterModService.d.ts @@ -1,5 +1,5 @@ -import { DependencyContainer } from "tsyringe"; import { RouteAction } from "@spt/di/Router"; +import { DependencyContainer } from "tsyringe"; export declare class StaticRouterModService { protected container: DependencyContainer; constructor(container: DependencyContainer); diff --git a/types/tools/ItemTplGenerator/itemOverrides.d.ts b/types/tools/ItemTplGenerator/itemOverrides.d.ts index fb2ba9a..5c4914a 100644 --- a/types/tools/ItemTplGenerator/itemOverrides.d.ts +++ b/types/tools/ItemTplGenerator/itemOverrides.d.ts @@ -31,6 +31,7 @@ declare const _default: { "5a29276886f77435ed1b117c": string; "628393620d8524273e7eb028": string; "638dfc803083a019d447768e": string; + "66760b3deb51b08bd40c2b08": string; "638e0057ab150a5f56238960": string; "6393262086e646067c176aa2": string; "63989ced706b793c7d60cfef": string; @@ -54,12 +55,14 @@ declare const _default: { "6614230055afee107f05e998": string; "661421c7c1f2f548c50ee649": string; "661423200d240a5f5d0f679b": string; + "66a0f0926fee20fa70036da6": string; "5d1340b3d7ad1a0b52682ed7": string; "55802d5f4bdc2dac148b458e": string; "5d1340cad7ad1a0b0b249869": string; "5d1340bdd7ad1a0e8d245aab": string; "5cbdaf89ae9215000e5b9c94": string; "5e21a3c67e40bd02257a008a": string; + "6241c2c2117ad530666a5108": string; "5914944186f774189e5e76c2": string; "5937ef2b86f77408a47244b3": string; "59387ac686f77401442ddd61": string; @@ -71,5 +74,7 @@ declare const _default: { "5e81ebcd8e146c7080625e15": string; "639c3fbbd0446708ee622ee9": string; "639af924d0446708ee62294e": string; + "66da1b49099cf6adcc07a36b": string; + "66da1b546916142b3b022777": string; }; export default _default; diff --git a/types/utils/HashUtil.d.ts b/types/utils/HashUtil.d.ts index 427c186..c938b6c 100644 --- a/types/utils/HashUtil.d.ts +++ b/types/utils/HashUtil.d.ts @@ -1,5 +1,3 @@ -/// -/// import crypto from "node:crypto"; import fs from "node:fs"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -11,6 +9,12 @@ export declare class HashUtil { * @returns 24 character hash */ generate(): string; + /** + * is the passed in string a valid mongo id + * @param stringToCheck String to check + * @returns True when string is a valid mongo id + */ + isValidMongoId(stringToCheck: string): boolean; generateMd5ForData(data: string): string; generateSha1ForData(data: string): string; generateCRC32ForFile(filePath: fs.PathLike): number; diff --git a/types/utils/HttpFileUtil.d.ts b/types/utils/HttpFileUtil.d.ts index cc0d9ef..57f21c8 100644 --- a/types/utils/HttpFileUtil.d.ts +++ b/types/utils/HttpFileUtil.d.ts @@ -1,4 +1,3 @@ -/// import { ServerResponse } from "node:http"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; export declare class HttpFileUtil { diff --git a/types/utils/JsonUtil.d.ts b/types/utils/JsonUtil.d.ts index b30822c..4419228 100644 --- a/types/utils/JsonUtil.d.ts +++ b/types/utils/JsonUtil.d.ts @@ -1,7 +1,7 @@ -import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { HashUtil } from "@spt/utils/HashUtil"; import { VFS } from "@spt/utils/VFS"; +import { IParseOptions, IStringifyOptions, Reviver } from "jsonc/lib/interfaces"; export declare class JsonUtil { protected vfs: VFS; protected hashUtil: HashUtil; diff --git a/types/utils/ObjectId.d.ts b/types/utils/ObjectId.d.ts index 91f64d3..4f87344 100644 --- a/types/utils/ObjectId.d.ts +++ b/types/utils/ObjectId.d.ts @@ -1,4 +1,3 @@ -/// import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ObjectId { protected timeUtil: TimeUtil; diff --git a/types/utils/RandomUtil.d.ts b/types/utils/RandomUtil.d.ts index 49f242d..0da184f 100644 --- a/types/utils/RandomUtil.d.ts +++ b/types/utils/RandomUtil.d.ts @@ -1,6 +1,6 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { ICloner } from "@spt/utils/cloners/ICloner"; import { MathUtil } from "@spt/utils/MathUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** * Array of ProbabilityObjectArray which allow to randomly draw of the contained objects * based on the relative probability of each of its elements. diff --git a/types/utils/TimeUtil.d.ts b/types/utils/TimeUtil.d.ts index 6c14b9d..48d769b 100644 --- a/types/utils/TimeUtil.d.ts +++ b/types/utils/TimeUtil.d.ts @@ -42,11 +42,17 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + getStartOfDayTimestamp(timestamp?: number): number; /** * Get timestamp of today + passed in day count * @param daysFromNow Days from now */ getTimeStampFromNowDays(daysFromNow: number): number; + /** + * Get timestamp of today + passed in hour count + * @param daysFromNow Days from now + */ + getTimeStampFromNowHours(hoursFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * @@ -67,4 +73,10 @@ export declare class TimeUtil { */ getHoursAsSeconds(hours: number): number; getTimestampOfNextHour(): number; + /** + * Returns the current days timestamp at 00:00 + * e.g. current time: 13th march 14:22 will return 13th march 00:00 + * @returns Timestamp + */ + getTodaysMidnightTimestamp(): number; } diff --git a/types/utils/VFS.d.ts b/types/utils/VFS.d.ts index 6287a2f..9c4fcc2 100644 --- a/types/utils/VFS.d.ts +++ b/types/utils/VFS.d.ts @@ -1,5 +1,3 @@ -/// -/// import "reflect-metadata"; import fs from "node:fs"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; diff --git a/types/utils/logging/AbstractWinstonLogger.d.ts b/types/utils/logging/AbstractWinstonLogger.d.ts index 7098f85..fb84b83 100644 --- a/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/types/utils/logging/AbstractWinstonLogger.d.ts @@ -1,12 +1,11 @@ -/// import fs from "node:fs"; -import winston from "winston"; -import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; +import { IDaum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; import { SptLogger } from "@spt/models/spt/logging/SptLogger"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; import { ILogger } from "@spt/models/spt/utils/ILogger"; +import winston from "winston"; export declare abstract class AbstractWinstonLogger implements ILogger { protected asyncQueue: IAsyncQueue; protected showDebugInConsole: boolean; @@ -51,7 +50,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; - writeToLogFile(data: string | Daum): Promise; + writeToLogFile(data: string | IDaum): Promise; log(data: string | Error | Record, color: string, backgroundColor?: string): Promise; error(data: string | Record): Promise; warning(data: string | Record): Promise; From c8929676321e1784fb6d1c2df70b96e2eb305b9d Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 24 Oct 2024 15:38:58 +0200 Subject: [PATCH 05/23] Formatting and modify package.json for 3.10 --- biome.json | 2 +- mod.code-workspace | 20 +++++++++----------- package.json | 12 ++++++------ src/mod.ts | 2 +- tsconfig.json | 6 +++--- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/biome.json b/biome.json index 2e0f494..0b10962 100644 --- a/biome.json +++ b/biome.json @@ -40,4 +40,4 @@ "files": { "ignore": ["**/node_modules", "dist", "types", "build.mjs", "**/package-lock.json"] } -} \ No newline at end of file +} diff --git a/mod.code-workspace b/mod.code-workspace index f9f8863..7e191f9 100644 --- a/mod.code-workspace +++ b/mod.code-workspace @@ -1,12 +1,10 @@ { - "folders": [ - { - "path": "." - } - ], - "extensions": { - "recommendations": [ - "biomejs.biome" - ] - } -} \ No newline at end of file + "folders": [ + { + "path": "." + } + ], + "extensions": { + "recommendations": ["biomejs.biome"] + } +} diff --git a/package.json b/package.json index 6d057ed..21b5889 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "main": "src/mod.js", "license": "MIT", "author": "ArchangelWTF", - "sptVersion": "~3.9", - "loadBefore": [], - "loadAfter": [], - "incompatibilities": [], - "contributors": ["RainbowPC"], - "isBundleMod": false, + "sptVersion": "~3.10", + "loadBefore": [], + "loadAfter": [], + "incompatibilities": [], + "contributors": ["RainbowPC"], + "isBundleMod": false, "scripts": { "setup": "npm i", "lint": "npx @biomejs/biome lint ./", diff --git a/src/mod.ts b/src/mod.ts index b606fbd..cb52d8e 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -336,7 +336,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { if (children?.length > 0) { items = this.itemHelper.reparentItemAndChildren(rootItem, children); } - + const magazine = items.filter((x) => x.slotId === "mod_magazine")[0]; // some weapon presets come without magazine; only fill the mag if it exists and if it has a good roll. if (magazine && randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { diff --git a/tsconfig.json b/tsconfig.json index 7d2e93d..e82aa6d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,8 +11,8 @@ "resolveJsonModule": true, "outDir": "tmp", "paths": { - "@spt/*": ["./types/*"], - }, + "@spt/*": ["./types/*"] + } }, - "exclude": ["node_modules", "dist", "tmp"], + "exclude": ["node_modules", "dist", "tmp"] } From 89569a07b1454c46e48c52764f20010bf213b91a Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 24 Oct 2024 15:42:19 +0200 Subject: [PATCH 06/23] Update MIT license --- LICENSE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index cec36e6..9a7dbbd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,6 @@ -Copyright (c) 2024 RainbowPC +Copyright (c) 2024 ArchangelWTF + +Copyright (c) 2022-2024 RainbowPC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 9e1fdaca01f6e1d5945eb46de50ad90198e1320f Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 25 Oct 2024 14:38:59 +0200 Subject: [PATCH 07/23] Update comment --- src/mod.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod.ts b/src/mod.ts index cb52d8e..f23fa96 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -203,8 +203,9 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { let chosenSpawnpoints: ISpawnpoint[] = [...guaranteedLoosePoints]; const randomSpawnpointCount = desiredSpawnpointCount - chosenSpawnpoints.length; - // Add randomly chosen spawn points + // Only draw random spawn points if needed if (randomSpawnpointCount) { + // Add randomly chosen spawn points for (const si of spawnpointArray.draw(randomSpawnpointCount, true)) { chosenSpawnpoints.push(spawnpointArray.data(si)); } From 42ca94893d519782b2cebe7fcb83bbbc26ba7aef Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 25 Oct 2024 14:39:04 +0200 Subject: [PATCH 08/23] Add archiver --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 21b5889..5e2d618 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "devDependencies": { "@types/node": "~20.11", "@biomejs/biome": "1.8.3", + "archiver": "^6.0", "fs-extra": "~11.2", "ignore": "^5.2", "tsyringe": "~4.8", From 04b1d01bfac0534d3f29867fee3f7bfaf41f121b Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 25 Oct 2024 14:43:47 +0200 Subject: [PATCH 09/23] Update mod to use MongoIDs --- src/MarkedRoom.ts | 6 +++--- src/mod.ts | 42 +++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/MarkedRoom.ts b/src/MarkedRoom.ts index 3b9b4fa..68fd0f0 100644 --- a/src/MarkedRoom.ts +++ b/src/MarkedRoom.ts @@ -82,15 +82,15 @@ export class MarkedRoom { continue; } - const id = Math.random() * 10000; + const key = this.hashUtil.generate(); spawnpoint.template.Items.push({ - _id: id.toString(), + _id: key, _tpl: item[0], }); spawnpoint.itemDistribution.push({ - composedKey: { key: id.toString() }, + composedKey: { key: key }, relativeProbability: item[1], }); diff --git a/src/mod.ts b/src/mod.ts index f23fa96..af35145 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -40,6 +40,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { private databaseServer: DatabaseServer; private itemHelper: ItemHelper; private cloner: ICloner; + private hashUtil: HashUtil; private markedRoom: MarkedRoom; private lotsoflootHelper: LotsofLootHelper; @@ -77,6 +78,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { this.databaseServer = Mod.container.resolve("DatabaseServer"); this.itemHelper = Mod.container.resolve("ItemHelper"); this.cloner = Mod.container.resolve("PrimaryCloner"); + this.hashUtil = Mod.container.resolve("HashUtil"); const tables = this.databaseServer.getTables(); const configServer = container.resolve("ConfigServer"); @@ -276,7 +278,6 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { } private createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: ISpawnpoint = undefined): IContainerItem { - const objectId = Mod.container.resolve("ObjectId"); const presetHelper = Mod.container.resolve("PresetHelper"); const randomUtil = Mod.container.resolve("RandomUtil"); const localisationService = Mod.container.resolve("LocalisationService"); @@ -299,7 +300,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { let height = itemTemplate._props.Height; let items: IItem[] = [ { - _id: objectId.generate(), + _id: this.hashUtil.generate(), _tpl: tpl, }, ]; @@ -312,8 +313,8 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.WEAPON)) { if (spawnPoint != undefined) { const chosenItem = spawnPoint.template.Items.find((x) => x._tpl === tpl); - // Get item + children and add into array we return - const itemWithChildren = this.itemHelper.findAndReturnChildrenAsItems(spawnPoint.template.Items, chosenItem._id); + // Get item + it's children, then replace ids of children with valid MongoIDs before returning them to the items arrray. + const itemWithChildren = this.itemHelper.replaceIDs(this.itemHelper.findAndReturnChildrenAsItems(spawnPoint.template.Items, chosenItem._id)); items.splice(0, 1); items.push(...itemWithChildren); @@ -570,7 +571,6 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { } private addToRustedKeyRoom(): void { - const objectId = Mod.container.resolve("ObjectId"); const tables = this.databaseServer.getTables(); const streetsloot = tables.locations.tarkovstreets.looseLoot; const items = tables.templates.items; @@ -612,7 +612,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { IsGroupPosition: false, GroupPositions: [], IsAlwaysSpawn: false, - Root: objectId.generate(), + Root: this.hashUtil.generate(), Items: [], }, itemDistribution: [], @@ -629,7 +629,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { } streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys2"; point.template.Position = { x: 185.125, @@ -639,7 +639,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys3"; point.template.Position = { x: 185.164, @@ -649,7 +649,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys4"; point.template.Position = { x: 185.154, @@ -659,7 +659,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys5"; point.template.Position = { x: 185.21, @@ -669,7 +669,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys6"; point.template.Position = { x: 185.205, @@ -679,7 +679,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys7"; point.template.Position = { x: 185.208, @@ -689,7 +689,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys8"; point.template.Position = { x: 185.211, @@ -699,7 +699,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys9"; point.template.Position = { x: 185.202, @@ -709,7 +709,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys10"; point.template.Position = { x: 185.2, @@ -719,7 +719,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys11"; point.template.Position = { x: 182.683, @@ -729,7 +729,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Keys12"; point.template.Position = { x: 182.683, @@ -739,7 +739,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Val1"; point.template.Position = { x: 185.037, @@ -761,7 +761,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Val2"; point.template.Position = { x: 183.064, @@ -771,7 +771,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Val3"; point.template.Position = { x: 185.146, @@ -781,7 +781,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); streetsloot.spawnpoints.push(this.cloner.clone(point)); - point.template.Root = objectId.generate(); + point.template.Root = this.hashUtil.generate(); point.template.Id = "Val4"; point.template.Position = { x: 185.085, From b943095c6c41687036c7af1e2570be040dd3e816 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 25 Oct 2024 14:43:54 +0200 Subject: [PATCH 10/23] Add async loading --- src/mod.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mod.ts b/src/mod.ts index af35145..469194c 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -9,18 +9,18 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; -import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod"; -import { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod"; +import { IPostDBLoadModAsync } from "@spt/models/external/IPostDBLoadModAsync"; +import { IPreSptLoadModAsync } from "@spt/models/external/IPreSptLoadModAsync"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { HashUtil } from "@spt/utils/HashUtil"; import { JsonUtil } from "@spt/utils/JsonUtil"; import { MathUtil } from "@spt/utils/MathUtil"; -import { ObjectId } from "@spt/utils/ObjectId"; import { ProbabilityObject, ProbabilityObjectArray } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; import { VFS } from "@spt/utils/VFS"; @@ -32,7 +32,7 @@ import { LotsofLootHelper } from "./LotsofLootHelper"; import { LotsofLootLogger } from "./LotsofLootLogger"; import { MarkedRoom } from "./MarkedRoom"; -class Mod implements IPreSptLoadMod, IPostDBLoadMod { +class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { private static config: ILotsofLootConfig = null; private static container: DependencyContainer; @@ -45,7 +45,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { private markedRoom: MarkedRoom; private lotsoflootHelper: LotsofLootHelper; - public preSptLoad(container: DependencyContainer): void { + public async preSptLoadAsync(container: DependencyContainer): Promise { Mod.container = container; // Get VFS to read in configs @@ -74,7 +74,7 @@ class Mod implements IPreSptLoadMod, IPostDBLoadMod { ); } - public postDBLoad(container: DependencyContainer): void { + public async postDBLoadAsync(container: DependencyContainer): Promise { this.databaseServer = Mod.container.resolve("DatabaseServer"); this.itemHelper = Mod.container.resolve("ItemHelper"); this.cloner = Mod.container.resolve("PrimaryCloner"); From dbcc332165dbaa9f881ab3ef14d1cae31bfab971 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 25 Oct 2024 16:13:39 +0200 Subject: [PATCH 11/23] Update generateDynamicLoot --- src/mod.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mod.ts b/src/mod.ts index 469194c..f94f5d4 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -147,9 +147,10 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { this.logger.logInfo(`Finished loading`); } + // This method closely mirrors that of SPT + // The only difference being the bypass for loot overlay and using createStaticLootItem private generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[] { const LocationLootGenerator = Mod.container.resolve("LocationLootGenerator"); - const jsonUtil = Mod.container.resolve("JsonUtil"); const randomUtil = Mod.container.resolve("RandomUtil"); const mathUtil = Mod.container.resolve("MathUtil"); const localisationService = Mod.container.resolve("LocalisationService"); @@ -180,11 +181,11 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { const guaranteedLoosePoints: ISpawnpoint[] = []; const blacklistedSpawnpoints = LocationConfig.looseLootBlacklist[locationName]; - const spawnpointArray = new ProbabilityObjectArray(mathUtil, jsonUtil); + const spawnpointArray = new ProbabilityObjectArray(mathUtil, this.cloner); for (const spawnpoint of allDynamicSpawnpoints) { if (blacklistedSpawnpoints?.includes(spawnpoint.template.Id)) { - this.logger.logDebug(`Ignoring loose loot location: ${spawnpoint.template.Id}`); + this.logger.debug(`Ignoring loose loot location: ${spawnpoint.template.Id}`); continue; } @@ -215,12 +216,12 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { if (!Mod.config.general.allowLootOverlay) { // Filter out duplicate locationIds - chosenSpawnpoints = [...new Map(chosenSpawnpoints.map((x) => [x.locationId, x])).values()]; + chosenSpawnpoints = [...new Map(chosenSpawnpoints.map((spawnPoint) => [spawnPoint.locationId, spawnPoint])).values()]; // Do we have enough items in pool to fulfill requirement const tooManySpawnPointsRequested = desiredSpawnpointCount - chosenSpawnpoints.length > 0; if (tooManySpawnPointsRequested) { - this.logger.logDebug( + this.logger.debug( localisationService.getText("location-spawn_point_count_requested_vs_found", { requested: desiredSpawnpointCount + guaranteedLoosePoints.length, found: chosenSpawnpoints.length, @@ -244,7 +245,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { continue; } - const itemArray = new ProbabilityObjectArray(mathUtil, jsonUtil); + const itemArray = new ProbabilityObjectArray(mathUtil, this.cloner); for (const itemDist of spawnPoint.itemDistribution) { if (!seasonalEventActive && seasonalItemTplBlacklist.includes(spawnPoint.template.Items.find((x) => x._id === itemDist.composedKey.key)._tpl)) { // Skip seasonal event items if they're not enabled From e2eb9cea573ab3c95f6574e0060f89847184bb35 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 25 Oct 2024 16:16:17 +0200 Subject: [PATCH 12/23] Update logger --- src/LotsofLootHelper.ts | 8 ++++---- src/LotsofLootLogger.ts | 12 ++++++++++-- src/MarkedRoom.ts | 18 +++++++++--------- src/mod.ts | 28 ++++++++++++++-------------- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/src/LotsofLootHelper.ts b/src/LotsofLootHelper.ts index aa6ff9c..c54b695 100644 --- a/src/LotsofLootHelper.ts +++ b/src/LotsofLootHelper.ts @@ -34,7 +34,7 @@ export class LotsofLootHelper { const location: ILocation = locations[locationId]; if (!location.looseLoot) { - this.logger.logDebug(`Skipping ${locationId} as it has no loose loot!`); + this.logger.debug(`Skipping ${locationId} as it has no loose loot!`); continue; } @@ -47,7 +47,7 @@ export class LotsofLootHelper { if (itemDistribution) { itemDistribution.relativeProbability *= mult; - this.logger.logDebug(`${locationId}, ${spawnpoint.template.Id}, ${item._tpl}, ${itemDistribution.relativeProbability}`); + this.logger.debug(`${locationId}, ${spawnpoint.template.Id}, ${item._tpl}, ${itemDistribution.relativeProbability}`); } } }); @@ -63,7 +63,7 @@ export class LotsofLootHelper { const location: ILocation = locations[locationId]; if (!location.looseLoot) { - this.logger.logDebug(`Skipping ${locationId} as it has no loose loot!`); + this.logger.debug(`Skipping ${locationId} as it has no loose loot!`); continue; } @@ -78,7 +78,7 @@ export class LotsofLootHelper { spawnpoint.probability = 1; } - this.logger.logDebug(`${locationId}, Pool:${spawnpoint.template.Id}, Chance:${spawnpoint.probability}`); + this.logger.debug(`${locationId}, Pool:${spawnpoint.template.Id}, Chance:${spawnpoint.probability}`); } }); } diff --git a/src/LotsofLootLogger.ts b/src/LotsofLootLogger.ts index b2ccb45..7c1125b 100644 --- a/src/LotsofLootLogger.ts +++ b/src/LotsofLootLogger.ts @@ -13,7 +13,11 @@ export class LotsofLootLogger { this.logger.info(this.loggerPrefix + log); } - public logWarning(log: string): void { + public warning(log: string): void { + this.logWarning(log); + } + + protected logWarning(log: string): void { this.logger.warning(this.loggerPrefix + log); } @@ -21,7 +25,11 @@ export class LotsofLootLogger { this.logger.error(this.loggerPrefix + log); } - public logDebug(log: string): void { + public debug(log: string): void { + this.logDebug(log); + } + + protected logDebug(log: string): void { if (this.debugEnabled) { this.logger.logWithColor(this.loggerPrefix + log, LogTextColor.YELLOW); } diff --git a/src/MarkedRoom.ts b/src/MarkedRoom.ts index 68fd0f0..73e534d 100644 --- a/src/MarkedRoom.ts +++ b/src/MarkedRoom.ts @@ -23,7 +23,7 @@ export class MarkedRoom { for (const spawnpoint of spawnPointscustoms) { //Dorms 314 Marked Room if (spawnpoint.template.Position.x > 180 && spawnpoint.template.Position.x < 185 && spawnpoint.template.Position.z > 180 && spawnpoint.template.Position.z < 185 && spawnpoint.template.Position.y > 6 && spawnpoint.template.Position.y < 7) { - this.logger.logDebug(`Marked room (Customs) ${spawnpoint.template.Id}`); + this.logger.debug(`Marked room (Customs) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.customs; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); @@ -32,17 +32,17 @@ export class MarkedRoom { for (const spawnpoint of spawnPointsreserve) { if (spawnpoint.template.Position.x > -125 && spawnpoint.template.Position.x < -120 && spawnpoint.template.Position.z > 25 && spawnpoint.template.Position.z < 30 && spawnpoint.template.Position.y > -15 && spawnpoint.template.Position.y < -14) { - this.logger.logDebug(`Marked room (Reserve) ${spawnpoint.template.Id}`); + this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } else if (spawnpoint.template.Position.x > -155 && spawnpoint.template.Position.x < -150 && spawnpoint.template.Position.z > 70 && spawnpoint.template.Position.z < 75 && spawnpoint.template.Position.y > -9 && spawnpoint.template.Position.y < -8) { - this.logger.logDebug(`Marked room (Reserve) ${spawnpoint.template.Id}`); + this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } else if (spawnpoint.template.Position.x > 190 && spawnpoint.template.Position.x < 195 && spawnpoint.template.Position.z > -230 && spawnpoint.template.Position.z < -225 && spawnpoint.template.Position.y > -6 && spawnpoint.template.Position.y < -5) { - this.logger.logDebug(`Marked room (Reserve) ${spawnpoint.template.Id}`); + this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); @@ -52,14 +52,14 @@ export class MarkedRoom { for (const spawnpoint of spawnPointsstreets) { //Abandoned Factory Marked Room if (spawnpoint.template.Position.x > -133 && spawnpoint.template.Position.x < -129 && spawnpoint.template.Position.z > 265 && spawnpoint.template.Position.z < 275 && spawnpoint.template.Position.y > 8.5 && spawnpoint.template.Position.y < 11) { - this.logger.logDebug(`Marked room (Streets) ${spawnpoint.template.Id}`); + this.logger.debug(`Marked room (Streets) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.streets; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } //Chek 13 Marked Room else if (spawnpoint.template.Position.x > 186 && spawnpoint.template.Position.x < 191 && spawnpoint.template.Position.z > 224 && spawnpoint.template.Position.z < 229 && spawnpoint.template.Position.y > -0.5 && spawnpoint.template.Position.y < 1.5) { - this.logger.logDebug(`Marked room (Streets) ${spawnpoint.template.Id}`); + this.logger.debug(`Marked room (Streets) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.streets; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); @@ -68,7 +68,7 @@ export class MarkedRoom { for (const spawnpoint of spawnPointsLighthouse) { if (spawnpoint.template.Position.x > 319 && spawnpoint.template.Position.x < 330 && spawnpoint.template.Position.z > 482 && spawnpoint.template.Position.z < 489 && spawnpoint.template.Position.y > 5 && spawnpoint.template.Position.y < 6.5) { - this.logger.logDebug(`Marked room (Lighthouse) ${spawnpoint.template.Id}`); + this.logger.debug(`Marked room (Lighthouse) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.markedRoomConfig.multiplier.lighthouse; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); @@ -94,7 +94,7 @@ export class MarkedRoom { relativeProbability: item[1], }); - this.logger.logDebug(`Added ${item[0]} to ${spawnpoint.template.Id}`); + this.logger.debug(`Added ${item[0]} to ${spawnpoint.template.Id}`); } } @@ -105,7 +105,7 @@ export class MarkedRoom { for (const dist of spawnpoint.itemDistribution) { if (dist.composedKey.key == item._id) { dist.relativeProbability *= this.markedRoomConfig.itemGroups[group]; - this.logger.logDebug(`markedItemGroups: Changed ${item._tpl} to ${dist.relativeProbability}`); + this.logger.debug(`markedItemGroups: Changed ${item._tpl} to ${dist.relativeProbability}`); } } } diff --git a/src/mod.ts b/src/mod.ts index f94f5d4..bf89ca4 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -94,9 +94,9 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { for (const map in Mod.config.looseLootMultiplier) { LocationConfig.looseLootMultiplier[map] = Mod.config.looseLootMultiplier[map]; - this.logger.logDebug(`${map}: ${LocationConfig.looseLootMultiplier[map]}`); + this.logger.debug(`${map}: ${LocationConfig.looseLootMultiplier[map]}`); LocationConfig.staticLootMultiplier[map] = Mod.config.staticLootMultiplier[map]; - this.logger.logDebug(`${map}: ${LocationConfig.staticLootMultiplier[map]}`); + this.logger.debug(`${map}: ${LocationConfig.staticLootMultiplier[map]}`); } for (const locationId in locations) { @@ -104,7 +104,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { const location: ILocation = locations[locationId]; //Location does not have any static loot pools, skip this map. if (!location.staticLoot) { - this.logger.logDebug(`Skipping ${locationId} as it has no static loot`); + this.logger.debug(`Skipping ${locationId} as it has no static loot`); continue; } @@ -116,7 +116,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { if (staticLoot[container].itemcountDistribution[possItemCount].count == 0) { staticLoot[container].itemcountDistribution[possItemCount].relativeProbability = Math.round(staticLoot[container].itemcountDistribution[possItemCount].relativeProbability * Mod.config.containers[container]); - this.logger.logDebug(`Changed container ${container} chance to ${staticLoot[container].itemcountDistribution[possItemCount].relativeProbability}`); + this.logger.debug(`Changed container ${container} chance to ${staticLoot[container].itemcountDistribution[possItemCount].relativeProbability}`); } } } @@ -236,7 +236,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { const seasonalItemTplBlacklist = seasonalEventService.getInactiveSeasonalEventItems(); for (const spawnPoint of chosenSpawnpoints) { if (!spawnPoint.template) { - this.logger.logWarning(localisationService.getText("location-missing_dynamic_template", spawnPoint.locationId)); + this.logger.warning(localisationService.getText("location-missing_dynamic_template", spawnPoint.locationId)); continue; } @@ -256,7 +256,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { } if (itemArray.length === 0) { - this.logger.logWarning(`Loot pool for position: ${spawnPoint.template.Id} is empty. Skipping`); + this.logger.warning(`Loot pool for position: ${spawnPoint.template.Id} is empty. Skipping`); continue; } @@ -326,7 +326,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); } else { // RSP30 (62178be9d0050232da3485d9/624c0b3340357b5f566e8766) doesnt have any default presets and kills this code below as it has no chidren to reparent - this.logger.logDebug(`createItem() No preset found for weapon: ${tpl}`); + this.logger.debug(`createItem() No preset found for weapon: ${tpl}`); } const rootItem = items[0]; @@ -378,16 +378,16 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { } } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.SIMPLE_CONTAINER) && tpl != "5c093e3486f77430cb02e593") { const contloot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, Mod.config.general.looseContainerModifier); - this.logger.logDebug(`Container ${tpl} with`); + this.logger.debug(`Container ${tpl} with`); for (const cont of contloot) { - this.logger.logDebug(`${cont._tpl}`); + this.logger.debug(`${cont._tpl}`); items.push(cont); } } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.BACKPACK)) { const contloot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, Mod.config.general.looseBackpackModifier); - this.logger.logDebug(`Backpack ${tpl} with`); + this.logger.debug(`Backpack ${tpl} with`); for (const cont of contloot) { - this.logger.logDebug(`${cont._tpl}`); + this.logger.debug(`${cont._tpl}`); items.push(cont); } } else if (this.itemHelper.armorItemCanHoldMods(tpl)) { @@ -427,7 +427,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { const item = items[tpl]; if (item._props.Grids[0]._props.filters[0] === undefined) { - this.logger.logWarning(`${item._name} doesn't have a filter, setting default filter!`); + this.logger.warning(`${item._name} doesn't have a filter, setting default filter!`); item._props.Grids[0]._props.filters = [ { Filter: ["54009119af1c881c07000029"], @@ -444,7 +444,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { if (this.looseContainerItemFilterIndex[tpl]) { whitelist = this.looseContainerItemFilterIndex[tpl]; } else { - this.logger.logDebug(`${tpl} is new, generating whitelist`); + this.logger.debug(`${tpl} is new, generating whitelist`); const newWhiteList: string[] = []; const newBlackList: string[] = []; @@ -493,7 +493,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { } if (whitelist.length == 0) { - this.logger.logWarning(`${tpl} whitelist is empty`); + this.logger.warning(`${tpl} whitelist is empty`); return []; } From 66d21cc3f345806036f6c0fc114b02001768d92f Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 25 Oct 2024 16:43:22 +0200 Subject: [PATCH 13/23] Update generateDynamicLoot's blacklisting --- src/mod.ts | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/mod.ts b/src/mod.ts index bf89ca4..66efe9a 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -151,6 +151,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { // The only difference being the bypass for loot overlay and using createStaticLootItem private generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[] { const LocationLootGenerator = Mod.container.resolve("LocationLootGenerator"); + const itemFilterService = Mod.container.resolve("ItemFilterService"); const randomUtil = Mod.container.resolve("RandomUtil"); const mathUtil = Mod.container.resolve("MathUtil"); const localisationService = Mod.container.resolve("LocalisationService"); @@ -240,15 +241,28 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { continue; } + // Ensure no blacklisted lootable items are in pool + spawnPoint.template.Items = spawnPoint.template.Items.filter((item) => !itemFilterService.isLootableItemBlacklisted(item._tpl)); + + // Ensure no seasonal items are in pool if not in-season + if (!seasonalEventActive) { + spawnPoint.template.Items = spawnPoint.template.Items.filter((item) => !seasonalItemTplBlacklist.includes(item._tpl)); + } + + // Spawn point has no items after filtering, skip if (!spawnPoint.template.Items || spawnPoint.template.Items.length === 0) { - this.logger.logError(localisationService.getText("location-spawnpoint_missing_items", spawnPoint.template.Id)); + this.logger.warning(localisationService.getText("location-spawnpoint_missing_items", spawnPoint.template.Id)); + continue; } + // Get an array of allowed IDs after above filtering has occured + const validItemIds = spawnPoint.template.Items.map((item) => item._id); + + // Spawn point has no items after filtering, skip const itemArray = new ProbabilityObjectArray(mathUtil, this.cloner); for (const itemDist of spawnPoint.itemDistribution) { - if (!seasonalEventActive && seasonalItemTplBlacklist.includes(spawnPoint.template.Items.find((x) => x._id === itemDist.composedKey.key)._tpl)) { - // Skip seasonal event items if they're not enabled + if (!validItemIds.includes(itemDist.composedKey.key)) { continue; } @@ -256,7 +270,7 @@ class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { } if (itemArray.length === 0) { - this.logger.warning(`Loot pool for position: ${spawnPoint.template.Id} is empty. Skipping`); + this.logger.warning(localisationService.getText("location-loot_pool_is_empty_skipping", spawnPoint.template.Id)); continue; } From 4a6f16b058375ff5d44eb2a28d80818a45edbd3c Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 20 Nov 2024 13:59:53 +0100 Subject: [PATCH 14/23] Update types --- types/callbacks/GameCallbacks.d.ts | 14 +++- types/callbacks/HealthCallbacks.d.ts | 9 --- types/callbacks/InraidCallbacks.d.ts | 2 +- types/callbacks/InventoryCallbacks.d.ts | 2 + types/callbacks/MatchCallbacks.d.ts | 3 +- types/context/ContextVariableType.d.ts | 2 +- types/controllers/GameController.d.ts | 56 ++------------ types/controllers/HealthController.d.ts | 10 --- types/controllers/InraidController.d.ts | 6 +- types/controllers/InsuranceController.d.ts | 5 ++ types/controllers/InventoryController.d.ts | 10 +++ types/controllers/QuestController.d.ts | 51 ------------ types/di/Serializer.d.ts | 2 +- .../generators/BotEquipmentModGenerator.d.ts | 7 ++ types/generators/BotGenerator.d.ts | 37 ++++++++- types/generators/BotLootGenerator.d.ts | 8 -- types/generators/LocationLootGenerator.d.ts | 6 +- types/generators/RagfairOfferGenerator.d.ts | 5 +- types/generators/WeatherGenerator.d.ts | 2 +- .../helpers/Dialogue/SptDialogueChatBot.d.ts | 6 +- types/helpers/InRaidHelper.d.ts | 14 ++-- types/helpers/ItemHelper.d.ts | 5 ++ types/helpers/QuestHelper.d.ts | 71 ++++++++++++++++- types/helpers/TraderHelper.d.ts | 2 +- types/models/eft/common/IGlobals.d.ts | 30 ++++++++ types/models/eft/common/ILocationBase.d.ts | 28 +++++++ types/models/eft/common/tables/IBotBase.d.ts | 2 + types/models/eft/common/tables/IBotType.d.ts | 10 ++- types/models/eft/common/tables/IItem.d.ts | 14 +++- types/models/eft/common/tables/ITrader.d.ts | 5 ++ .../eft/game/ISendSurveyOpinionRequest.d.ts | 9 +++ .../models/eft/game/ISurveyResponseData.d.ts | 35 +++++++++ .../eft/hideout/IHideoutProduction.d.ts | 1 + .../eft/inRaid/IScavSaveRequestData.d.ts | 3 +- .../eft/inventory/IPinOrLockItemRequest.d.ts | 8 ++ .../eft/match/IEndLocalRaidRequestData.d.ts | 9 ++- types/models/enums/ExitStatis.d.ts | 11 +-- types/models/enums/ItemEventActions.d.ts | 3 +- types/models/enums/Season.d.ts | 4 +- types/models/enums/SeasonalEventType.d.ts | 2 +- types/models/enums/WildSpawnTypeNumber.d.ts | 7 +- types/models/spt/bots/IModToSpawnRequest.d.ts | 3 +- types/models/spt/config/IBotConfig.d.ts | 8 +- types/models/spt/config/ICoreConfig.d.ts | 3 + types/models/spt/config/IInsuranceConfig.d.ts | 4 +- types/models/spt/config/IItemConfig.d.ts | 8 +- types/models/spt/config/ILocationConfig.d.ts | 10 ++- types/models/spt/config/IQuestConfig.d.ts | 2 +- types/models/spt/config/IRagfairConfig.d.ts | 4 + .../spt/config/ISeasonalEventConfig.d.ts | 13 +++- types/models/spt/config/ITraderConfig.d.ts | 4 + types/routers/ImageRouter.d.ts | 2 +- .../routers/serializers/BundleSerializer.d.ts | 2 +- .../routers/serializers/ImageSerializer.d.ts | 2 +- .../routers/serializers/NotifySerializer.d.ts | 2 +- types/servers/http/SptHttpListener.d.ts | 4 +- types/services/InsuranceService.d.ts | 1 + types/services/LocationLifecycleService.d.ts | 17 +++- types/services/PaymentService.d.ts | 3 +- types/services/PmcChatResponseService.d.ts | 16 +++- types/services/PostDbLoadService.d.ts | 77 +++++++++++++++++++ types/services/SeasonalEventService.d.ts | 33 ++++++-- .../ProductionQuestsGen.d.ts | 16 ++++ .../ProductionQuestsGenProgram.d.ts | 7 ++ types/utils/HttpFileUtil.d.ts | 2 +- 65 files changed, 555 insertions(+), 204 deletions(-) create mode 100644 types/models/eft/game/ISendSurveyOpinionRequest.d.ts create mode 100644 types/models/eft/game/ISurveyResponseData.d.ts create mode 100644 types/models/eft/inventory/IPinOrLockItemRequest.d.ts create mode 100644 types/services/PostDbLoadService.d.ts create mode 100644 types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts create mode 100644 types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts diff --git a/types/callbacks/GameCallbacks.d.ts b/types/callbacks/GameCallbacks.d.ts index e34bc41..fc866ce 100644 --- a/types/callbacks/GameCallbacks.d.ts +++ b/types/callbacks/GameCallbacks.d.ts @@ -13,7 +13,9 @@ import { IGameModeResponse } from "@spt/models/eft/game/IGameModeResponse"; import { IGameStartResponse } from "@spt/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse"; +import { ISendSurveyOpinionRequest } from "@spt/models/eft/game/ISendSurveyOpinionRequest"; import { IServerDetails } from "@spt/models/eft/game/IServerDetails"; +import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData"; import { IVersionValidateRequestData } from "@spt/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; @@ -90,5 +92,15 @@ export declare class GameCallbacks implements OnLoad { * Handle /client/survey * @returns INullResponseData */ - getSurvey(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; + getSurvey(url: string, request: IEmptyRequestData, sessionId: string): INullResponseData | IGetBodyResponseData; + /** + * Handle client/survey/view + * @returns INullResponseData + */ + getSurveyView(url: string, request: any, sessionId: string): INullResponseData; + /** + * Handle client/survey/opinion + * @returns INullResponseData + */ + sendSurveyOpinion(url: string, request: ISendSurveyOpinionRequest, sessionId: string): INullResponseData; } diff --git a/types/callbacks/HealthCallbacks.d.ts b/types/callbacks/HealthCallbacks.d.ts index 840c9b1..8523479 100644 --- a/types/callbacks/HealthCallbacks.d.ts +++ b/types/callbacks/HealthCallbacks.d.ts @@ -4,7 +4,6 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IHealthTreatmentRequestData } from "@spt/models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "@spt/models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "@spt/models/eft/health/IOffraidHealRequestData"; -import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; import { IWorkoutData } from "@spt/models/eft/health/IWorkoutData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -14,14 +13,6 @@ export declare class HealthCallbacks { protected profileHelper: ProfileHelper; protected healthController: HealthController; constructor(httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, healthController: HealthController); - /** - * Custom spt server request found in modules/HealthSynchronizer.cs - * @param url - * @param info HealthListener.Instance.CurrentHealth class - * @param sessionID session id - * @returns empty response, no data sent back to client - */ - syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData; /** * Custom spt server request found in modules/QTEPatch.cs * @param url diff --git a/types/callbacks/InraidCallbacks.d.ts b/types/callbacks/InraidCallbacks.d.ts index 675403f..02b46f3 100644 --- a/types/callbacks/InraidCallbacks.d.ts +++ b/types/callbacks/InraidCallbacks.d.ts @@ -21,7 +21,7 @@ export declare class InraidCallbacks { */ registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData; /** - * Handle raid/profile/save + * Handle raid/profile/scavsave * @param url * @param info Save progress request * @param sessionID Session id diff --git a/types/callbacks/InventoryCallbacks.d.ts b/types/callbacks/InventoryCallbacks.d.ts index e0968e6..cfbf6f3 100644 --- a/types/callbacks/InventoryCallbacks.d.ts +++ b/types/callbacks/InventoryCallbacks.d.ts @@ -18,6 +18,7 @@ import { IInventoryTagRequestData } from "@spt/models/eft/inventory/IInventoryTa import { IInventoryToggleRequestData } from "@spt/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IPinOrLockItemRequest } from "@spt/models/eft/inventory/IPinOrLockItemRequest"; import { IRedeemProfileRequestData } from "@spt/models/eft/inventory/IRedeemProfileRequestData"; import { ISetFavoriteItems } from "@spt/models/eft/inventory/ISetFavoriteItems"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -58,4 +59,5 @@ export declare class InventoryCallbacks { * Handle game/profile/items/moving - QuestFail */ failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; + pinOrLock(pmcData: IPmcData, request: IPinOrLockItemRequest, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; } diff --git a/types/callbacks/MatchCallbacks.d.ts b/types/callbacks/MatchCallbacks.d.ts index b63c920..0ab9f02 100644 --- a/types/callbacks/MatchCallbacks.d.ts +++ b/types/callbacks/MatchCallbacks.d.ts @@ -1,5 +1,6 @@ import { MatchController } from "@spt/controllers/MatchController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; +import { IMetrics } from "@spt/models/eft/common/tables/IMatch"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; @@ -53,7 +54,7 @@ export declare class MatchCallbacks { /** Handle match/group/start_game */ joinMatch(url: string, info: IMatchGroupStartGameRequest, sessionID: string): IGetBodyResponseData; /** Handle client/getMetricsConfig */ - getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; + getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; /** * Called periodically while in a group * Handle client/match/group/status diff --git a/types/context/ContextVariableType.d.ts b/types/context/ContextVariableType.d.ts index 38facc6..03a5188 100644 --- a/types/context/ContextVariableType.d.ts +++ b/types/context/ContextVariableType.d.ts @@ -3,7 +3,7 @@ export declare enum ContextVariableType { SESSION_ID = 0, /** Currently acive raid information */ RAID_CONFIGURATION = 1, - /** Timestamp when client first connected */ + /** SessionID + Timestamp when client first connected, has _ between values */ CLIENT_START_TIMESTAMP = 2, /** When player is loading into map and loot is requested */ REGISTER_PLAYER_REQUEST = 3, diff --git a/types/controllers/GameController.d.ts b/types/controllers/GameController.d.ts index dbcbce2..2717c3f 100644 --- a/types/controllers/GameController.d.ts +++ b/types/controllers/GameController.d.ts @@ -14,14 +14,12 @@ import { IGameModeRequestData } from "@spt/models/eft/game/IGameModeRequestData" import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse"; import { IServerDetails } from "@spt/models/eft/game/IServerDetails"; +import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; -import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { ILootConfig } from "@spt/models/spt/config/ILootConfig"; -import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -31,6 +29,7 @@ import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { OpenZoneService } from "@spt/services/OpenZoneService"; +import { PostDbLoadService } from "@spt/services/PostDbLoadService"; import { ProfileActivityService } from "@spt/services/ProfileActivityService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -52,6 +51,7 @@ export declare class GameController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; + protected postDbLoadService: PostDbLoadService; protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; @@ -64,33 +64,16 @@ export declare class GameController { protected cloner: ICloner; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; - protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - protected pmcConfig: IPmcConfig; - protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, inventoryHelper: InventoryHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, inventoryHelper: InventoryHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, postDbLoadService: PostDbLoadService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; protected migrate39xProfile(fullProfile: ISptProfile): void; - protected adjustHideoutCraftTimes(overrideSeconds: number): void; - /** - * Adjust all hideout craft times to be no higher than the override - */ - protected adjustHideoutBuildTimes(overrideSeconds: number): void; - protected adjustLocationBotValues(): void; - /** - * Out of date/incorrectly made trader mods forget this data - */ - protected checkTraderRepairValuesExist(): void; - protected addCustomLooseLootPositions(): void; - protected adjustLooseLootSpawnProbabilities(): void; - /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ - protected adjustMapBotLimits(): void; /** * Handle client/game/config */ @@ -119,48 +102,26 @@ export declare class GameController { * Handle singleplayer/settings/getRaidTime */ getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse; - /** - * BSG have two values for shotgun dispersion, we make sure both have the same value - */ - protected fixShotgunDispersions(): void; /** * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; - protected setAllDbItemsAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * @param pmcProfile Profile to adjust values for */ protected updateProfileHealthValues(pmcProfile: IPmcData): void; - /** - * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max - */ - protected fixBrokenOfflineMapWaves(): void; - /** - * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions - */ - protected fixRoguesSpawningInstantlyOnLighthouse(): void; /** * Send starting gifts to profile after x days * @param pmcProfile Profile to add gifts to */ protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void; - /** - * Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these - * waves to one bot when they're waiting to spawn for too long - */ - protected splitBotWavesIntoSingleWaves(): void; /** * Get a list of installed mods and save their details to the profile being used * @param fullProfile Profile to add mod details to */ protected saveActiveModsToProfile(fullProfile: ISptProfile): void; - /** - * Check for any missing assorts inside each traders assort.json data, checking against traders questassort.json - */ - protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool * @param pmcProfile Profile of player to get name from @@ -171,13 +132,6 @@ export declare class GameController { * @param fullProfile Profile to check for dialog in */ protected checkForAndRemoveUndefinedDialogs(fullProfile: ISptProfile): void; - /** - * Blank out the "test" mail message from prapor - */ - protected removePraporTestMessage(): void; - /** - * Make non-trigger-spawned raiders spawn earlier + always - */ - protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: ISptProfile): void; + getSurvey(sessionId: string): ISurveyResponseData; } diff --git a/types/controllers/HealthController.d.ts b/types/controllers/HealthController.d.ts index 5a0a0a6..a17efe3 100644 --- a/types/controllers/HealthController.d.ts +++ b/types/controllers/HealthController.d.ts @@ -5,7 +5,6 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IHealthTreatmentRequestData } from "@spt/models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "@spt/models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "@spt/models/eft/health/IOffraidHealRequestData"; -import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; import { IWorkoutData } from "@spt/models/eft/health/IWorkoutData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -25,15 +24,6 @@ export declare class HealthController { protected healthHelper: HealthHelper; protected cloner: ICloner; constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, httpResponse: HttpResponseUtil, healthHelper: HealthHelper, cloner: ICloner); - /** - * stores in-raid player health - * @param pmcData Player profile - * @param info Request data - * @param sessionID Player id - * @param addEffects Should effects found be added or removed from profile - * @param deleteExistingEffects Should all prior effects be removed before apply new ones - */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** * When healing in menu * @param pmcData Player profile diff --git a/types/controllers/InraidController.d.ts b/types/controllers/InraidController.d.ts index 8f0bfc1..b9f69c2 100644 --- a/types/controllers/InraidController.d.ts +++ b/types/controllers/InraidController.d.ts @@ -28,13 +28,13 @@ export declare class InraidController { */ addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; /** - * Handle raid/profile/save + * Handle raid/profile/scavsave * Save profile state to disk * Handles pmc/pscav - * @param offraidData post-raid request data + * @param offraidProfileData Post-raid scav profile data * @param sessionID Session id */ - savePostRaidProfileForScav(offraidData: IScavSaveRequestData, sessionID: string): void; + savePostRaidProfileForScav(offraidProfileData: IScavSaveRequestData, sessionID: string): void; /** * Get the inraid config from configs/inraid.json * @returns InRaid Config diff --git a/types/controllers/InsuranceController.d.ts b/types/controllers/InsuranceController.d.ts index 2701622..c982529 100644 --- a/types/controllers/InsuranceController.d.ts +++ b/types/controllers/InsuranceController.d.ts @@ -176,6 +176,11 @@ export declare class InsuranceController { * @returns void */ protected sendMail(sessionID: string, insurance: IInsurance): void; + protected IsMapLabsAndInsuranceDisabled(insurance: IInsurance, labsId?: string): boolean; + /** + * Update IInsurance object with new messageTemplateId and wipe out items array data + */ + protected handleLabsInsurance(traderDialogMessages: Record, insurance: IInsurance): void; /** * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. diff --git a/types/controllers/InventoryController.d.ts b/types/controllers/InventoryController.d.ts index c986ce8..fb81a2f 100644 --- a/types/controllers/InventoryController.d.ts +++ b/types/controllers/InventoryController.d.ts @@ -25,6 +25,7 @@ import { IInventoryTagRequestData } from "@spt/models/eft/inventory/IInventoryTa import { IInventoryToggleRequestData } from "@spt/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IPinOrLockItemRequest } from "@spt/models/eft/inventory/IPinOrLockItemRequest"; import { IRedeemProfileRequestData } from "@spt/models/eft/inventory/IRedeemProfileRequestData"; import { ISetFavoriteItems } from "@spt/models/eft/inventory/ISetFavoriteItems"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -228,4 +229,13 @@ export declare class InventoryController { openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string, output: IItemEventRouterResponse): void; redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): void; setFavoriteItem(pmcData: IPmcData, request: ISetFavoriteItems, sessionId: string): void; + /** + * Handle /client/game/profile/items/moving - PinLock + * Requires no response to client, only server change + * @param pmcData Players profile + * @param request Pin/Lock request data + * @param sessionID Session id + * @param output data to send back to client + */ + pinOrLock(pmcData: IPmcData, request: IPinOrLockItemRequest, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; } diff --git a/types/controllers/QuestController.d.ts b/types/controllers/QuestController.d.ts index 270a70a..ac486e3 100644 --- a/types/controllers/QuestController.d.ts +++ b/types/controllers/QuestController.d.ts @@ -5,7 +5,6 @@ import { QuestConditionHelper } from "@spt/helpers/QuestConditionHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt/models/eft/common/tables/IBotBase"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; @@ -54,13 +53,6 @@ export declare class QuestController { * @returns array of IQuest */ getClientQuests(sessionID: string): IQuest[]; - /** - * Does a provided quest have a level requirement equal to or below defined level - * @param quest Quest to check - * @param playerLevel level of player to test against quest - * @returns true if quest can be seen/accepted by player of defined level - */ - protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean; /** * Handle QuestAccept event * Handle the client accepting a quest and starting it @@ -108,49 +100,6 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Return a list of quests that would fail when supplied quest is completed - * @param completedQuestId quest completed id - * @returns array of IQuest objects - */ - protected getQuestsFailedByCompletingQuest(completedQuestId: string, pmcProfile: IPmcData): IQuest[]; - /** - * Remove a quest entirely from a profile - * @param sessionId Player id - * @param questIdToRemove Qid of quest to remove - */ - protected removeQuestFromScavProfile(sessionId: string, questIdToRemove: string): void; - /** - * Return quests that have different statuses - * @param preQuestStatusus Quests before - * @param postQuestStatuses Quests after - * @returns QuestStatusChange array - */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; - /** - * Send a popup to player on successful completion of a quest - * @param sessionID session id - * @param pmcData Player profile - * @param completedQuestId Completed quest id - * @param questRewards Rewards given to player - */ - protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: IItem[]): void; - /** - * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile - * @param pmcData Player profile to update - * @param quests Quests to look for wait conditions in - * @param completedQuestId Quest just completed - */ - protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void; - /** - * Fail the provided quests - * Update quest in profile, otherwise add fresh quest object with failed status - * @param sessionID session id - * @param pmcData player profile - * @param questsToFail quests to fail - * @param output Client output - */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/types/di/Serializer.d.ts b/types/di/Serializer.d.ts index 56db477..a48dd58 100644 --- a/types/di/Serializer.d.ts +++ b/types/di/Serializer.d.ts @@ -1,5 +1,5 @@ import { IncomingMessage, ServerResponse } from "node:http"; export declare class Serializer { - serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; canHandle(something: string): boolean; } diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index c2b531c..40c361f 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -139,6 +139,13 @@ export declare class BotEquipmentModGenerator { * @returns itemHelper.getItem() result */ protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; + /** + * Given the passed in array of magaizne tpls, look up the min size set in config and return only those that have that size or larger + * @param modSpawnRequest Request data + * @param modPool Pool of magazine tpls to filter + * @returns Filtered pool of magazine tpls + */ + protected getFilterdMagazinePoolByCapacity(modSpawnRequest: IModToSpawnRequest, modPool: string[]): string[]; /** * Choose a weapon mod tpl for a given slot from a pool of choices * Checks chosen tpl is compatible with all existing weapon items diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index 6f76b37..2c7bba6 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -1,8 +1,10 @@ import { BotInventoryGenerator } from "@spt/generators/BotInventoryGenerator"; import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator"; +import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { MinMax } from "@spt/models/common/MinMax"; import { IBaseJsonSkills, IBaseSkill, IBotBase, IInfo, IHealth as PmcHealth, ISkills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; import { IAppearance, IBodyPart, IBotType, IHealth, IInventory } from "@spt/models/eft/common/tables/IBotType"; import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; @@ -31,6 +33,7 @@ export declare class BotGenerator { protected botEquipmentFilterService: BotEquipmentFilterService; protected weightedRandomHelper: WeightedRandomHelper; protected botHelper: BotHelper; + protected botGeneratorHelper: BotGeneratorHelper; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; protected botNameService: BotNameService; @@ -38,7 +41,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -48,7 +51,7 @@ export declare class BotGenerator { */ generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase; /** - * Create 1 bots of the type/side/difficulty defined in botGenerationDetails + * Create 1 bot of the type/side/difficulty defined in botGenerationDetails * @param sessionId Session id * @param botGenerationDetails details on how to generate bots * @returns constructed bot @@ -76,6 +79,36 @@ export declare class BotGenerator { * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): IBotBase; + /** + * Get exp for kill by bot difficulty + * @param experience Dict of difficulties and experience + * @param botDifficulty the killed bots difficulty + * @param role Role of bot (optional, used for error logging) + * @returns Experience for kill + */ + protected getExperienceRewardForKillByDifficulty(experience: Record, botDifficulty: string, role: string): number; + /** + * Get the standing value change when player kills a bot + * @param standingForKill Dictionary of standing values keyed by bot difficulty + * @param botDifficulty Difficulty of bot to look up + * @param role Role of bot (optional, used for error logging) + * @returns Standing change value + */ + protected getStandingChangeForKillByDifficulty(standingForKill: Record, botDifficulty: string, role: string): number; + /** + * Get the agressor bonus value when player kills a bot + * @param standingForKill Dictionary of standing values keyed by bot difficulty + * @param botDifficulty Difficulty of bot to look up + * @param role Role of bot (optional, used for error logging) + * @returns Standing change value + */ + protected getAgressorBonusByDifficulty(aggressorBonus: Record, botDifficulty: string, role: string): number; + /** + * Set weighting of flagged equipment to 0 + * @param botJsonTemplate Bot data to adjust + * @param botGenerationDetails Generation details of bot + */ + protected filterBlacklistedGear(botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): void; protected addAdditionalPocketLootWeightsForUnheardBot(botJsonTemplate: IBotType): void; /** * Remove items from item.json/lootableItemBlacklist from bots inventory diff --git a/types/generators/BotLootGenerator.d.ts b/types/generators/BotLootGenerator.d.ts index 07f8b68..6bea787 100644 --- a/types/generators/BotLootGenerator.d.ts +++ b/types/generators/BotLootGenerator.d.ts @@ -71,14 +71,6 @@ export declare class BotLootGenerator { * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; - /** - * Get a biased random number - * @param min Smallest size - * @param max Biggest size - * @param nValue Value to bias choice - * @returns Chosen number - */ - protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit or space limit is reached * @param pool Pool of items to pick from with weight diff --git a/types/generators/LocationLootGenerator.d.ts b/types/generators/LocationLootGenerator.d.ts index 6ef0bbc..79dddb2 100644 --- a/types/generators/LocationLootGenerator.d.ts +++ b/types/generators/LocationLootGenerator.d.ts @@ -3,7 +3,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IContainerMinMax, IStaticAmmoDetails, IStaticContainer, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "@spt/models/eft/common/ILocation"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { ILooseLoot, ISpawnpoint, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; +import { ILooseLoot, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -124,7 +124,7 @@ export declare class LocationLootGenerator { * @param forcedSpawnPoints forced Forced loot locations that must be added * @param locationName Name of map currently having force loot created for */ - protected addForcedLoot(lootLocationTemplates: ISpawnpointTemplate[], forcedSpawnPoints: ISpawnpointsForced[], locationName: string): void; + protected addForcedLoot(lootLocationTemplates: ISpawnpointTemplate[], forcedSpawnPoints: ISpawnpointsForced[], locationName: string, staticAmmoDist: Record): void; /** * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for @@ -132,7 +132,7 @@ export declare class LocationLootGenerator { * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: ISpawnpoint, staticAmmoDist: Record): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, items: IItem[], staticAmmoDist: Record): IContainerItem; /** * Find an item in array by its _tpl, handle differently if chosenTpl is a weapon * @param items Items array to search diff --git a/types/generators/RagfairOfferGenerator.d.ts b/types/generators/RagfairOfferGenerator.d.ts index 3c88984..60d6c9d 100644 --- a/types/generators/RagfairOfferGenerator.d.ts +++ b/types/generators/RagfairOfferGenerator.d.ts @@ -149,12 +149,13 @@ export declare class RagfairOfferGenerator { protected removeBannedPlatesFromPreset(presetWithChildren: IItem[], plateSettings: IArmorPlateBlacklistSettings): boolean; /** * Create one flea offer for a specific item + * @param sellerId Id of seller * @param itemWithChildren Item to create offer for * @param isPreset Is item a weapon preset - * @param itemDetails raw db item details + * @param itemToSellDetails Raw db item details * @returns Item array */ - protected createSingleOfferForItem(itemWithChildren: IItem[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; + protected createSingleOfferForItem(sellerId: string, itemWithChildren: IItem[], isPreset: boolean, itemToSellDetails: ITemplateItem): Promise; /** * Generate trader offers on flea using the traders assort data * @param traderID Trader to generate offers for diff --git a/types/generators/WeatherGenerator.d.ts b/types/generators/WeatherGenerator.d.ts index 476f29c..71d2826 100644 --- a/types/generators/WeatherGenerator.d.ts +++ b/types/generators/WeatherGenerator.d.ts @@ -66,5 +66,5 @@ export declare class WeatherGenerator { protected getWeightedWindSpeed(): number; protected getWeightedFog(): number; protected getWeightedRain(): number; - protected getRandomFloat(node: string): number; + protected getRandomFloat(node: string, precision?: number): number; } diff --git a/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/types/helpers/Dialogue/SptDialogueChatBot.d.ts index 8d3aa97..d2bf5c5 100644 --- a/types/helpers/Dialogue/SptDialogueChatBot.d.ts +++ b/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -6,17 +6,21 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { GiftService } from "@spt/services/GiftService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class SptDialogueChatBot implements IDialogueChatBot { protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected mailSendService: MailSendService; + protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected giftService: GiftService; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected weatherConfig: IWeatherConfig; - constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, giftService: GiftService, configServer: ConfigServer); getChatBot(): IUserDialogInfo; /** * Send responses back to player when they communicate with SPT friend on friends list diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index 11b4043..eda416e 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -41,12 +41,16 @@ export declare class InRaidHelper { */ setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData, isSurvived: boolean, isTransfer: boolean): void; /** - * 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 + * Remove FiR status from items + * @param items Items to process */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; + protected removeFiRStatusFromCertainItems(items: IItem[]): void; + /** + * Add items from one parameter into another + * @param itemsToAdd Items we want to add + * @param serverInventoryItems Location to add items to + */ + protected addItemsToInventory(itemsToAdd: IItem[], serverInventoryItems: IItem[]): void; /** * Clear PMC inventory of all items except those that are exempt * Used post-raid to remove items after death diff --git a/types/helpers/ItemHelper.d.ts b/types/helpers/ItemHelper.d.ts index 366ad9b..24a6b38 100644 --- a/types/helpers/ItemHelper.d.ts +++ b/types/helpers/ItemHelper.d.ts @@ -536,6 +536,11 @@ export declare class ItemHelper { */ getRandomisedAmmoStackSize(ammoItemTemplate: ITemplateItem, maxLimit?: number): number; getItemBaseType(tpl: string, rootOnly?: boolean): string; + /** + * Remove FiR status from passed in items + * @param items Items to update FiR status of + */ + removeSpawnedInSessionPropertyFromItems(items: IItem[]): void; } declare namespace ItemHelper { interface IItemSize { diff --git a/types/helpers/QuestHelper.d.ts b/types/helpers/QuestHelper.d.ts index 02fc439..ff0f72b 100644 --- a/types/helpers/QuestHelper.d.ts +++ b/types/helpers/QuestHelper.d.ts @@ -12,6 +12,7 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition, IQuestReward } from "@spt/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData"; +import { ICompleteQuestRequestData } from "@spt/models/eft/quests/ICompleteQuestRequestData"; import { IFailQuestRequestData } from "@spt/models/eft/quests/IFailQuestRequestData"; import { QuestStatus } from "@spt/models/enums/QuestStatus"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; @@ -22,6 +23,7 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; +import { PlayerService } from "@spt/services/PlayerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -44,10 +46,11 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; + protected playerService: PlayerService; protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseService: DatabaseService, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, traderHelper: TraderHelper, presetHelper: PresetHelper, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseService: DatabaseService, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, traderHelper: TraderHelper, presetHelper: PresetHelper, mailSendService: MailSendService, playerService: PlayerService, configServer: ConfigServer, cloner: ICloner); /** * Get status of a quest in player profile by its id * @param pmcData Profile to search @@ -260,6 +263,13 @@ export declare class QuestHelper { * @returns Array of reward objects */ applyQuestReward(profileData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): IItem[]; + /** + * Does the provided quest reward have a game version requirement to be given and does it match + * @param reward Reward to check + * @param gameVersion Version of game to check reward against + * @returns True if it has requirement, false if it doesnt pass check + */ + protected questRewardIsForGameEdition(reward: IQuestReward, gameVersion: string): boolean; /** * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile * also update client response recipeUnlocked array with craft id @@ -302,4 +312,63 @@ export declare class QuestHelper { * @returns Hours item will be available for */ getMailItemRedeemTimeHoursForProfile(pmcData: IPmcData): number; + completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Handle client/quest/list + * Get all quests visible to player + * Exclude quests with incomplete preconditions (level/loyalty) + * @param sessionID session id + * @returns array of IQuest + */ + getClientQuests(sessionID: string): IQuest[]; + /** + * Return a list of quests that would fail when supplied quest is completed + * @param completedQuestId quest completed id + * @returns array of IQuest objects + */ + protected getQuestsFromProfileFailedByCompletingQuest(completedQuestId: string, pmcProfile: IPmcData): IQuest[]; + /** + * Fail the provided quests + * Update quest in profile, otherwise add fresh quest object with failed status + * @param sessionID session id + * @param pmcData player profile + * @param questsToFail quests to fail + * @param output Client output + */ + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; + /** + * Send a popup to player on successful completion of a quest + * @param sessionID session id + * @param pmcData Player profile + * @param completedQuestId Completed quest id + * @param questRewards Rewards given to player + */ + protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: IItem[]): void; + /** + * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile + * @param pmcData Player profile to update + * @param quests Quests to look for wait conditions in + * @param completedQuestId Quest just completed + */ + protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void; + /** + * Remove a quest entirely from a profile + * @param sessionId Player id + * @param questIdToRemove Qid of quest to remove + */ + protected removeQuestFromScavProfile(sessionId: string, questIdToRemove: string): void; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; + /** + * Does a provided quest have a level requirement equal to or below defined level + * @param quest Quest to check + * @param playerLevel level of player to test against quest + * @returns true if quest can be seen/accepted by player of defined level + */ + protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean; } diff --git a/types/helpers/TraderHelper.d.ts b/types/helpers/TraderHelper.d.ts index 0cce160..1eb3426 100644 --- a/types/helpers/TraderHelper.d.ts +++ b/types/helpers/TraderHelper.d.ts @@ -39,7 +39,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase | undefined; + getTrader(traderID: string, sessionID: string): ITraderBase | any; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for diff --git a/types/models/eft/common/IGlobals.d.ts b/types/models/eft/common/IGlobals.d.ts index f23b608..29f2abf 100644 --- a/types/models/eft/common/IGlobals.d.ts +++ b/types/models/eft/common/IGlobals.d.ts @@ -3,12 +3,25 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IGlobals { time: number; config: IConfig; + LocationInfection: ILocationInfection; bot_presets: IBotPreset[]; AudioSettings: IAudioSettings; EnvironmentSettings: IEnvironmentSettings; BotWeaponScatterings: IBotWeaponScattering[]; ItemPresets: Record; } +export interface ILocationInfection { + Interchange: number; + Lighthouse: number; + RezervBase: number; + Sandbox: number; + Shoreline: number; + TarkovStreets: number; + Woods: number; + bigmap: number; + factory4: number; + laboratory: number; +} export interface IArtilleryShelling { ArtilleryMapsConfigs: Record; ProjectileExplosionParams: IProjectileExplosionParams; @@ -96,6 +109,7 @@ export interface IConfig { MaxBotsAliveOnMapPvE: number; SavagePlayCooldown: number; SavagePlayCooldownNdaFree: number; + SeasonActivity: ISeasonActivity; MarksmanAccuracy: number; SavagePlayCooldownDevelop: number; TODSkyDate: string; @@ -182,6 +196,14 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface ISeasonActivity { + InfectionHalloween: ISeasonActivityHalloween; +} +export interface ISeasonActivityHalloween { + DisplayUIEnabled: boolean; + Enabled: boolean; + ZombieBleedMul: number; +} export interface IEnvironmentSetting2 { EnvironmentUIData: IEnvironmentUIData; } @@ -262,6 +284,7 @@ export interface ITransitSettings { PercentageOfMissingEnergyRestore: number; PercentageOfMissingHealthRestore: number; PercentageOfMissingWaterRestore: number; + RestoreHealthOnDestroyedParts: boolean; ScavPriceMod: number; UsecPriceMod: number; active: boolean; @@ -634,6 +657,12 @@ export interface IEffects { HeavyBleeding: IHeavyBleeding; LightBleeding: ILightBleeding; BodyTemperature: IBodyTemperature; + ZombieInfection: IZombieInfection; +} +export interface IZombieInfection { + Dehydration: number; + HearingDebuffPercentage: number; + СumulativeTime: number; } export interface IExistence { EnergyLoopTime: number; @@ -1203,6 +1232,7 @@ export interface IInsurance { CoefOfSendingMessageTime: number; CoefOfHavingMarkOfUnknown: number; EditionSendingMessageTime: Record; + OnlyInDeathCase: boolean; } export interface IMessageSendTImeMultipler { multiplier: number; diff --git a/types/models/eft/common/ILocationBase.d.ts b/types/models/eft/common/ILocationBase.d.ts index 473648d..75836b6 100644 --- a/types/models/eft/common/ILocationBase.d.ts +++ b/types/models/eft/common/ILocationBase.d.ts @@ -77,6 +77,7 @@ export interface ILocationBase { EscapeTimeLimit: number; EscapeTimeLimitCoop: number; EscapeTimeLimitPVE: number; + Events: ILocationEvents; exit_access_time: number; ForceOnlineRaidInPVE: boolean; exit_count: number; @@ -99,6 +100,7 @@ export interface ILocationBase { export interface ITransit { activateAfterSec: string; active: boolean; + name: string; conditions: string; description: string; id: number; @@ -271,10 +273,36 @@ export interface IWave { slots_min: number; time_max: number; time_min: number; + /** OPTIONAL - Needs to be unique - Used by custom wave service to ensure same wave isnt added multiple times */ sptId?: string; ChanceGroup?: number; + /** 'pve' and/or 'regular' */ SpawnMode: string[]; } +export interface ILocationEvents { + Halloween2024: IHalloween2024; +} +export interface IHalloween2024 { + CrowdAttackBlockRadius: number; + CrowdAttackSpawnParams: CrowdAttackSpawnParam[]; + CrowdCooldownPerPlayerSec: number; + CrowdsLimit: number; + InfectedLookCoeff: number; + MaxCrowdAttackSpawnLimit: number; + MinInfectionPercentage: number; + MinSpawnDistToPlayer: number; + TargetPointSearchRadiusLimit: number; + ZombieCallDeltaRadius: number; + ZombieCallPeriodSec: number; + ZombieCallRadiusLimit: number; + ZombieMultiplier: number; + InfectionPercentage: number; +} +export interface CrowdAttackSpawnParam { + Difficulty: string; + Role: string; + Weight: number; +} export declare enum WildSpawnType { ASSAULT = "assault", MARKSMAN = "marksman", diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 307277c..5becac2 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -93,6 +93,7 @@ export interface IBotInfoSettings { Experience: number; StandingForKill: number; AggressorBonus: number; + UseSimpleAnimator: boolean; } export interface IBan { banType: BanType; @@ -218,6 +219,7 @@ export interface IVictim { Level: number; Weapon: string; Role: string; + Location: string; } export interface ISessionCounters { Items: ICounterKeyValue[]; diff --git a/types/models/eft/common/tables/IBotType.d.ts b/types/models/eft/common/tables/IBotType.d.ts index 6d4b0c7..7581104 100644 --- a/types/models/eft/common/tables/IBotType.d.ts +++ b/types/models/eft/common/tables/IBotType.d.ts @@ -97,10 +97,14 @@ export interface IDifficultyCategories { Shoot: Record; } export interface IExperience { - aggressorBonus: number; + /** key = bot difficulty */ + aggressorBonus: Record; level: MinMax; - reward: MinMax; - standingForKill: number; + /** key = bot difficulty */ + reward: Record; + /** key = bot difficulty */ + standingForKill: Record; + useSimpleAnimator: boolean; } export interface IGeneration { items: IGenerationWeightingItems; diff --git a/types/models/eft/common/tables/IItem.d.ts b/types/models/eft/common/tables/IItem.d.ts index 8139fa1..60b460f 100644 --- a/types/models/eft/common/tables/IItem.d.ts +++ b/types/models/eft/common/tables/IItem.d.ts @@ -42,12 +42,18 @@ export interface IUpd { SideEffect?: IUpdSideEffect; RepairKit?: IUpdRepairKit; CultistAmulet?: IUpdCultistAmulet; + PinLockState?: PinLockState; +} +export declare enum PinLockState { + FREE = "Free", + LOCKED = "Locked", + PINNED = "Pinned" } export interface IUpdBuff { - rarity: string; - buffType: string; - value: number; - thresholdDurability?: number; + Rarity: string; + BuffType: string; + Value: number; + ThresholdDurability?: number; } export interface IUpdTogglable { On: boolean; diff --git a/types/models/eft/common/tables/ITrader.d.ts b/types/models/eft/common/tables/ITrader.d.ts index 9e161c8..6dd54c1 100644 --- a/types/models/eft/common/tables/ITrader.d.ts +++ b/types/models/eft/common/tables/ITrader.d.ts @@ -88,18 +88,23 @@ export interface IBarterScheme { } export interface ISuit { _id: string; + externalObtain: boolean; + internalObtain: boolean; + isHiddenInPVE: boolean; tid: string; suiteId: string; isActive: boolean; requirements: ISuitRequirements; } export interface ISuitRequirements { + achievementRequirements: string[]; loyaltyLevel: number; profileLevel: number; standing: number; skillRequirements: string[]; questRequirements: string[]; itemRequirements: ItemRequirement[]; + requiredTid: string; } export interface ItemRequirement { count: number; diff --git a/types/models/eft/game/ISendSurveyOpinionRequest.d.ts b/types/models/eft/game/ISendSurveyOpinionRequest.d.ts new file mode 100644 index 0000000..70683e8 --- /dev/null +++ b/types/models/eft/game/ISendSurveyOpinionRequest.d.ts @@ -0,0 +1,9 @@ +export interface ISendSurveyOpinionRequest { + surveyId: number; + answers: ISurveyOpinionAnswer[]; +} +export interface ISurveyOpinionAnswer { + questionId: number; + answerType: string; + answers: any; +} diff --git a/types/models/eft/game/ISurveyResponseData.d.ts b/types/models/eft/game/ISurveyResponseData.d.ts new file mode 100644 index 0000000..7de9f50 --- /dev/null +++ b/types/models/eft/game/ISurveyResponseData.d.ts @@ -0,0 +1,35 @@ +export interface ISurveyResponseData { + locale: Record>; + survey: ISurvey; +} +export interface ISurvey { + id: number; + welcomePageData: IWelcomePageData; + farewellPageData: IFarewellPageData; + pages: number[][]; + questions: ISurveyQuestion[]; + isNew: boolean; +} +export interface IWelcomePageData { + titleLocaleKey: string; + timeLocaleKey: string; + descriptionLocaleKey: string; +} +export interface IFarewellPageData { + textLocaleKey: string; +} +export interface ISurveyQuestion { + id: number; + sortIndex: number; + titleLocaleKey: string; + hintLocaleKey: string; + answerLimit: number; + answerType: string; + answers: ISurveyAnswer[]; +} +export interface ISurveyAnswer { + id: number; + questionId: number; + sortIndex: number; + localeKey: string; +} diff --git a/types/models/eft/hideout/IHideoutProduction.d.ts b/types/models/eft/hideout/IHideoutProduction.d.ts index 1926311..8f2af05 100644 --- a/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/types/models/eft/hideout/IHideoutProduction.d.ts @@ -17,6 +17,7 @@ export interface IHideoutProduction { continuous: boolean; count: number; productionLimitCount: number; + isCodeProduction: boolean; } export interface IRequirement extends IRequirementBase { templateId?: string; diff --git a/types/models/eft/inRaid/IScavSaveRequestData.d.ts b/types/models/eft/inRaid/IScavSaveRequestData.d.ts index e96a9ed..3f26e26 100644 --- a/types/models/eft/inRaid/IScavSaveRequestData.d.ts +++ b/types/models/eft/inRaid/IScavSaveRequestData.d.ts @@ -1,4 +1,3 @@ import { IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; -export interface IScavSaveRequestData { - profile: IPostRaidPmcData; +export interface IScavSaveRequestData extends IPostRaidPmcData { } diff --git a/types/models/eft/inventory/IPinOrLockItemRequest.d.ts b/types/models/eft/inventory/IPinOrLockItemRequest.d.ts new file mode 100644 index 0000000..c39b404 --- /dev/null +++ b/types/models/eft/inventory/IPinOrLockItemRequest.d.ts @@ -0,0 +1,8 @@ +import { PinLockState } from "../common/tables/IItem"; +export interface IPinOrLockItemRequest { + Action: "PinLock"; + /** Id of item being pinned */ + Item: string; + /** "Pinned"/"Locked"/"Free" */ + State: PinLockState; +} diff --git a/types/models/eft/match/IEndLocalRaidRequestData.d.ts b/types/models/eft/match/IEndLocalRaidRequestData.d.ts index 08e3c12..cc5b0c5 100644 --- a/types/models/eft/match/IEndLocalRaidRequestData.d.ts +++ b/types/models/eft/match/IEndLocalRaidRequestData.d.ts @@ -13,14 +13,15 @@ export interface IEndLocalRaidRequestData { } export interface IEndRaidResult { profile: IPmcData; - /** "Survived/Transit etc" */ - result: string; - ExitStatus: ExitStatus; + /** "Survived/Transit" etc */ + result: ExitStatus; killerId: string; killerAid: string; + /** "Gate 3" etc */ exitName: string; inSession: boolean; favorite: boolean; + /** Seconds in raid */ playTime: number; } export interface ILocationTransit { @@ -33,6 +34,8 @@ export interface ILocationTransit { raidMode: string; side: string; dayTime: string; + /** The location player last visited */ + sptLastVisitedLocation: string; } export interface ITransitProfile { _id: string; diff --git a/types/models/enums/ExitStatis.d.ts b/types/models/enums/ExitStatis.d.ts index 78d9733..2533076 100644 --- a/types/models/enums/ExitStatis.d.ts +++ b/types/models/enums/ExitStatis.d.ts @@ -1,7 +1,8 @@ export declare enum ExitStatus { - SURVIVED = 0, - KILLED = 1, - LEFT = 2, - RUNNER = 3, - MISSINGINACTION = 4 + SURVIVED = "Survived", + KILLED = "Killed", + LEFT = "Left", + RUNNER = "Runner", + MISSINGINACTION = "MissingInAction", + TRANSIT = "Transit" } diff --git a/types/models/enums/ItemEventActions.d.ts b/types/models/enums/ItemEventActions.d.ts index f8a8b5a..3541ae8 100644 --- a/types/models/enums/ItemEventActions.d.ts +++ b/types/models/enums/ItemEventActions.d.ts @@ -25,5 +25,6 @@ export declare enum ItemEventActions { REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", REDEEM_PROFILE_REWARD = "RedeemProfileReward", SET_FAVORITE_ITEMS = "SetFavoriteItems", - QUEST_FAIL = "QuestFail" + QUEST_FAIL = "QuestFail", + PIN_LOCK = "PinLock" } diff --git a/types/models/enums/Season.d.ts b/types/models/enums/Season.d.ts index b1d3662..aae50b9 100644 --- a/types/models/enums/Season.d.ts +++ b/types/models/enums/Season.d.ts @@ -3,5 +3,7 @@ export declare enum Season { AUTUMN = 1, WINTER = 2, SPRING = 3, - STORM = 4 + AUTUMN_LATE = 4, + SPRING_EARLY = 5, + STORM = 6 } diff --git a/types/models/enums/SeasonalEventType.d.ts b/types/models/enums/SeasonalEventType.d.ts index cfea1f5..5e67118 100644 --- a/types/models/enums/SeasonalEventType.d.ts +++ b/types/models/enums/SeasonalEventType.d.ts @@ -4,5 +4,5 @@ export declare enum SeasonalEventType { HALLOWEEN = "Halloween", NEW_YEARS = "NewYears", PROMO = "Promo", - SNOW = "Snow" + APRIL_FOOLS = "AprilFools" } diff --git a/types/models/enums/WildSpawnTypeNumber.d.ts b/types/models/enums/WildSpawnTypeNumber.d.ts index ab823cc..d93c13b 100644 --- a/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/types/models/enums/WildSpawnTypeNumber.d.ts @@ -54,5 +54,10 @@ export declare enum WildSpawnTypeNumber { SKIER = 53, SECTANTPREDVESTNIK = 57, SECTANTPRIZRAK = 58, - SECTANTONI = 59 + SECTANTONI = 59, + INFECTEDASSAULT = 60, + INFECTEDPMC = 61, + INFECTEDCIVIL = 62, + INFECTEDLABORANT = 63, + INFECTEDTAGILLA = 64 } diff --git a/types/models/spt/bots/IModToSpawnRequest.d.ts b/types/models/spt/bots/IModToSpawnRequest.d.ts index b34bda8..c004664 100644 --- a/types/models/spt/bots/IModToSpawnRequest.d.ts +++ b/types/models/spt/bots/IModToSpawnRequest.d.ts @@ -2,12 +2,13 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { IBotData, IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; -import { IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; +import { IEquipmentFilterDetails, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; export interface IModToSpawnRequest { /** Slot mod will fit into */ modSlot: string; /** Will generate a randomised mod pool if true */ isRandomisableSlot: boolean; + randomisationSettings: IRandomisationDetails; /** Parent slot the item will be a part of */ botWeaponSightWhitelist: Record; /** Blacklist to prevent mods from being picked */ diff --git a/types/models/spt/config/IBotConfig.d.ts b/types/models/spt/config/IBotConfig.d.ts index 51a82b3..92f7b34 100644 --- a/types/models/spt/config/IBotConfig.d.ts +++ b/types/models/spt/config/IBotConfig.d.ts @@ -160,6 +160,8 @@ export interface IRandomisationDetails { /** Equipment mod chances */ equipmentMods?: Record; nighttimeChanges?: INighttimeChanges; + /** Key = weapon tpl, value = min size of magaizne allowed */ + minimumMagazineSize?: Record; } export interface INighttimeChanges { /** Applies changes to values stored in equipmentMods */ @@ -169,9 +171,11 @@ export interface IEquipmentFilterDetails { /** Between what levels do these equipment filter setting apply to */ levelRange: MinMax; /** Key: mod slot name e.g. mod_magazine, value: item tpls */ - equipment: Record; + equipment?: Record; + /** Key: equipment slot name e.g. FirstPrimaryWeapon, value: item tpls */ + gear?: Record; /** Key: cartridge type e.g. Caliber23x75, value: item tpls */ - cartridge: Record; + cartridge?: Record; } export interface IWeightingAdjustmentDetails { /** Between what levels do these weight settings apply to */ diff --git a/types/models/spt/config/ICoreConfig.d.ts b/types/models/spt/config/ICoreConfig.d.ts index 39c4f18..d35cc7d 100644 --- a/types/models/spt/config/ICoreConfig.d.ts +++ b/types/models/spt/config/ICoreConfig.d.ts @@ -1,3 +1,4 @@ +import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ICoreConfig extends IBaseConfig { kind: "spt-core"; @@ -11,6 +12,7 @@ export interface ICoreConfig extends IBaseConfig { bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; + survey: ISurveyResponseData; features: IServerFeatures; /** Commit hash build server was created from */ commit?: string; @@ -71,6 +73,7 @@ export interface IChatbotFeatures { commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; commandUseLimits: Record; + ids: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/types/models/spt/config/IInsuranceConfig.d.ts b/types/models/spt/config/IInsuranceConfig.d.ts index 6c90fe0..fd15e94 100644 --- a/types/models/spt/config/IInsuranceConfig.d.ts +++ b/types/models/spt/config/IInsuranceConfig.d.ts @@ -7,8 +7,10 @@ export interface IInsuranceConfig extends IBaseConfig { blacklistedEquipment: string[]; /** Some slots should always be removed, e.g. 'cartridges' */ slotIdsToAlwaysRemove: string[]; - /** Override to control how quickly insurance is processed/returned in second */ + /** Override to control how quickly insurance is processed/returned in seconds */ returnTimeOverrideSeconds: number; + /** Override to control how long insurance returns stay in mail before expiring - in seconds */ + storageTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; minAttachmentRoublePriceToBeTaken: number; diff --git a/types/models/spt/config/IItemConfig.d.ts b/types/models/spt/config/IItemConfig.d.ts index b9dfaea..a8833bf 100644 --- a/types/models/spt/config/IItemConfig.d.ts +++ b/types/models/spt/config/IItemConfig.d.ts @@ -9,5 +9,11 @@ export interface IItemConfig extends IBaseConfig { rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ bossItems: string[]; - handbookPriceOverride: Record; + handbookPriceOverride: Record; +} +export interface IHandbookPriceOverride { + /** Price in roubles */ + price: number; + /** NOT parentId from items.json, but handbook.json */ + parentId: string; } diff --git a/types/models/spt/config/ILocationConfig.d.ts b/types/models/spt/config/ILocationConfig.d.ts index 55123d6..cbccd20 100644 --- a/types/models/spt/config/ILocationConfig.d.ts +++ b/types/models/spt/config/ILocationConfig.d.ts @@ -3,8 +3,6 @@ import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase" import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "spt-location"; - /** Waves with a min/max of the same value don't spawn any bots, bsg only spawn the difference between min and max */ - fixEmptyBotWavesSettings: IFixEmptyBotWavesSettings; /** Rogues are classified as bosses and spawn immediatly, this can result in no scavs spawning, delay rogues spawning to allow scavs to spawn first */ rogueLighthouseSpawnTimeSettings: IRogueLighthouseSpawnTimeSettings; /** When a map has hit max alive bots, any wave that should spawn will be reduced to 1 bot in size and placed in a spawn queue, this splits waves into smaller sizes to reduce the impact of this behaviour */ @@ -44,6 +42,14 @@ export interface ILocationConfig extends IBaseConfig { scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; + /** min percentage to set raider spawns at, -1 makes no changes */ + reserveRaiderSpawnChanceOverrides: IReserveRaiderSpawnChanceOverrides; + /** Map ids players cannot visit */ + nonMaps: string[]; +} +export interface IReserveRaiderSpawnChanceOverrides { + nonTriggered: number; + triggered: number; } export interface IEquipmentLootSettings { modSpawnChancePercent: Record; diff --git a/types/models/spt/config/IQuestConfig.d.ts b/types/models/spt/config/IQuestConfig.d.ts index e4e76eb..19bb3aa 100644 --- a/types/models/spt/config/IQuestConfig.d.ts +++ b/types/models/spt/config/IQuestConfig.d.ts @@ -15,7 +15,7 @@ export interface IQuestConfig extends IBaseConfig { usecOnlyQuests: string[]; /** Quests that the keyed game version do not see/access */ profileBlacklist: Record; - /** Quests that only the keyed game version can see/access */ + /** key=questid, gameversions that can see/access quest */ profileWhitelist: Record; } export interface IPlayerTypeQuestIds { diff --git a/types/models/spt/config/IRagfairConfig.d.ts b/types/models/spt/config/IRagfairConfig.d.ts index 9b17861..36122c5 100644 --- a/types/models/spt/config/IRagfairConfig.d.ts +++ b/types/models/spt/config/IRagfairConfig.d.ts @@ -50,6 +50,8 @@ export interface IDynamic { priceRanges: IPriceRanges; /** Should default presets to listed only or should non-standard presets found in globals.json be listed too */ showDefaultPresetsOnly: boolean; + /** Tpls that should not use the variable price system when their quality is < 100% (lower dura/uses = lower price) */ + ignoreQualityPriceVarianceBlacklist: string[]; endTimeSeconds: MinMax; /** Settings to control the durability range of item items listed on flea */ condition: Condition; @@ -90,6 +92,8 @@ export interface IBarterDetails { priceRangeVariancePercent: number; /** Min rouble price for an offer to be considered for turning into a barter */ minRoubleCostToBecomeBarter: number; + /** Should barter offers only single stack */ + makeSingleStackOnly: boolean; /** Item Tpls to never be turned into a barter */ itemTypeBlacklist: string[]; } diff --git a/types/models/spt/config/ISeasonalEventConfig.d.ts b/types/models/spt/config/ISeasonalEventConfig.d.ts index 1280bc5..5e119fa 100644 --- a/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -1,4 +1,4 @@ -import { IBossLocationSpawn } from "@spt/models/eft/common/ILocationBase"; +import { IAdditionalHostilitySettings, IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ISeasonalEventConfig extends IBaseConfig { @@ -9,15 +9,26 @@ export interface ISeasonalEventConfig extends IBaseConfig { events: ISeasonalEvent[]; eventBotMapping: Record; eventBossSpawns: Record>; + eventWaves: Record>; gifterSettings: IGifterSetting[]; + /** key = event, second key = map name */ + hostilitySettingsForEvent: Record>; } export interface ISeasonalEvent { + enabled: boolean; name: string; type: SeasonalEventType; startDay: number; startMonth: number; endDay: number; endMonth: number; + settings?: Record; +} +export interface IZombieSettings { + enabled: boolean; + mapInfectionAmount: Record; + disableBosses: string[]; + disableWaves: string[]; } export interface IGifterSetting { map: string; diff --git a/types/models/spt/config/ITraderConfig.d.ts b/types/models/spt/config/ITraderConfig.d.ts index 31a213b..5d2d4a6 100644 --- a/types/models/spt/config/ITraderConfig.d.ts +++ b/types/models/spt/config/ITraderConfig.d.ts @@ -47,6 +47,10 @@ export interface IFenceConfig { blacklist: string[]; coopExtractGift: ICoopExtractReward; btrDeliveryExpireHours: number; + /** Smallest value player rep with fence can fall to */ + playerRepMin: number; + /** Highest value player rep with fence can climb to */ + playerRepMax: number; } export interface IItemDurabilityCurrentMax { current: MinMax; diff --git a/types/routers/ImageRouter.d.ts b/types/routers/ImageRouter.d.ts index ca9afad..cd29c81 100644 --- a/types/routers/ImageRouter.d.ts +++ b/types/routers/ImageRouter.d.ts @@ -8,6 +8,6 @@ export declare class ImageRouter { protected httpFileUtil: HttpFileUtil; constructor(vfs: VFS, imageRouteService: ImageRouteService, httpFileUtil: HttpFileUtil); addRoute(key: string, valueToAdd: string): void; - sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; getImage(): string; } diff --git a/types/routers/serializers/BundleSerializer.d.ts b/types/routers/serializers/BundleSerializer.d.ts index 91332ff..93e647d 100644 --- a/types/routers/serializers/BundleSerializer.d.ts +++ b/types/routers/serializers/BundleSerializer.d.ts @@ -8,6 +8,6 @@ export declare class BundleSerializer extends Serializer { protected bundleLoader: BundleLoader; protected httpFileUtil: HttpFileUtil; constructor(logger: ILogger, bundleLoader: BundleLoader, httpFileUtil: HttpFileUtil); - serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; canHandle(route: string): boolean; } diff --git a/types/routers/serializers/ImageSerializer.d.ts b/types/routers/serializers/ImageSerializer.d.ts index 92f06e3..84430c7 100644 --- a/types/routers/serializers/ImageSerializer.d.ts +++ b/types/routers/serializers/ImageSerializer.d.ts @@ -4,6 +4,6 @@ import { ImageRouter } from "@spt/routers/ImageRouter"; export declare class ImageSerializer extends Serializer { protected imageRouter: ImageRouter; constructor(imageRouter: ImageRouter); - serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; canHandle(route: string): boolean; } diff --git a/types/routers/serializers/NotifySerializer.d.ts b/types/routers/serializers/NotifySerializer.d.ts index 4e1f28d..20d9095 100644 --- a/types/routers/serializers/NotifySerializer.d.ts +++ b/types/routers/serializers/NotifySerializer.d.ts @@ -8,6 +8,6 @@ export declare class NotifySerializer extends Serializer { protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); - serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; + serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): Promise; canHandle(route: string): boolean; } diff --git a/types/servers/http/SptHttpListener.d.ts b/types/servers/http/SptHttpListener.d.ts index 9311f82..64d4f04 100644 --- a/types/servers/http/SptHttpListener.d.ts +++ b/types/servers/http/SptHttpListener.d.ts @@ -26,7 +26,7 @@ export declare class SptHttpListener implements IHttpListener { * @param body Buffer * @param output Server generated response data */ - sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; + sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): Promise; /** * Is request flagged as debug enabled * @param req Incoming request @@ -42,5 +42,5 @@ export declare class SptHttpListener implements IHttpListener { getResponse(sessionID: string, req: IncomingMessage, body: Buffer): Promise; protected getBodyInfo(body: Buffer, requestUrl?: any): any; sendJson(resp: ServerResponse, output: string, sessionID: string): void; - sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void; + sendZlibJson(resp: ServerResponse, output: string, sessionID: string): Promise; } diff --git a/types/services/InsuranceService.d.ts b/types/services/InsuranceService.d.ts index 8b7b1b3..ac9cff5 100644 --- a/types/services/InsuranceService.d.ts +++ b/types/services/InsuranceService.d.ts @@ -70,6 +70,7 @@ export declare class InsuranceService { * @returns void */ protected adoptOrphanedInsEquipment(sessionID: string): void; + protected getMaxInsuranceStorageTime(traderBase: ITraderBase): number; /** * Store lost gear post-raid inside profile, ready for later code to pick it up and mail it * @param equipmentPkg Gear to store - generated by getGearLostInRaid() diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index ba90302..53b83e8 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -5,6 +5,7 @@ import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; import { HealthHelper } from "@spt/helpers/HealthHelper"; import { InRaidHelper } from "@spt/helpers/InRaidHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; @@ -46,6 +47,7 @@ export declare class LocationLifecycleService { protected databaseService: DatabaseService; protected inRaidHelper: InRaidHelper; protected healthHelper: HealthHelper; + protected questHelper: QuestHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected pmcChatResponseService: PmcChatResponseService; protected playerScavGenerator: PlayerScavGenerator; @@ -68,7 +70,7 @@ export declare class LocationLifecycleService { protected hideoutConfig: IHideoutConfig; protected locationConfig: ILocationConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, botNameService: BotNameService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, questHelper: QuestHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, botNameService: BotNameService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); /** Handle client/match/local/start */ startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData; /** @@ -139,10 +141,21 @@ export declare class LocationLifecycleService { * @param locationName */ protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, isSurvived: boolean, isTransfer: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + /** + * In 0.15 Lightkeeper quests do not give rewards in PvE, this issue also occurs in spt + * We check for newly completed Lk quests and run them through the servers `CompleteQuest` process + * This rewards players with items + craft unlocks + new trader assorts + * @param sessionId Session id + * @param postRaidQuests Quest statuses post-raid + * @param preRaidQuests Quest statuses pre-raid + * @param pmcProfile Players profile + */ + protected lightkeeperQuestWorkaround(sessionId: string, postRaidQuests: IQuestStatus[], preRaidQuests: IQuestStatus[], pmcProfile: IPmcData): void; /** * Convert post-raid quests into correct format * Quest status comes back as a string version of the enum `Success`, not the expected value of 1 - * @param questsToProcess + * @param questsToProcess quests data from client + * @param preRaidQuestStatuses quest data from before raid * @returns IQuestStatus */ protected processPostRaidQuests(questsToProcess: IQuestStatus[]): IQuestStatus[]; diff --git a/types/services/PaymentService.d.ts b/types/services/PaymentService.d.ts index 51fced1..f6ec79d 100644 --- a/types/services/PaymentService.d.ts +++ b/types/services/PaymentService.d.ts @@ -60,8 +60,9 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** + * TODO - ensure money in containers inside secure container are LAST * Get all money stacks in inventory and prioritise items in stash - * @param pmcData + * @param pmcData Player profile * @param currencyTpl * @param playerStashId Players stash id * @returns Sorting money items diff --git a/types/services/PmcChatResponseService.d.ts b/types/services/PmcChatResponseService.d.ts index f44b12d..d1df249 100644 --- a/types/services/PmcChatResponseService.d.ts +++ b/types/services/PmcChatResponseService.d.ts @@ -8,6 +8,7 @@ import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { GiftService } from "@spt/services/GiftService"; +import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -19,12 +20,13 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected localeService: LocaleService; protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; protected giftConfig: IGiftsConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, localeService: LocaleService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id @@ -43,9 +45,17 @@ export declare class PmcChatResponseService { * Choose a localised message to send the player (different if sender was killed or killed player) * @param isVictim Is the message coming from a bot killed by the player * @param pmcData Player profile + * @param victimData OPTIMAL - details of the pmc killed * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData, victimData?: IVictim): string | undefined; + /** + * use map key to get a localised location name + * e.g. factory4_day becomes "Factory" + * @param locationKey location key to localise + * @returns Localised location name + */ + protected getLocationName(locationKey: string): string; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player @@ -63,7 +73,7 @@ export declare class PmcChatResponseService { * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendSuffixToMessageEnd(isVictim: boolean): boolean; + protected appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player diff --git a/types/services/PostDbLoadService.d.ts b/types/services/PostDbLoadService.d.ts new file mode 100644 index 0000000..c9e4bbe --- /dev/null +++ b/types/services/PostDbLoadService.d.ts @@ -0,0 +1,77 @@ +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; +import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { ILootConfig } from "@spt/models/spt/config/ILootConfig"; +import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; +import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { OpenZoneService } from "@spt/services/OpenZoneService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class PostDbLoadService { + protected logger: ILogger; + protected databaseService: DatabaseService; + protected localisationService: LocalisationService; + protected customLocationWaveService: CustomLocationWaveService; + protected openZoneService: OpenZoneService; + protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; + protected configServer: ConfigServer; + protected cloner: ICloner; + protected coreConfig: ICoreConfig; + protected locationConfig: ILocationConfig; + protected ragfairConfig: IRagfairConfig; + protected hideoutConfig: IHideoutConfig; + protected pmcConfig: IPmcConfig; + protected lootConfig: ILootConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseService: DatabaseService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, configServer: ConfigServer, cloner: ICloner); + performPostDbLoadActions(): void; + protected adjustMinReserveRaiderSpawnChance(): void; + protected addCustomLooseLootPositions(): void; + /** + * BSG have two values for shotgun dispersion, we make sure both have the same value + */ + protected fixShotgunDispersions(): void; + /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ + protected adjustMapBotLimits(): void; + protected adjustLooseLootSpawnProbabilities(): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; + protected adjustLocationBotValues(): void; + /** + * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions + */ + protected fixRoguesSpawningInstantlyOnLighthouse(): void; + /** + * Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these + * waves to one bot when they're waiting to spawn for too long + */ + protected splitBotWavesIntoSingleWaves(): void; + /** + * Make non-trigger-spawned raiders spawn earlier + always + */ + protected adjustLabsRaiderSpawnRate(): void; + protected adjustHideoutCraftTimes(overrideSeconds: number): void; + /** + * Adjust all hideout craft times to be no higher than the override + */ + protected adjustHideoutBuildTimes(overrideSeconds: number): void; + /** + * Blank out the "test" mail message from prapor + */ + protected removePraporTestMessage(): void; + /** + * Check for any missing assorts inside each traders assort.json data, checking against traders questassort.json + */ + protected validateQuestAssortUnlocksExist(): void; + protected setAllDbItemsAsSellableOnFlea(): void; +} diff --git a/types/services/SeasonalEventService.d.ts b/types/services/SeasonalEventService.d.ts index 281bf99..7ce39dc 100644 --- a/types/services/SeasonalEventService.d.ts +++ b/types/services/SeasonalEventService.d.ts @@ -1,12 +1,14 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IConfig } from "@spt/models/eft/common/IGlobals"; +import { IAdditionalHostilitySettings } from "@spt/models/eft/common/ILocationBase"; import { IInventory } from "@spt/models/eft/common/tables/IBotType"; import { Season } from "@spt/models/enums/Season"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; -import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISeasonalEventConfig"; +import { ISeasonalEvent, ISeasonalEventConfig, IZombieSettings } from "@spt/models/spt/config/ISeasonalEventConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -27,10 +29,11 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; + protected locationConfig: ILocationConfig; protected halloweenEventActive?: boolean; protected christmasEventActive?: boolean; /** All events active at this point in time */ - protected currentlyActiveEvents: SeasonalEventType[]; + protected currentlyActiveEvents: ISeasonalEvent[]; constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; @@ -98,11 +101,18 @@ export declare class SeasonalEventService { */ isQuestRelatedToEvent(questId: string, event: SeasonalEventType): boolean; /** - * Handle seasonal events - * @param sessionId Players id + * Handle activating seasonal events + */ + enableSeasonalEvents(): void; + forceSeasonalEvent(eventType: SeasonalEventType): boolean; + /** + * Store active events inside class array property `currentlyActiveEvents` + set class properties: christmasEventActive/halloweenEventActive */ - enableSeasonalEvents(sessionId: string): void; protected cacheActiveEvents(): void; + /** + * Get the currently active weather season e.g. SUMMER/AUTUMN/WINTER + * @returns Season enum value + */ getActiveWeatherSeason(): Season; /** * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService) @@ -112,11 +122,13 @@ export declare class SeasonalEventService { removeChristmasItemsFromBotInventory(botInventory: IInventory, botRole: string): void; /** * Make adjusted to server code based on the name of the event passed in - * @param sessionId Player id * @param globalConfig globals.json * @param eventName Name of the event to enable. e.g. Christmas */ - protected updateGlobalEvents(sessionId: string, globalConfig: IConfig, eventType: SeasonalEventType): void; + protected updateGlobalEvents(globalConfig: IConfig, event: ISeasonalEvent): void; + protected replaceBotHostility(hostilitySettings: Record): void; + protected removeEntryRequirement(locationIds: string[]): void; + givePlayerSeasonalGifts(sessionId: string): void; /** * Force zryachiy to always have a melee weapon */ @@ -125,11 +137,14 @@ export declare class SeasonalEventService { * Enable the halloween zryachiy summon event */ protected enableHalloweenSummonEvent(): void; + protected configureZombies(zombieSettings: IZombieSettings): void; + protected addEventWavesToMaps(eventType: string): void; /** * Add event bosses to maps * @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS + * @param mapWhitelist OPTIONAL - Maps to add bosses to */ - protected addEventBossesToMaps(eventType: SeasonalEventType): void; + protected addEventBossesToMaps(eventType: string, mapIdWhitelist?: string[]): void; /** * Change trader icons to be more event themed (Halloween only so far) * @param eventType What event is active @@ -148,6 +163,7 @@ export declare class SeasonalEventService { * Add pumpkin loot boxes to scavs */ protected addPumpkinsToScavBackpacks(): void; + protected renameBitcoin(): void; /** * Set Khorovod(dancing tree) chance to 100% on all maps that support it */ @@ -156,6 +172,7 @@ export declare class SeasonalEventService { * Add santa to maps */ protected addGifterBotToMaps(): void; + protected handleModEvent(event: ISeasonalEvent): void; /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to diff --git a/types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts b/types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts new file mode 100644 index 0000000..960f8ae --- /dev/null +++ b/types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts @@ -0,0 +1,16 @@ +import { OnLoad } from "@spt/di/OnLoad"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +export declare class ProductionQuestsGen { + protected databaseServer: DatabaseServer; + protected logger: ILogger; + protected onLoadComponents: OnLoad[]; + private questProductionOutputList; + private questProductionMap; + private blacklistedProductions; + constructor(databaseServer: DatabaseServer, logger: ILogger, onLoadComponents: OnLoad[]); + run(): Promise; + private updateProductionQuests; + private isValidQuestProduction; + private buildQuestProductionList; +} diff --git a/types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts b/types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts new file mode 100644 index 0000000..5663738 --- /dev/null +++ b/types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts @@ -0,0 +1,7 @@ +import "reflect-metadata"; +import "source-map-support/register"; +export declare class ProductionQuestsGenProgram { + private errorHandler; + constructor(); + start(): Promise; +} diff --git a/types/utils/HttpFileUtil.d.ts b/types/utils/HttpFileUtil.d.ts index 57f21c8..9569f81 100644 --- a/types/utils/HttpFileUtil.d.ts +++ b/types/utils/HttpFileUtil.d.ts @@ -3,5 +3,5 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; export declare class HttpFileUtil { protected httpServerHelper: HttpServerHelper; constructor(httpServerHelper: HttpServerHelper); - sendFile(resp: ServerResponse, filePath: string): void; + sendFileAsync(resp: ServerResponse, filePath: string): Promise; } From 7ada3d8769a2e1aeac7ebcea787784799da0e683 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 20 Nov 2024 14:03:19 +0100 Subject: [PATCH 15/23] Move mod over to a DI system --- src/LotsofLoot.ts | 42 + src/LotsofLootLogger.ts | 37 - src/controllers/LotsofLootController.ts | 319 +++++++ .../LotsofLootMarkedRoomController.ts} | 67 +- src/di/Container.ts | 24 + src/{ => helpers}/LotsofLootHelper.ts | 31 +- src/mod.ts | 808 +----------------- .../LocationLootGeneratorOverrides.ts | 478 +++++++++++ src/utils/LotsofLootConfig.ts | 25 + src/utils/LotsofLootLogger.ts | 57 ++ 10 files changed, 1009 insertions(+), 879 deletions(-) create mode 100644 src/LotsofLoot.ts delete mode 100644 src/LotsofLootLogger.ts create mode 100644 src/controllers/LotsofLootController.ts rename src/{MarkedRoom.ts => controllers/LotsofLootMarkedRoomController.ts} (65%) create mode 100644 src/di/Container.ts rename src/{ => helpers}/LotsofLootHelper.ts (75%) create mode 100644 src/overrides/LocationLootGeneratorOverrides.ts create mode 100644 src/utils/LotsofLootConfig.ts create mode 100644 src/utils/LotsofLootLogger.ts diff --git a/src/LotsofLoot.ts b/src/LotsofLoot.ts new file mode 100644 index 0000000..972f981 --- /dev/null +++ b/src/LotsofLoot.ts @@ -0,0 +1,42 @@ +import { DependencyContainer, inject, injectable } from "tsyringe"; + +import { LocationLootGeneratorOverrides } from "./overrides/LocationLootGeneratorOverrides"; +import { LotsofLootLogger } from "./utils/LotsofLootLogger"; +import { LotsofLootController } from "./controllers/LotsofLootController"; +import { LotsofLootMarkedRoomController } from "./controllers/LotsofLootMarkedRoomController"; +import { LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; + +@injectable() +export class LotsofLoot { + constructor( + @inject("LocationLootGeneratorOverrides") protected locationLootGeneratorOverrides: LocationLootGeneratorOverrides, + @inject("LotsofLootController") protected lotsofLootController: LotsofLootController, + @inject("LotsofLootMarkedRoomController") protected lotsofLootMarkedRoomController: LotsofLootMarkedRoomController, + @inject("LotsofLootLogger") protected logger: LotsofLootLogger, + ) { + } + + public async preSptLoadAsync(container: DependencyContainer): Promise { + container.afterResolution( + "LocationLootGenerator", + (_t, result: LocationLootGenerator) => { + //Temporary cast to get rid of protected error + (result as any).createStaticLootItem = (tpl, staticAmmoDist, parentId) => { + return this.locationLootGeneratorOverrides.createStaticLootItem(tpl, staticAmmoDist, parentId); + }; + + result.generateDynamicLoot = (dynamicLootDist, staticAmmoDist, locationName) => { + return this.locationLootGeneratorOverrides.generateDynamicLoot(dynamicLootDist, staticAmmoDist, locationName); + }; + }, + { frequency: "Always" }, + ); + } + + public async postDBLoadAsync(_container: DependencyContainer): Promise { + this.lotsofLootController.applyLotsOfLootModifications(); + this.lotsofLootMarkedRoomController.adjustMarkedRoomItems(); + + this.logger.logInfo(`Finished loading`); + } +} \ No newline at end of file diff --git a/src/LotsofLootLogger.ts b/src/LotsofLootLogger.ts deleted file mode 100644 index 7c1125b..0000000 --- a/src/LotsofLootLogger.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; - -export class LotsofLootLogger { - constructor( - private logger: ILogger, - private debugEnabled: boolean, - ) {} - - private loggerPrefix = "[Lots of Loot] "; - - public logInfo(log: string): void { - this.logger.info(this.loggerPrefix + log); - } - - public warning(log: string): void { - this.logWarning(log); - } - - protected logWarning(log: string): void { - this.logger.warning(this.loggerPrefix + log); - } - - public logError(log: string): void { - this.logger.error(this.loggerPrefix + log); - } - - public debug(log: string): void { - this.logDebug(log); - } - - protected logDebug(log: string): void { - if (this.debugEnabled) { - this.logger.logWithColor(this.loggerPrefix + log, LogTextColor.YELLOW); - } - } -} diff --git a/src/controllers/LotsofLootController.ts b/src/controllers/LotsofLootController.ts new file mode 100644 index 0000000..7365e0f --- /dev/null +++ b/src/controllers/LotsofLootController.ts @@ -0,0 +1,319 @@ +import { inject, injectable } from "tsyringe"; + +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; +import { ILocation } from "@spt/models/eft/common/ILocation"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { ISpawnpoint } from "@spt/models/eft/common/ILooseLoot"; +import { BaseClasses } from "@spt/models/enums/BaseClasses"; +import { ICloner } from "@spt/utils/cloners/ICloner"; + +import { LotsofLootLogger } from "../utils/LotsofLootLogger"; +import { LotsofLootHelper } from "../helpers/LotsofLootHelper"; +import { LotsofLootConfig } from "../utils/LotsofLootConfig"; + + +@injectable() +export class LotsofLootController { + constructor( + @inject("ConfigServer") protected configServer: ConfigServer, + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("LotsofLootLogger") protected logger: LotsofLootLogger, + @inject("LotsofLootConfig") protected config: LotsofLootConfig, + @inject("LotsofLootHelper") protected lotsofLootHelper: LotsofLootHelper, + @inject("ItemHelper") protected itemHelper: ItemHelper, + @inject("HashUtil") protected hashUtil: HashUtil, + @inject("PrimaryCloner") protected cloner: ICloner + ) { + } + + public applyLotsOfLootModifications(): void { + const lotsofLootConfig = this.config.getConfig(); + const tables = this.databaseService.getTables(); + const locations = tables.locations; + const LocationConfig = this.configServer.getConfig(ConfigTypes.LOCATION) + + this.addToRustedKeyRoom(); + + if(this.config.getConfig().general.removeBackpackRestrictions) + { + this.lotsofLootHelper.removeBackpackRestrictions(); + } + + for (const map in lotsofLootConfig.looseLootMultiplier) { + LocationConfig.looseLootMultiplier[map] = lotsofLootConfig.looseLootMultiplier[map]; + this.logger.debug(`${map}: ${LocationConfig.looseLootMultiplier[map]}`); + LocationConfig.staticLootMultiplier[map] = lotsofLootConfig.staticLootMultiplier[map]; + this.logger.debug(`${map}: ${LocationConfig.staticLootMultiplier[map]}`); + } + + for (const locationId in locations) { + if (locations.hasOwnProperty(locationId)) { + const location: ILocation = locations[locationId]; + //Location does not have any static loot pools, skip this map. + if (!location.staticLoot) { + this.logger.debug(`Skipping ${locationId} as it has no static loot`); + + continue; + } + + const staticLoot = location.staticLoot; + + for (const container in staticLoot) { + for (const possItemCount in staticLoot[container].itemcountDistribution) { + if (staticLoot[container].itemcountDistribution[possItemCount].count == 0) { + staticLoot[container].itemcountDistribution[possItemCount].relativeProbability = Math.round(staticLoot[container].itemcountDistribution[possItemCount].relativeProbability * lotsofLootConfig.containers[container]); + + this.logger.debug(`Changed container ${container} chance to ${staticLoot[container].itemcountDistribution[possItemCount].relativeProbability}`); + } + } + } + } + } + + for (const itemId in lotsofLootConfig.changeRelativeProbabilityInPool) { + this.lotsofLootHelper.changeRelativeProbabilityInPool(itemId, lotsofLootConfig.changeRelativeProbabilityInPool[itemId]); + } + + for (const itemId in lotsofLootConfig.changeProbabilityOfPool) { + this.lotsofLootHelper.changeProbabilityOfPool(itemId, lotsofLootConfig.changeProbabilityOfPool[itemId]); + } + + if (lotsofLootConfig.general.disableFleaRestrictions) { + for (const item in tables.templates.items) { + if (this.itemHelper.isValidItem(tables.templates.items[item]._id)) { + tables.templates.items[item]._props.CanRequireOnRagfair = true; + tables.templates.items[item]._props.CanSellOnRagfair = true; + } + } + } + + for (const id in lotsofLootConfig.general.priceCorrection) { + tables.templates.prices[id] = lotsofLootConfig.general.priceCorrection[id]; + } + } + + private addToRustedKeyRoom(): void { + const streetsloot = this.databaseService.getTables().locations.tarkovstreets.looseLoot; + const items = this.databaseService.getTables().templates.items; + let keys: string[] = []; + let valuables: string[] = []; + + for (const item in items) { + if (this.config.getConfig().general.rustedKeyRoomIncludesKeycards) { + if (this.itemHelper.isOfBaseclass(item, BaseClasses.KEY)) { + keys.push(item); + } + } else { + if (this.itemHelper.isOfBaseclass(item, BaseClasses.KEY_MECHANICAL)) { + keys.push(item); + } + } + if (this.itemHelper.isOfBaseclass(item, BaseClasses.JEWELRY)) { + valuables.push(item); + } + } + let point: ISpawnpoint = { + locationId: "(185.087, 6.554, 63.721)", + probability: 0.25, + template: { + Id: "Keys1", + IsContainer: false, + useGravity: true, + randomRotation: true, + Position: { + x: 185.087, + y: 6.554, + z: 63.721, + }, + Rotation: { + x: 0, + y: 0, + z: 0, + }, + IsGroupPosition: false, + GroupPositions: [], + IsAlwaysSpawn: false, + Root: this.hashUtil.generate(), + Items: [], + }, + itemDistribution: [], + }; + for (let i = 0; i < keys.length; i++) { + point.template.Items.push({ + _id: i.toString(), + _tpl: keys[i], + }); + point.itemDistribution.push({ + composedKey: { key: i.toString() }, + relativeProbability: 1, + }); + } + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys2"; + point.template.Position = { + x: 185.125, + y: 6.554, + z: 63.186, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys3"; + point.template.Position = { + x: 185.164, + y: 6.554, + z: 62.241, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys4"; + point.template.Position = { + x: 185.154, + y: 6.554, + z: 62.686, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys5"; + point.template.Position = { + x: 185.21, + y: 6.935, + z: 60.86, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys6"; + point.template.Position = { + x: 185.205, + y: 6.935, + z: 60.56, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys7"; + point.template.Position = { + x: 185.208, + y: 6.58, + z: 60.857, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys8"; + point.template.Position = { + x: 185.211, + y: 6.562, + z: 60.562, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys9"; + point.template.Position = { + x: 185.202, + y: 6.175, + z: 60.551, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys10"; + point.template.Position = { + x: 185.2, + y: 6.234, + z: 60.872, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys11"; + point.template.Position = { + x: 182.683, + y: 6.721, + z: 57.813, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Keys12"; + point.template.Position = { + x: 182.683, + y: 6.721, + z: 60.073, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Val1"; + point.template.Position = { + x: 185.037, + y: 5.831, + z: 53.836, + }; + point.template.Items = []; + point.itemDistribution = []; + for (let i = 0; i < valuables.length; i++) { + point.template.Items.push({ + _id: i.toString(), + _tpl: valuables[i], + }); + point.itemDistribution.push({ + composedKey: { key: i.toString() }, + relativeProbability: 1, + }); + } + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Val2"; + point.template.Position = { + x: 183.064, + y: 5.831, + z: 53.767, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Val3"; + point.template.Position = { + x: 185.146, + y: 5.831, + z: 60.114, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + + point.template.Root = this.hashUtil.generate(); + point.template.Id = "Val4"; + point.template.Position = { + x: 185.085, + y: 5.831, + z: 65.393, + }; + point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); + streetsloot.spawnpoints.push(this.cloner.clone(point)); + } +} diff --git a/src/MarkedRoom.ts b/src/controllers/LotsofLootMarkedRoomController.ts similarity index 65% rename from src/MarkedRoom.ts rename to src/controllers/LotsofLootMarkedRoomController.ts index 73e534d..12dc1f4 100644 --- a/src/MarkedRoom.ts +++ b/src/controllers/LotsofLootMarkedRoomController.ts @@ -1,75 +1,84 @@ +import { inject, injectable } from "tsyringe"; + +import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ISpawnpoint } from "@spt/models/eft/common/ILooseLoot"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { HashUtil } from "@spt/utils/HashUtil"; -import { MarkedRoomConfig } from "./ILotsofLootConfig"; -import { LotsofLootLogger } from "./LotsofLootLogger"; -export class MarkedRoom { +import { LotsofLootLogger } from "../utils/LotsofLootLogger"; +import { LotsofLootHelper } from "../helpers/LotsofLootHelper"; +import { LotsofLootConfig } from "../utils/LotsofLootConfig"; + + +@injectable() +export class LotsofLootMarkedRoomController { constructor( - private markedRoomConfig: MarkedRoomConfig, - private databaseServer: DatabaseServer, - private itemHelper: ItemHelper, - private hashUtil: HashUtil, - private logger: LotsofLootLogger, - ) {} + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("LotsofLootLogger") protected logger: LotsofLootLogger, + @inject("LotsofLootConfig") protected config: LotsofLootConfig, + @inject("LotsofLootHelper") protected lotsofLootHelper: LotsofLootHelper, + @inject("ItemHelper") protected itemHelper: ItemHelper, + @inject("HashUtil") protected hashUtil: HashUtil, + ) { + } - public doMarkedRoomChanges(): void { - const spawnPointscustoms = this.databaseServer.getTables().locations.bigmap.looseLoot.spawnpoints; - const spawnPointsreserve = this.databaseServer.getTables().locations.rezervbase.looseLoot.spawnpoints; - const spawnPointsstreets = this.databaseServer.getTables().locations.tarkovstreets.looseLoot.spawnpoints; - const spawnPointsLighthouse = this.databaseServer.getTables().locations.lighthouse.looseLoot.spawnpoints; + public adjustMarkedRoomItems(): void { + const spawnPointsCustoms = this.databaseService.getTables().locations.bigmap.looseLoot.spawnpoints; + const spawnPointsReserve = this.databaseService.getTables().locations.rezervbase.looseLoot.spawnpoints; + const spawnPointsStreets = this.databaseService.getTables().locations.tarkovstreets.looseLoot.spawnpoints; + const spawnPointsLighthouse = this.databaseService.getTables().locations.lighthouse.looseLoot.spawnpoints; - for (const spawnpoint of spawnPointscustoms) { + for (const spawnpoint of spawnPointsCustoms) { //Dorms 314 Marked Room if (spawnpoint.template.Position.x > 180 && spawnpoint.template.Position.x < 185 && spawnpoint.template.Position.z > 180 && spawnpoint.template.Position.z < 185 && spawnpoint.template.Position.y > 6 && spawnpoint.template.Position.y < 7) { this.logger.debug(`Marked room (Customs) ${spawnpoint.template.Id}`); - spawnpoint.probability *= this.markedRoomConfig.multiplier.customs; + spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.customs; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } } - for (const spawnpoint of spawnPointsreserve) { + for (const spawnpoint of spawnPointsReserve) { if (spawnpoint.template.Position.x > -125 && spawnpoint.template.Position.x < -120 && spawnpoint.template.Position.z > 25 && spawnpoint.template.Position.z < 30 && spawnpoint.template.Position.y > -15 && spawnpoint.template.Position.y < -14) { this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); - spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; + spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } else if (spawnpoint.template.Position.x > -155 && spawnpoint.template.Position.x < -150 && spawnpoint.template.Position.z > 70 && spawnpoint.template.Position.z < 75 && spawnpoint.template.Position.y > -9 && spawnpoint.template.Position.y < -8) { this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); - spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; + spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } else if (spawnpoint.template.Position.x > 190 && spawnpoint.template.Position.x < 195 && spawnpoint.template.Position.z > -230 && spawnpoint.template.Position.z < -225 && spawnpoint.template.Position.y > -6 && spawnpoint.template.Position.y < -5) { this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); - spawnpoint.probability *= this.markedRoomConfig.multiplier.reserve; + spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.reserve; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } } - for (const spawnpoint of spawnPointsstreets) { + for (const spawnpoint of spawnPointsStreets) { //Abandoned Factory Marked Room if (spawnpoint.template.Position.x > -133 && spawnpoint.template.Position.x < -129 && spawnpoint.template.Position.z > 265 && spawnpoint.template.Position.z < 275 && spawnpoint.template.Position.y > 8.5 && spawnpoint.template.Position.y < 11) { this.logger.debug(`Marked room (Streets) ${spawnpoint.template.Id}`); - spawnpoint.probability *= this.markedRoomConfig.multiplier.streets; + spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.streets; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } //Chek 13 Marked Room else if (spawnpoint.template.Position.x > 186 && spawnpoint.template.Position.x < 191 && spawnpoint.template.Position.z > 224 && spawnpoint.template.Position.z < 229 && spawnpoint.template.Position.y > -0.5 && spawnpoint.template.Position.y < 1.5) { this.logger.debug(`Marked room (Streets) ${spawnpoint.template.Id}`); - spawnpoint.probability *= this.markedRoomConfig.multiplier.streets; + spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.streets; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } } for (const spawnpoint of spawnPointsLighthouse) { + //Lightkeeper marked room if (spawnpoint.template.Position.x > 319 && spawnpoint.template.Position.x < 330 && spawnpoint.template.Position.z > 482 && spawnpoint.template.Position.z < 489 && spawnpoint.template.Position.y > 5 && spawnpoint.template.Position.y < 6.5) { this.logger.debug(`Marked room (Lighthouse) ${spawnpoint.template.Id}`); - spawnpoint.probability *= this.markedRoomConfig.multiplier.lighthouse; + spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.lighthouse; this.markedAddExtraItems(spawnpoint); this.markedItemGroups(spawnpoint); } @@ -77,7 +86,7 @@ export class MarkedRoom { } private markedAddExtraItems(spawnpoint: ISpawnpoint): void { - for (const item of Object.entries(this.markedRoomConfig.extraItems)) { + for (const item of Object.entries(this.config.getConfig().markedRoom.extraItems)) { if (spawnpoint.template.Items.find((x) => x._tpl === item[0])) { continue; } @@ -100,11 +109,11 @@ export class MarkedRoom { private markedItemGroups(spawnpoint: ISpawnpoint): void { for (const item of spawnpoint.template.Items) { - for (const group in this.markedRoomConfig.itemGroups) { + for (const group in this.config.getConfig().markedRoom.itemGroups) { if (this.itemHelper.isOfBaseclass(item._tpl, group)) { for (const dist of spawnpoint.itemDistribution) { - if (dist.composedKey.key == item._id) { - dist.relativeProbability *= this.markedRoomConfig.itemGroups[group]; + if (dist.composedKey.key === item._id) { + dist.relativeProbability *= this.config.getConfig().markedRoom.itemGroups[group]; this.logger.debug(`markedItemGroups: Changed ${item._tpl} to ${dist.relativeProbability}`); } } diff --git a/src/di/Container.ts b/src/di/Container.ts new file mode 100644 index 0000000..0ec3e94 --- /dev/null +++ b/src/di/Container.ts @@ -0,0 +1,24 @@ +import { DependencyContainer, Lifecycle } from "tsyringe"; + +import { LotsofLootConfig } from "../utils/LotsofLootConfig"; +import { LotsofLootLogger } from "../utils/LotsofLootLogger"; +import { LotsofLootHelper } from "../helpers/LotsofLootHelper"; +import { LotsofLootController } from "../controllers/LotsofLootController"; +import { LotsofLootMarkedRoomController } from "../controllers/LotsofLootMarkedRoomController"; +import { LocationLootGeneratorOverrides } from "../overrides/LocationLootGeneratorOverrides"; + +import { LotsofLoot } from "../LotsofLoot"; + +export class Container { + public static register(container: DependencyContainer): void { + container.register("LotsofLootConfig", LotsofLootConfig, { lifecycle: Lifecycle.Singleton }); + container.register("LotsofLootLogger", LotsofLootLogger, { lifecycle: Lifecycle.Singleton }); + container.register("LotsofLootHelper", LotsofLootHelper, { lifecycle: Lifecycle.Singleton }); + container.register("LotsofLootController", LotsofLootController, { lifecycle: Lifecycle.Singleton }); + container.register("LotsofLootMarkedRoomController", LotsofLootMarkedRoomController, { lifecycle: Lifecycle.Singleton }); + + container.register("LocationLootGeneratorOverrides", LocationLootGeneratorOverrides, { lifecycle: Lifecycle.Singleton }); + + container.register("LotsofLoot", LotsofLoot, { lifecycle: Lifecycle.Singleton }); + } +} \ No newline at end of file diff --git a/src/LotsofLootHelper.ts b/src/helpers/LotsofLootHelper.ts similarity index 75% rename from src/LotsofLootHelper.ts rename to src/helpers/LotsofLootHelper.ts index c54b695..5f9f256 100644 --- a/src/LotsofLootHelper.ts +++ b/src/helpers/LotsofLootHelper.ts @@ -1,33 +1,36 @@ -import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { inject, injectable } from "tsyringe"; + import { ILocation } from "@spt/models/eft/common/ILocation"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { ILotsofLootConfig } from "./ILotsofLootConfig"; -import { LotsofLootLogger } from "./LotsofLootLogger"; +import { DatabaseService } from "@spt/services/DatabaseService"; + +import { LotsofLootLogger } from "../utils/LotsofLootLogger"; +import { LotsofLootConfig } from "../utils/LotsofLootConfig"; +@injectable() export class LotsofLootHelper { constructor( - private config: ILotsofLootConfig, - private databaseServer: DatabaseServer, - private itemHelper: ItemHelper, - private logger: LotsofLootLogger, - ) {} + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("LotsofLootLogger") protected logger: LotsofLootLogger, + @inject("LotsofLootConfig") protected config: LotsofLootConfig, + ) { + } //This function is heavily based off of SVM's 'RemoveBackpacksRestrictions' - //Huge credit to GhostFenixx for this + //Huge credit to GhostFenixx (SVM) for this public removeBackpackRestrictions(): void { - const items = this.databaseServer.getTables().templates.items; + const items = this.databaseService.getTables().templates.items; for (let key in items) { let value = items[key]; - if (value._parent == "5448e53e4bdc2d60728b4567" && value._props.Grids[0]._props.filters !== undefined) { + if (value._parent === "5448e53e4bdc2d60728b4567" && value._props.Grids[0]._props.filters !== undefined) { value._props.Grids[0]._props.filters = []; } } } public changeRelativeProbabilityInPool(itemtpl: string, mult: number): void { - const locations = this.databaseServer.getTables().locations; + const locations = this.databaseService.getTables().locations; for (const locationId in locations) { if (locations.hasOwnProperty(locationId)) { @@ -56,7 +59,7 @@ export class LotsofLootHelper { } public changeProbabilityOfPool(itemtpl: string, mult: number): void { - const locations = this.databaseServer.getTables().locations; + const locations = this.databaseService.getTables().locations; for (const locationId in locations) { if (locations.hasOwnProperty(locationId)) { diff --git a/src/mod.ts b/src/mod.ts index 66efe9a..431275f 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,811 +1,21 @@ -import path from "path"; -import { IContainerItem, LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; -import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; -import { ILocation, IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; -import { ILooseLoot, ISpawnpoint, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; -import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { BaseClasses } from "@spt/models/enums/BaseClasses"; -import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; -import { IPostDBLoadModAsync } from "@spt/models/external/IPostDBLoadModAsync"; -import { IPreSptLoadModAsync } from "@spt/models/external/IPreSptLoadModAsync"; -import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; -import { ItemFilterService } from "@spt/services/ItemFilterService"; -import { LocalisationService } from "@spt/services/LocalisationService"; -import { SeasonalEventService } from "@spt/services/SeasonalEventService"; -import { HashUtil } from "@spt/utils/HashUtil"; -import { JsonUtil } from "@spt/utils/JsonUtil"; -import { MathUtil } from "@spt/utils/MathUtil"; -import { ProbabilityObject, ProbabilityObjectArray } from "@spt/utils/RandomUtil"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { VFS } from "@spt/utils/VFS"; -import { ICloner } from "@spt/utils/cloners/ICloner"; -import JSON5 from "json5"; import { DependencyContainer } from "tsyringe"; -import { ILotsofLootConfig } from "./ILotsofLootConfig"; -import { LotsofLootHelper } from "./LotsofLootHelper"; -import { LotsofLootLogger } from "./LotsofLootLogger"; -import { MarkedRoom } from "./MarkedRoom"; - -class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { - private static config: ILotsofLootConfig = null; - private static container: DependencyContainer; - private logger: LotsofLootLogger; - private databaseServer: DatabaseServer; - private itemHelper: ItemHelper; - private cloner: ICloner; - private hashUtil: HashUtil; +import { IPreSptLoadModAsync } from "@spt/models/external/IPreSptLoadModAsync"; +import { IPostDBLoadModAsync } from "@spt/models/external/IPostDBLoadModAsync"; - private markedRoom: MarkedRoom; - private lotsoflootHelper: LotsofLootHelper; +import { LotsofLoot } from "./LotsofLoot"; +import { Container } from "./di/Container"; +class Mod implements IPreSptLoadModAsync, IPostDBLoadModAsync { public async preSptLoadAsync(container: DependencyContainer): Promise { - Mod.container = container; - - // Get VFS to read in configs - const vfs = container.resolve("VFS"); - const preSptModLoader = container.resolve("PreSptModLoader"); - // Load config statically so that we don't have to keep reloading this across the entire file. - Mod.config = JSON5.parse(vfs.readFile(path.join(preSptModLoader.getModPath("archangelwtf-lotsoflootredux"), "config/config.json5"))); + Container.register(container); - this.logger = new LotsofLootLogger(container.resolve("WinstonLogger"), Mod.config.general.debug); - this.markedRoom = new MarkedRoom(Mod.config.markedRoom, container.resolve("DatabaseServer"), container.resolve("ItemHelper"), container.resolve("HashUtil"), this.logger); - this.lotsoflootHelper = new LotsofLootHelper(Mod.config, container.resolve("DatabaseServer"), container.resolve("ItemHelper"), this.logger); - - container.afterResolution( - "LocationLootGenerator", - (_t, result: LocationLootGenerator) => { - //Temporary cast to get rid of protected error - (result as any).createStaticLootItem = (tpl, staticAmmoDist, parentId) => { - return this.createStaticLootItem(tpl, staticAmmoDist, parentId); - }; - - result.generateDynamicLoot = (dynamicLootDist, staticAmmoDist, locationName) => { - return this.generateDynamicLoot(dynamicLootDist, staticAmmoDist, locationName); - }; - }, - { frequency: "Always" }, - ); + await container.resolve("LotsofLoot").preSptLoadAsync(container); } public async postDBLoadAsync(container: DependencyContainer): Promise { - this.databaseServer = Mod.container.resolve("DatabaseServer"); - this.itemHelper = Mod.container.resolve("ItemHelper"); - this.cloner = Mod.container.resolve("PrimaryCloner"); - this.hashUtil = Mod.container.resolve("HashUtil"); - - const tables = this.databaseServer.getTables(); - const configServer = container.resolve("ConfigServer"); - const locations = this.databaseServer.getTables().locations; - const LocationConfig = configServer.getConfig(ConfigTypes.LOCATION); - - this.markedRoom.doMarkedRoomChanges(); - this.addToRustedKeyRoom(); - - if (Mod.config.general.removeBackpackRestrictions) { - this.lotsoflootHelper.removeBackpackRestrictions(); - } - - for (const map in Mod.config.looseLootMultiplier) { - LocationConfig.looseLootMultiplier[map] = Mod.config.looseLootMultiplier[map]; - this.logger.debug(`${map}: ${LocationConfig.looseLootMultiplier[map]}`); - LocationConfig.staticLootMultiplier[map] = Mod.config.staticLootMultiplier[map]; - this.logger.debug(`${map}: ${LocationConfig.staticLootMultiplier[map]}`); - } - - for (const locationId in locations) { - if (locations.hasOwnProperty(locationId)) { - const location: ILocation = locations[locationId]; - //Location does not have any static loot pools, skip this map. - if (!location.staticLoot) { - this.logger.debug(`Skipping ${locationId} as it has no static loot`); - - continue; - } - - const staticLoot = location.staticLoot; - - for (const container in staticLoot) { - for (const possItemCount in staticLoot[container].itemcountDistribution) { - if (staticLoot[container].itemcountDistribution[possItemCount].count == 0) { - staticLoot[container].itemcountDistribution[possItemCount].relativeProbability = Math.round(staticLoot[container].itemcountDistribution[possItemCount].relativeProbability * Mod.config.containers[container]); - - this.logger.debug(`Changed container ${container} chance to ${staticLoot[container].itemcountDistribution[possItemCount].relativeProbability}`); - } - } - } - } - } - - for (const itemId in Mod.config.changeRelativeProbabilityInPool) { - this.lotsoflootHelper.changeRelativeProbabilityInPool(itemId, Mod.config.changeRelativeProbabilityInPool[itemId]); - } - - for (const itemId in Mod.config.changeProbabilityOfPool) { - this.lotsoflootHelper.changeProbabilityOfPool(itemId, Mod.config.changeProbabilityOfPool[itemId]); - } - - if (Mod.config.general.disableFleaRestrictions) { - for (const item in tables.templates.items) { - if (this.itemHelper.isValidItem(tables.templates.items[item]._id)) { - tables.templates.items[item]._props.CanRequireOnRagfair = true; - tables.templates.items[item]._props.CanSellOnRagfair = true; - } - } - } - - for (const id in Mod.config.general.priceCorrection) { - tables.templates.prices[id] = Mod.config.general.priceCorrection[id]; - } - - this.logger.logInfo(`Finished loading`); - } - - // This method closely mirrors that of SPT - // The only difference being the bypass for loot overlay and using createStaticLootItem - private generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[] { - const LocationLootGenerator = Mod.container.resolve("LocationLootGenerator"); - const itemFilterService = Mod.container.resolve("ItemFilterService"); - const randomUtil = Mod.container.resolve("RandomUtil"); - const mathUtil = Mod.container.resolve("MathUtil"); - const localisationService = Mod.container.resolve("LocalisationService"); - const seasonalEventService = Mod.container.resolve("SeasonalEventService"); - const configServer = Mod.container.resolve("ConfigServer"); - const LocationConfig = configServer.getConfig(ConfigTypes.LOCATION); - - const loot: ISpawnpointTemplate[] = []; - const dynamicForcedSpawnPoints: ISpawnpointsForced[] = []; - - // Build the list of forced loot from both `ISpawnpointsForced` and any point marked `IsAlwaysSpawn` - dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpointsForced); - dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpoints.filter((point) => point.template.IsAlwaysSpawn)); - - // Temporary cast to get rid of protected, add all forced loot to return array - (LocationLootGenerator as any).addForcedLoot(loot, dynamicLootDist.spawnpointsForced, locationName); - - const allDynamicSpawnpoints = dynamicLootDist.spawnpoints; - - // Temporary cast to get rid of protected, draw from random distribution - let desiredSpawnpointCount = Math.round((LocationLootGenerator as any).getLooseLootMultiplerForLocation(locationName) * randomUtil.getNormallyDistributedRandomNumber(dynamicLootDist.spawnpointCount.mean, dynamicLootDist.spawnpointCount.std)); - - if (desiredSpawnpointCount > Mod.config.limits[locationName]) { - desiredSpawnpointCount = Mod.config.limits[locationName]; - } - - // Positions not in forced but have 100% chance to spawn - const guaranteedLoosePoints: ISpawnpoint[] = []; - - const blacklistedSpawnpoints = LocationConfig.looseLootBlacklist[locationName]; - const spawnpointArray = new ProbabilityObjectArray(mathUtil, this.cloner); - - for (const spawnpoint of allDynamicSpawnpoints) { - if (blacklistedSpawnpoints?.includes(spawnpoint.template.Id)) { - this.logger.debug(`Ignoring loose loot location: ${spawnpoint.template.Id}`); - continue; - } - - // We've handled IsAlwaysSpawn above, so skip them - if (spawnpoint.template.IsAlwaysSpawn) { - continue; - } - - if (spawnpoint.probability === 1) { - guaranteedLoosePoints.push(spawnpoint); - } - - spawnpointArray.push(new ProbabilityObject(spawnpoint.template.Id, spawnpoint.probability, spawnpoint)); - } - - // Select a number of spawn points to add loot to - // Add ALL loose loot with 100% chance to pool - let chosenSpawnpoints: ISpawnpoint[] = [...guaranteedLoosePoints]; - - const randomSpawnpointCount = desiredSpawnpointCount - chosenSpawnpoints.length; - // Only draw random spawn points if needed - if (randomSpawnpointCount) { - // Add randomly chosen spawn points - for (const si of spawnpointArray.draw(randomSpawnpointCount, true)) { - chosenSpawnpoints.push(spawnpointArray.data(si)); - } - } - - if (!Mod.config.general.allowLootOverlay) { - // Filter out duplicate locationIds - chosenSpawnpoints = [...new Map(chosenSpawnpoints.map((spawnPoint) => [spawnPoint.locationId, spawnPoint])).values()]; - - // Do we have enough items in pool to fulfill requirement - const tooManySpawnPointsRequested = desiredSpawnpointCount - chosenSpawnpoints.length > 0; - if (tooManySpawnPointsRequested) { - this.logger.debug( - localisationService.getText("location-spawn_point_count_requested_vs_found", { - requested: desiredSpawnpointCount + guaranteedLoosePoints.length, - found: chosenSpawnpoints.length, - mapName: locationName, - }), - ); - } - } - - // Iterate over spawnpoints - const seasonalEventActive = seasonalEventService.seasonalEventEnabled(); - const seasonalItemTplBlacklist = seasonalEventService.getInactiveSeasonalEventItems(); - for (const spawnPoint of chosenSpawnpoints) { - if (!spawnPoint.template) { - this.logger.warning(localisationService.getText("location-missing_dynamic_template", spawnPoint.locationId)); - continue; - } - - // Ensure no blacklisted lootable items are in pool - spawnPoint.template.Items = spawnPoint.template.Items.filter((item) => !itemFilterService.isLootableItemBlacklisted(item._tpl)); - - // Ensure no seasonal items are in pool if not in-season - if (!seasonalEventActive) { - spawnPoint.template.Items = spawnPoint.template.Items.filter((item) => !seasonalItemTplBlacklist.includes(item._tpl)); - } - - // Spawn point has no items after filtering, skip - if (!spawnPoint.template.Items || spawnPoint.template.Items.length === 0) { - this.logger.warning(localisationService.getText("location-spawnpoint_missing_items", spawnPoint.template.Id)); - - continue; - } - - // Get an array of allowed IDs after above filtering has occured - const validItemIds = spawnPoint.template.Items.map((item) => item._id); - - // Spawn point has no items after filtering, skip - const itemArray = new ProbabilityObjectArray(mathUtil, this.cloner); - for (const itemDist of spawnPoint.itemDistribution) { - if (!validItemIds.includes(itemDist.composedKey.key)) { - continue; - } - - itemArray.push(new ProbabilityObject(itemDist.composedKey.key, itemDist.relativeProbability)); - } - - if (itemArray.length === 0) { - this.logger.warning(localisationService.getText("location-loot_pool_is_empty_skipping", spawnPoint.template.Id)); - - continue; - } - - // Draw a random item from spawn points possible items - const spawnPointClone = this.cloner.clone(spawnPoint); - const chosenComposedKey = itemArray.draw(1)[0]; - const chosenItem = spawnPointClone.template.Items.find((x) => x._id === chosenComposedKey); - const chosenTpl = chosenItem._tpl; - const createItemResult = this.createStaticLootItem(chosenTpl, staticAmmoDist, undefined, spawnPointClone); - - // Root id can change when generating a weapon - spawnPointClone.template.Root = createItemResult.items[0]._id; - spawnPointClone.template.Items = createItemResult.items; - - loot.push(spawnPointClone.template); - } - - return loot; - } - - private createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: ISpawnpoint = undefined): IContainerItem { - const presetHelper = Mod.container.resolve("PresetHelper"); - const randomUtil = Mod.container.resolve("RandomUtil"); - const localisationService = Mod.container.resolve("LocalisationService"); - const configServer = Mod.container.resolve("ConfigServer"); - const LocationConfig = configServer.getConfig(ConfigTypes.LOCATION); - - const gotItem = this.itemHelper.getItem(tpl); - let itemTemplate: ITemplateItem; - if (gotItem[0]) { - itemTemplate = gotItem[1]; - } else { - return { - items: [], - width: 0, - height: 0, - }; - } - - let width = itemTemplate._props.Width; - let height = itemTemplate._props.Height; - let items: IItem[] = [ - { - _id: this.hashUtil.generate(), - _tpl: tpl, - }, - ]; - - // container item has the container's id as the parentId - if (parentId) { - items[0].parentId = parentId; - } - - if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.WEAPON)) { - if (spawnPoint != undefined) { - const chosenItem = spawnPoint.template.Items.find((x) => x._tpl === tpl); - // Get item + it's children, then replace ids of children with valid MongoIDs before returning them to the items arrray. - const itemWithChildren = this.itemHelper.replaceIDs(this.itemHelper.findAndReturnChildrenAsItems(spawnPoint.template.Items, chosenItem._id)); - - items.splice(0, 1); - items.push(...itemWithChildren); - } else { - let children: IItem[] = []; - const defaultPreset = this.cloner.clone(presetHelper.getDefaultPreset(tpl)); - if (defaultPreset) { - children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); - } else { - // RSP30 (62178be9d0050232da3485d9/624c0b3340357b5f566e8766) doesnt have any default presets and kills this code below as it has no chidren to reparent - this.logger.debug(`createItem() No preset found for weapon: ${tpl}`); - } - - const rootItem = items[0]; - if (!rootItem) { - this.logger.logError(localisationService.getText("location-missing_root_item", { tpl: tpl, parentId: parentId })); - - throw new Error(localisationService.getText("location-critical_error_see_log")); - } - - if (children?.length > 0) { - items = this.itemHelper.reparentItemAndChildren(rootItem, children); - } - - const magazine = items.filter((x) => x.slotId === "mod_magazine")[0]; - // some weapon presets come without magazine; only fill the mag if it exists and if it has a good roll. - if (magazine && randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { - const magTemplate = this.itemHelper.getItem(magazine._tpl)[1]; - const weaponTemplate = this.itemHelper.getItem(tpl)[1]; - - // Create array with just magazine - const magazineWithCartridges: IItem[] = []; - magazineWithCartridges.push(magazine); - - this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, magTemplate, staticAmmoDist, weaponTemplate._props.ammoCaliber, LocationConfig.minFillStaticMagazinePercent / 100); - - // Replace existing magazine with above array - items.splice(items.indexOf(magazine), 1, ...magazineWithCartridges); - } - - const size = this.itemHelper.getItemSize(items, rootItem._id); - width = size.width; - height = size.height; - } - } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MONEY) || this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO)) { - const stackCount = randomUtil.getInt(itemTemplate._props.StackMinRandom, itemTemplate._props.StackMaxRandom); - items[0].upd = { StackObjectsCount: stackCount }; - } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO_BOX)) { - this.itemHelper.addCartridgesToAmmoBox(items, itemTemplate); - } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MAGAZINE)) { - if (randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { - // Create array with just magazine - const magazineWithCartridges: IItem[] = []; - magazineWithCartridges.push(items[0]); - - this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, itemTemplate, staticAmmoDist, null, LocationConfig.minFillStaticMagazinePercent / 100); - - // Replace existing magazine with above array - items.splice(items.indexOf(items[0]), 1, ...magazineWithCartridges); - } - } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.SIMPLE_CONTAINER) && tpl != "5c093e3486f77430cb02e593") { - const contloot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, Mod.config.general.looseContainerModifier); - this.logger.debug(`Container ${tpl} with`); - for (const cont of contloot) { - this.logger.debug(`${cont._tpl}`); - items.push(cont); - } - } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.BACKPACK)) { - const contloot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, Mod.config.general.looseBackpackModifier); - this.logger.debug(`Backpack ${tpl} with`); - for (const cont of contloot) { - this.logger.debug(`${cont._tpl}`); - items.push(cont); - } - } else if (this.itemHelper.armorItemCanHoldMods(tpl)) { - const defaultPreset = presetHelper.getDefaultPreset(tpl); - if (defaultPreset) { - const presetAndMods: IItem[] = this.itemHelper.replaceIDs(defaultPreset._items); - this.itemHelper.remapRootItemId(presetAndMods); - - // Use original items parentId otherwise item doesnt get added to container correctly - presetAndMods[0].parentId = items[0].parentId; - items = presetAndMods; - } else { - // We make base item above, at start of function, no need to do it here - if (itemTemplate._props.Slots?.length > 0) { - items = this.itemHelper.addChildSlotItems(items, itemTemplate, LocationConfig.equipmentLootSettings.modSpawnChancePercent); - } - } - } - - return { - items: items, - width: width, - height: height, - }; - } - - private looseContainerItemFilterIndex: Record = {}; - - private createLooseContainerLoot(tpl: string, id: string, staticAmmoDist: Record, modifier = 0.5): IItem[] { - const randomUtil = Mod.container.resolve("RandomUtil"); - const mathUtil = Mod.container.resolve("MathUtil"); - const jsonUtil = Mod.container.resolve("JsonUtil"); - - const tables = this.databaseServer.getTables(); - - const items = tables.templates.items; - const item = items[tpl]; - - if (item._props.Grids[0]._props.filters[0] === undefined) { - this.logger.warning(`${item._name} doesn't have a filter, setting default filter!`); - item._props.Grids[0]._props.filters = [ - { - Filter: ["54009119af1c881c07000029"], - ExcludedFilter: [], - }, - ]; - } - - let whitelist = this.cloner.clone(item._props.Grids[0]._props.filters[0].Filter); - let blacklist = this.cloner.clone(item._props?.Grids[0]._props.filters[0]?.ExcludedFilter) ?? []; - const amount = randomUtil.getInt(1, item._props.Grids[0]._props.cellsH * item._props.Grids[0]._props.cellsV * modifier); - let fill = 0; - - if (this.looseContainerItemFilterIndex[tpl]) { - whitelist = this.looseContainerItemFilterIndex[tpl]; - } else { - this.logger.debug(`${tpl} is new, generating whitelist`); - - const newWhiteList: string[] = []; - const newBlackList: string[] = []; - - //If whitelist contains a parent instead of items, replace the parent by all its children. - for (const content of whitelist) { - const childItems = this.findAndReturnChildrenByItems(items, content); - newWhiteList.push(...childItems); - } - - whitelist = newWhiteList; - - //If blacklist contains a parent instead of items, replace the parent by all its children. - for (const content of blacklist) { - const childItems = this.findAndReturnChildrenByItems(items, content); - newBlackList.push(...childItems); - } - - blacklist = newBlackList; - - for (const whitelistEntry in whitelist) { - //If whitelist contains entries that are in the blacklist, remove them. - if (blacklist[whitelistEntry]) { - whitelist.splice(whitelist.indexOf(whitelistEntry), 1); - } - } - - //Extra restrictions to avoid errors - for (let white = 0; white < whitelist.length; white++) { - if (!this.itemHelper.isValidItem(whitelist[white])) { - //Checks if the Item can be in your Stash - if (whitelist[white] == "5449016a4bdc2d6f028b456f") { - continue; - } - whitelist.splice(white, 1); - white--; - } else if (items[whitelist[white]]._props.Prefab.path == "") { - //If the Item has no model it cant be valid - whitelist.splice(white, 1); - white--; - } - } - - //Write new entry for later re-use. - this.looseContainerItemFilterIndex[tpl] = whitelist; - } - - if (whitelist.length == 0) { - this.logger.warning(`${tpl} whitelist is empty`); - return []; - } - - const weight: number[] = []; - for (let i = 0; i < whitelist.length; i++) { - if (tables.templates.prices[whitelist[i]]) { - weight.push(Math.round(1000 / Math.pow(tables.templates.prices[whitelist[i]], 1 / 3))); - } else if (whitelist[i] == "5449016a4bdc2d6f028b456f") { - weight.push(500); - } else if (whitelist[i] == "5696686a4bdc2da3298b456a") { - weight.push(100); - } else if (whitelist[i] == "569668774bdc2da2298b4568") { - weight.push(100); - } else { - weight.push(1); - } - } - - const itemArray = new ProbabilityObjectArray(mathUtil, jsonUtil); - for (let i = 0; i < whitelist.length; i++) { - itemArray.push(new ProbabilityObject(whitelist[i], weight[i])); - } - - const generatedItems: IItem[] = []; - - while (true) { - let cont: string; - if (Mod.config.general.itemWeights) { - cont = itemArray.draw(1, true)[0]; - } else { - cont = whitelist[randomUtil.getInt(0, whitelist.length - 1)]; - } - - const positem = this.createStaticLootItem(cont, staticAmmoDist, id); - positem.items[0].slotId = "main"; - fill += positem.height * positem.width; - - if (fill > amount) { - break; - } - - for (const itm of positem.items) { - generatedItems.push(itm); - } - } - - return generatedItems; - } - - private findAndReturnChildrenByItems(items: Record, itemID: string): string[] { - const stack: string[] = [itemID]; - const result: string[] = []; - let i = 0; - - if (itemID == "54009119af1c881c07000029") { - for (const childItem of Object.keys(items)) { - result.push(childItem); - } - return result; - } - - while (stack.length > 0) { - i = 0; - const currentItemId = stack.pop(); - for (const childItem of Object.keys(items)) { - if (items[childItem]._parent === currentItemId) { - stack.push(childItem); - i++; - } - } - if (i == 0) { - result.push(currentItemId); - } - } - return result; - } - - private addToRustedKeyRoom(): void { - const tables = this.databaseServer.getTables(); - const streetsloot = tables.locations.tarkovstreets.looseLoot; - const items = tables.templates.items; - let keys: string[] = []; - let valuables: string[] = []; - - for (const item in items) { - if (Mod.config.general.rustedKeyRoomIncludesKeycards) { - if (this.itemHelper.isOfBaseclass(item, BaseClasses.KEY)) { - keys.push(item); - } - } else { - if (this.itemHelper.isOfBaseclass(item, BaseClasses.KEY_MECHANICAL)) { - keys.push(item); - } - } - if (this.itemHelper.isOfBaseclass(item, BaseClasses.JEWELRY)) { - valuables.push(item); - } - } - let point: ISpawnpoint = { - locationId: "(185.087, 6.554, 63.721)", - probability: 0.25, - template: { - Id: "Keys1", - IsContainer: false, - useGravity: true, - randomRotation: true, - Position: { - x: 185.087, - y: 6.554, - z: 63.721, - }, - Rotation: { - x: 0, - y: 0, - z: 0, - }, - IsGroupPosition: false, - GroupPositions: [], - IsAlwaysSpawn: false, - Root: this.hashUtil.generate(), - Items: [], - }, - itemDistribution: [], - }; - for (let i = 0; i < keys.length; i++) { - point.template.Items.push({ - _id: i.toString(), - _tpl: keys[i], - }); - point.itemDistribution.push({ - composedKey: { key: i.toString() }, - relativeProbability: 1, - }); - } - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys2"; - point.template.Position = { - x: 185.125, - y: 6.554, - z: 63.186, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys3"; - point.template.Position = { - x: 185.164, - y: 6.554, - z: 62.241, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys4"; - point.template.Position = { - x: 185.154, - y: 6.554, - z: 62.686, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys5"; - point.template.Position = { - x: 185.21, - y: 6.935, - z: 60.86, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys6"; - point.template.Position = { - x: 185.205, - y: 6.935, - z: 60.56, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys7"; - point.template.Position = { - x: 185.208, - y: 6.58, - z: 60.857, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys8"; - point.template.Position = { - x: 185.211, - y: 6.562, - z: 60.562, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys9"; - point.template.Position = { - x: 185.202, - y: 6.175, - z: 60.551, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys10"; - point.template.Position = { - x: 185.2, - y: 6.234, - z: 60.872, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys11"; - point.template.Position = { - x: 182.683, - y: 6.721, - z: 57.813, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Keys12"; - point.template.Position = { - x: 182.683, - y: 6.721, - z: 60.073, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Val1"; - point.template.Position = { - x: 185.037, - y: 5.831, - z: 53.836, - }; - point.template.Items = []; - point.itemDistribution = []; - for (let i = 0; i < valuables.length; i++) { - point.template.Items.push({ - _id: i.toString(), - _tpl: valuables[i], - }); - point.itemDistribution.push({ - composedKey: { key: i.toString() }, - relativeProbability: 1, - }); - } - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Val2"; - point.template.Position = { - x: 183.064, - y: 5.831, - z: 53.767, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Val3"; - point.template.Position = { - x: 185.146, - y: 5.831, - z: 60.114, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); - - point.template.Root = this.hashUtil.generate(); - point.template.Id = "Val4"; - point.template.Position = { - x: 185.085, - y: 5.831, - z: 65.393, - }; - point.locationId = point.template.Position.x.toString() + point.template.Position.y.toString() + point.template.Position.z.toString(); - streetsloot.spawnpoints.push(this.cloner.clone(point)); + await container.resolve("LotsofLoot").postDBLoadAsync(container); } } -module.exports = { mod: new Mod() }; +module.exports = { mod: new Mod() }; \ No newline at end of file diff --git a/src/overrides/LocationLootGeneratorOverrides.ts b/src/overrides/LocationLootGeneratorOverrides.ts new file mode 100644 index 0000000..dca732c --- /dev/null +++ b/src/overrides/LocationLootGeneratorOverrides.ts @@ -0,0 +1,478 @@ +import { inject, injectable } from "tsyringe"; + +import { BaseClasses } from "@spt/models/enums/BaseClasses"; +import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; + +import { IContainerItem, LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { PresetHelper } from "@spt/helpers/PresetHelper"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +import { JsonUtil } from "@spt/utils/JsonUtil"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { RandomUtil, ProbabilityObject, ProbabilityObjectArray } from "@spt/utils/RandomUtil"; +import { MathUtil } from "@spt/utils/MathUtil"; +import { LotsofLootConfig } from "../utils/LotsofLootConfig"; +import { LotsofLootLogger } from "../utils/LotsofLootLogger"; + +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; +import { ILooseLoot, ISpawnpoint, ISpawnpointsForced, ISpawnpointTemplate } from "@spt/models/eft/common/ILooseLoot"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; + +@injectable() +export class LocationLootGeneratorOverrides { + private looseContainerItemFilterIndex: Record = {}; + + constructor( + @inject("LocationLootGenerator") protected locationLootGenerator: LocationLootGenerator, + @inject("ConfigServer") protected configServer: ConfigServer, + @inject("ItemFilterService") protected itemFilterService: ItemFilterService, + @inject("LocalisationService") protected localisationService: LocalisationService, + @inject("SeasonalEventService") protected seasonalEventService: SeasonalEventService, + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("ItemHelper") protected itemHelper: ItemHelper, + @inject("PresetHelper") protected presetHelper: PresetHelper, + @inject("PrimaryCloner") protected cloner: ICloner, + @inject("JsonUtil") protected jsonUtil: JsonUtil, + @inject("HashUtil") protected hashUtil: HashUtil, + @inject("RandomUtil") protected randomUtil: RandomUtil, + @inject("MathUtil") protected mathUtil: MathUtil, + @inject("LotsofLootConfig") protected config: LotsofLootConfig, + @inject("LotsofLootLogger") protected logger: LotsofLootLogger, + ) { + } + + // This method closely mirrors that of SPT + // The only difference being the bypass for loot overlay and using createStaticLootItem + public generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[] { + const LocationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); + + const loot: ISpawnpointTemplate[] = []; + const dynamicForcedSpawnPoints: ISpawnpointsForced[] = []; + + // Build the list of forced loot from both `ISpawnpointsForced` and any point marked `IsAlwaysSpawn` + dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpointsForced); + dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpoints.filter((point) => point.template.IsAlwaysSpawn)); + + // Temporary cast to get rid of protected, add all forced loot to return array + (this.locationLootGenerator as any).addForcedLoot(loot, dynamicLootDist.spawnpointsForced, locationName); + + const allDynamicSpawnpoints = dynamicLootDist.spawnpoints; + + // Temporary cast to get rid of protected, draw from random distribution + let desiredSpawnpointCount = Math.round((this.locationLootGenerator as any).getLooseLootMultiplerForLocation(locationName) * this.randomUtil.getNormallyDistributedRandomNumber(dynamicLootDist.spawnpointCount.mean, dynamicLootDist.spawnpointCount.std)); + + if (desiredSpawnpointCount > this.config.getConfig().limits[locationName]) { + desiredSpawnpointCount = this.config.getConfig().limits[locationName]; + } + + // Positions not in forced but have 100% chance to spawn + const guaranteedLoosePoints: ISpawnpoint[] = []; + + const blacklistedSpawnpoints = LocationConfig.looseLootBlacklist[locationName]; + const spawnpointArray = new ProbabilityObjectArray(this.mathUtil, this.cloner); + + for (const spawnpoint of allDynamicSpawnpoints) { + if (blacklistedSpawnpoints?.includes(spawnpoint.template.Id)) { + this.logger.debug(`Ignoring loose loot location: ${spawnpoint.template.Id}`); + continue; + } + + // We've handled IsAlwaysSpawn above, so skip them + if (spawnpoint.template.IsAlwaysSpawn) { + continue; + } + + if (spawnpoint.probability === 1) { + guaranteedLoosePoints.push(spawnpoint); + } + + spawnpointArray.push(new ProbabilityObject(spawnpoint.template.Id, spawnpoint.probability, spawnpoint)); + } + + // Select a number of spawn points to add loot to + // Add ALL loose loot with 100% chance to pool + let chosenSpawnpoints: ISpawnpoint[] = [...guaranteedLoosePoints]; + + const randomSpawnpointCount = desiredSpawnpointCount - chosenSpawnpoints.length; + // Only draw random spawn points if needed + if (randomSpawnpointCount) { + // Add randomly chosen spawn points + for (const si of spawnpointArray.draw(randomSpawnpointCount, true)) { + chosenSpawnpoints.push(spawnpointArray.data(si)); + } + } + + if (!this.config.getConfig().general.allowLootOverlay) { + // Filter out duplicate locationIds + chosenSpawnpoints = [...new Map(chosenSpawnpoints.map((spawnPoint) => [spawnPoint.locationId, spawnPoint])).values()]; + + // Do we have enough items in pool to fulfill requirement + const tooManySpawnPointsRequested = desiredSpawnpointCount - chosenSpawnpoints.length > 0; + if (tooManySpawnPointsRequested) { + this.logger.debug( + this.localisationService.getText("location-spawn_point_count_requested_vs_found", { + requested: desiredSpawnpointCount + guaranteedLoosePoints.length, + found: chosenSpawnpoints.length, + mapName: locationName, + }), + ); + } + } + + // Iterate over spawnpoints + const seasonalEventActive = this.seasonalEventService.seasonalEventEnabled(); + const seasonalItemTplBlacklist = this.seasonalEventService.getInactiveSeasonalEventItems(); + for (const spawnPoint of chosenSpawnpoints) { + if (!spawnPoint.template) { + this.logger.warning(this.localisationService.getText("location-missing_dynamic_template", spawnPoint.locationId)); + continue; + } + + // Ensure no blacklisted lootable items are in pool + spawnPoint.template.Items = spawnPoint.template.Items.filter((item) => !this.itemFilterService.isLootableItemBlacklisted(item._tpl)); + + // Ensure no seasonal items are in pool if not in-season + if (!seasonalEventActive) { + spawnPoint.template.Items = spawnPoint.template.Items.filter((item) => !seasonalItemTplBlacklist.includes(item._tpl)); + } + + // Spawn point has no items after filtering, skip + if (!spawnPoint.template.Items || spawnPoint.template.Items.length === 0) { + this.logger.warning(this.localisationService.getText("location-spawnpoint_missing_items", spawnPoint.template.Id)); + + continue; + } + + // Get an array of allowed IDs after above filtering has occured + const validItemIds = spawnPoint.template.Items.map((item) => item._id); + + // Spawn point has no items after filtering, skip + const itemArray = new ProbabilityObjectArray(this.mathUtil, this.cloner); + for (const itemDist of spawnPoint.itemDistribution) { + if (!validItemIds.includes(itemDist.composedKey.key)) { + continue; + } + + itemArray.push(new ProbabilityObject(itemDist.composedKey.key, itemDist.relativeProbability)); + } + + if (itemArray.length === 0) { + this.logger.warning(this.localisationService.getText("location-loot_pool_is_empty_skipping", spawnPoint.template.Id)); + + continue; + } + + // Draw a random item from spawn points possible items + const spawnPointClone = this.cloner.clone(spawnPoint); + const chosenComposedKey = itemArray.draw(1)[0]; + const chosenItem = spawnPointClone.template.Items.find((x) => x._id === chosenComposedKey); + const chosenTpl = chosenItem._tpl; + const createItemResult = this.createStaticLootItem(chosenTpl, staticAmmoDist, undefined, spawnPointClone); + + // Root id can change when generating a weapon + spawnPointClone.template.Root = createItemResult.items[0]._id; + spawnPointClone.template.Items = createItemResult.items; + + loot.push(spawnPointClone.template); + } + + return loot; + } + + public createStaticLootItem(tpl: string, staticAmmoDist: Record, parentId: string = undefined, spawnPoint: ISpawnpoint = undefined): IContainerItem { + const LocationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); + + const gotItem = this.itemHelper.getItem(tpl); + let itemTemplate: ITemplateItem; + if (gotItem[0]) { + itemTemplate = gotItem[1]; + } else { + return { + items: [], + width: 0, + height: 0, + }; + } + + let width = itemTemplate._props.Width; + let height = itemTemplate._props.Height; + let items: IItem[] = [ + { + _id: this.hashUtil.generate(), + _tpl: tpl, + }, + ]; + + // container item has the container's id as the parentId + if (parentId) { + items[0].parentId = parentId; + } + + if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.WEAPON)) { + if (spawnPoint != undefined) { + const chosenItem = spawnPoint.template.Items.find((x) => x._tpl === tpl); + // Get item + it's children, then replace ids of children with valid MongoIDs before returning them to the items arrray. + const itemWithChildren = this.itemHelper.replaceIDs(this.itemHelper.findAndReturnChildrenAsItems(spawnPoint.template.Items, chosenItem._id)); + + items.splice(0, 1); + items.push(...itemWithChildren); + } else { + let children: IItem[] = []; + const defaultPreset = this.cloner.clone(this.presetHelper.getDefaultPreset(tpl)); + if (defaultPreset) { + children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); + } else { + // RSP30 (62178be9d0050232da3485d9/624c0b3340357b5f566e8766) doesnt have any default presets and kills this code below as it has no chidren to reparent + this.logger.debug(`createItem() No preset found for weapon: ${tpl}`); + } + + const rootItem = items[0]; + if (!rootItem) { + this.logger.logError(this.localisationService.getText("location-missing_root_item", { tpl: tpl, parentId: parentId })); + + throw new Error(this.localisationService.getText("location-critical_error_see_log")); + } + + if (children?.length > 0) { + items = this.itemHelper.reparentItemAndChildren(rootItem, children); + } + + const magazine = items.filter((x) => x.slotId === "mod_magazine")[0]; + // some weapon presets come without magazine; only fill the mag if it exists and if it has a good roll. + if (magazine && this.randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { + const magTemplate = this.itemHelper.getItem(magazine._tpl)[1]; + const weaponTemplate = this.itemHelper.getItem(tpl)[1]; + + // Create array with just magazine + const magazineWithCartridges: IItem[] = []; + magazineWithCartridges.push(magazine); + + this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, magTemplate, staticAmmoDist, weaponTemplate._props.ammoCaliber, LocationConfig.minFillStaticMagazinePercent / 100); + + // Replace existing magazine with above array + items.splice(items.indexOf(magazine), 1, ...magazineWithCartridges); + } + + const size = this.itemHelper.getItemSize(items, rootItem._id); + width = size.width; + height = size.height; + } + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MONEY) || this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO)) { + const stackCount = this.randomUtil.getInt(itemTemplate._props.StackMinRandom, itemTemplate._props.StackMaxRandom); + items[0].upd = { StackObjectsCount: stackCount }; + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.AMMO_BOX)) { + this.itemHelper.addCartridgesToAmmoBox(items, itemTemplate); + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.MAGAZINE)) { + if (this.randomUtil.getChance100(LocationConfig.magazineLootHasAmmoChancePercent)) { + // Create array with just magazine + const magazineWithCartridges: IItem[] = []; + magazineWithCartridges.push(items[0]); + + this.itemHelper.fillMagazineWithRandomCartridge(magazineWithCartridges, itemTemplate, staticAmmoDist, null, LocationConfig.minFillStaticMagazinePercent / 100); + + // Replace existing magazine with above array + items.splice(items.indexOf(items[0]), 1, ...magazineWithCartridges); + } + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.SIMPLE_CONTAINER) && tpl != "5c093e3486f77430cb02e593") { + const containerLoot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, this.config.getConfig().general.looseContainerModifier); + this.logger.debug(`Container ${tpl} with`); + + for (const containerItem of containerLoot) { + this.logger.debug(`${containerItem._tpl}`); + items.push(containerItem); + } + } else if (this.itemHelper.isOfBaseclass(tpl, BaseClasses.BACKPACK)) { + const containerLoot = this.createLooseContainerLoot(items[0]._tpl, items[0]._id, staticAmmoDist, this.config.getConfig().general.looseBackpackModifier); + this.logger.debug(`Backpack ${tpl} with`); + + for (const containerItem of containerLoot) { + this.logger.debug(`${containerItem._tpl}`); + items.push(containerItem); + } + } else if (this.itemHelper.armorItemCanHoldMods(tpl)) { + const defaultPreset = this.presetHelper.getDefaultPreset(tpl); + if (defaultPreset) { + const presetAndMods: IItem[] = this.itemHelper.replaceIDs(defaultPreset._items); + this.itemHelper.remapRootItemId(presetAndMods); + + // Use original items parentId otherwise item doesnt get added to container correctly + presetAndMods[0].parentId = items[0].parentId; + items = presetAndMods; + } else { + // We make base item above, at start of function, no need to do it here + if (itemTemplate._props.Slots?.length > 0) { + items = this.itemHelper.addChildSlotItems(items, itemTemplate, LocationConfig.equipmentLootSettings.modSpawnChancePercent); + } + } + } + + return { + items: items, + width: width, + height: height, + }; + } + + public createLooseContainerLoot(tpl: string, id: string, staticAmmoDist: Record, modifier = 0.5): IItem[] { + const tables = this.databaseService.getTables(); + + const items = tables.templates.items; + const item = items[tpl]; + + if (item._props.Grids[0]._props.filters[0] === undefined) { + this.logger.warning(`${item._name} doesn't have a filter, setting default filter!`); + item._props.Grids[0]._props.filters = [ + { + Filter: ["54009119af1c881c07000029"], + ExcludedFilter: [], + }, + ]; + } + + let whitelist = this.cloner.clone(item._props.Grids[0]._props.filters[0].Filter); + let blacklist = this.cloner.clone(item._props?.Grids[0]._props.filters[0]?.ExcludedFilter) ?? []; + const amount = this.randomUtil.getInt(1, item._props.Grids[0]._props.cellsH * item._props.Grids[0]._props.cellsV * modifier); + let fill = 0; + + if (this.looseContainerItemFilterIndex[tpl]) { + whitelist = this.looseContainerItemFilterIndex[tpl]; + } else { + this.logger.debug(`${tpl} is new, generating whitelist`); + + const newWhiteList: string[] = []; + const newBlackList: string[] = []; + + //If whitelist contains a parent instead of items, replace the parent by all its children. + for (const content of whitelist) { + const childItems = this.findAndReturnChildrenByItems(items, content); + newWhiteList.push(...childItems); + } + + whitelist = newWhiteList; + + //If blacklist contains a parent instead of items, replace the parent by all its children. + for (const content of blacklist) { + const childItems = this.findAndReturnChildrenByItems(items, content); + newBlackList.push(...childItems); + } + + blacklist = newBlackList; + + for (const whitelistEntry in whitelist) { + //If whitelist contains entries that are in the blacklist, remove them. + if (blacklist[whitelistEntry]) { + whitelist.splice(whitelist.indexOf(whitelistEntry), 1); + } + } + + //Extra restrictions to avoid errors + for (let white = 0; white < whitelist.length; white++) { + if (!this.itemHelper.isValidItem(whitelist[white])) { + //Checks if the Item can be in your Stash + if (whitelist[white] == "5449016a4bdc2d6f028b456f") { + continue; + } + whitelist.splice(white, 1); + white--; + } else if (items[whitelist[white]]._props.Prefab.path == "") { + //If the Item has no model it cant be valid + whitelist.splice(white, 1); + white--; + } + } + + //Write new entry for later re-use. + this.looseContainerItemFilterIndex[tpl] = whitelist; + } + + if (whitelist.length == 0) { + this.logger.warning(`${tpl} whitelist is empty`); + return []; + } + + const weight: number[] = []; + for (let i = 0; i < whitelist.length; i++) { + let itemWeight = 1; + + if (tables.templates.prices[whitelist[i]]) { + itemWeight = Math.round(1000 / Math.pow(tables.templates.prices[whitelist[i]], 1 / 3)); + } else if (whitelist[i] === "5449016a4bdc2d6f028b456f") { + itemWeight = 500; + } else if (whitelist[i] === "5696686a4bdc2da3298b456a") { + itemWeight = 100; + } else if (whitelist[i] === "569668774bdc2da2298b4568") { + itemWeight = 100; + } + + this.logger.debug(`LocationLootGeneratorOverrides::createLooseContainerLoot: Weight of ${this.logger.writeItemName(whitelist[i], true)} is ${itemWeight}`) + + weight.push(itemWeight); + } + + const itemArray = new ProbabilityObjectArray(this.mathUtil, this.jsonUtil); + for (let i = 0; i < whitelist.length; i++) { + itemArray.push(new ProbabilityObject(whitelist[i], weight[i])); + } + + const generatedItems: IItem[] = []; + + while (true) { + let cont: string; + if (this.config.getConfig().general.itemWeights) { + cont = itemArray.draw(1, true)[0]; + } else { + cont = whitelist[this.randomUtil.getInt(0, whitelist.length - 1)]; + } + + const positem = this.createStaticLootItem(cont, staticAmmoDist, id); + positem.items[0].slotId = "main"; + fill += positem.height * positem.width; + + if (fill > amount) { + break; + } + + for (const item of positem.items) { + generatedItems.push(item); + } + } + + return generatedItems; + } + + private findAndReturnChildrenByItems(items: Record, itemID: string): string[] { + const stack: string[] = [itemID]; + const result: string[] = []; + let i = 0; + + if (itemID === "54009119af1c881c07000029") { + for (const childItem of Object.keys(items)) { + result.push(childItem); + } + return result; + } + + while (stack.length > 0) { + i = 0; + const currentItemId = stack.pop(); + for (const childItem of Object.keys(items)) { + if (items[childItem]._parent === currentItemId) { + stack.push(childItem); + i++; + } + } + + if (i === 0) { + result.push(currentItemId); + } + } + return result; + } +} \ No newline at end of file diff --git a/src/utils/LotsofLootConfig.ts b/src/utils/LotsofLootConfig.ts new file mode 100644 index 0000000..bc3c135 --- /dev/null +++ b/src/utils/LotsofLootConfig.ts @@ -0,0 +1,25 @@ +import path from "node:path"; +import { inject, injectable } from "tsyringe"; + +import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; +import { JsonUtil } from "@spt/utils/JsonUtil"; +import { VFS } from "@spt/utils/VFS"; + +import { ILotsofLootConfig } from "../ILotsofLootConfig"; + +@injectable() +export class LotsofLootConfig { + private config: ILotsofLootConfig; + + constructor( + @inject("PreSptModLoader") protected preSptModLoader: PreSptModLoader, + @inject("VFS") protected vfs: VFS, + @inject("JsonUtil") protected jsonUtil: JsonUtil, + ) { + this.config = this.jsonUtil.deserializeJson5(vfs.readFile(path.join(preSptModLoader.getModPath("archangelwtf-lotsoflootredux"), "config/config.json5"))); + } + + public getConfig(): ILotsofLootConfig { + return this.config; + } +} \ No newline at end of file diff --git a/src/utils/LotsofLootLogger.ts b/src/utils/LotsofLootLogger.ts new file mode 100644 index 0000000..daee20d --- /dev/null +++ b/src/utils/LotsofLootLogger.ts @@ -0,0 +1,57 @@ +import { inject, injectable } from "tsyringe"; + +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseService } from "@spt/services/DatabaseService";; +import { LotsofLootConfig } from "./LotsofLootConfig"; +import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; + +@injectable() +export class LotsofLootLogger { + constructor( + @inject("WinstonLogger") protected logger: ILogger, + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("LotsofLootConfig") protected config: LotsofLootConfig + ) { + } + private loggerPrefix = "[Lots of Loot] "; + + public logInfo(log: string): void { + this.logger.info(this.loggerPrefix + log); + } + + public warning(log: string): void { + this.logWarning(log); + } + + protected logWarning(log: string): void { + this.logger.warning(this.loggerPrefix + log); + } + + public logError(log: string): void { + this.logger.error(this.loggerPrefix + log); + } + + public debug(log: string): void { + this.logDebug(log); + } + + protected logDebug(log: string): void { + if (this.config.getConfig().general.debug) { + this.logger.logWithColor(this.loggerPrefix + log, LogTextColor.YELLOW); + } + } + + public writeItemName(itemId: string, writeTpl: boolean = false): string { + const enLocale = this.databaseService.getLocales().global["en"]; + const itemName = enLocale[`${itemId} Name`] ?? "Unknown"; + + if (writeTpl) + { + return `${itemName}(${itemId})`; + } + else + { + return itemName; + } + } +} From 6a148a686aefdd85b224216f23bc6d4424373eb1 Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 21 Nov 2024 22:04:41 +0100 Subject: [PATCH 16/23] refactor createLooseContainerLoot: * Handle built in inserts generating in the weight pool * Add more clean item validation --- .../LocationLootGeneratorOverrides.ts | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/overrides/LocationLootGeneratorOverrides.ts b/src/overrides/LocationLootGeneratorOverrides.ts index dca732c..06383c9 100644 --- a/src/overrides/LocationLootGeneratorOverrides.ts +++ b/src/overrides/LocationLootGeneratorOverrides.ts @@ -27,7 +27,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; @injectable() export class LocationLootGeneratorOverrides { - private looseContainerItemFilterIndex: Record = {}; + private looseContainerItemFilterIndexCache: Record = {}; constructor( @inject("LocationLootGenerator") protected locationLootGenerator: LocationLootGenerator, @@ -341,8 +341,8 @@ export class LocationLootGeneratorOverrides { const amount = this.randomUtil.getInt(1, item._props.Grids[0]._props.cellsH * item._props.Grids[0]._props.cellsV * modifier); let fill = 0; - if (this.looseContainerItemFilterIndex[tpl]) { - whitelist = this.looseContainerItemFilterIndex[tpl]; + if (this.looseContainerItemFilterIndexCache[tpl]) { + whitelist = this.looseContainerItemFilterIndexCache[tpl]; } else { this.logger.debug(`${tpl} is new, generating whitelist`); @@ -374,22 +374,21 @@ export class LocationLootGeneratorOverrides { //Extra restrictions to avoid errors for (let white = 0; white < whitelist.length; white++) { - if (!this.itemHelper.isValidItem(whitelist[white])) { - //Checks if the Item can be in your Stash - if (whitelist[white] == "5449016a4bdc2d6f028b456f") { - continue; - } + //Remove built in inserts, these can not be used. + if (this.itemHelper.isOfBaseclass(whitelist[white], BaseClasses.BUILT_IN_INSERTS)) { whitelist.splice(white, 1); white--; - } else if (items[whitelist[white]]._props.Prefab.path == "") { - //If the Item has no model it cant be valid + } + + //Validate if item is actually valid (Not a quest item or blacklisted) or if an item actually has a model. + if (!this.itemHelper.isValidItem(whitelist[white]) || items[whitelist[white]]._props.Prefab.path == "") { whitelist.splice(white, 1); white--; } } - //Write new entry for later re-use. - this.looseContainerItemFilterIndex[tpl] = whitelist; + //Write new entry to cache for later re-use. + this.looseContainerItemFilterIndexCache[tpl] = whitelist; } if (whitelist.length == 0) { @@ -397,7 +396,8 @@ export class LocationLootGeneratorOverrides { return []; } - const weight: number[] = []; + const itemArray = new ProbabilityObjectArray(this.mathUtil, this.cloner); + for (let i = 0; i < whitelist.length; i++) { let itemWeight = 1; @@ -411,14 +411,9 @@ export class LocationLootGeneratorOverrides { itemWeight = 100; } - this.logger.debug(`LocationLootGeneratorOverrides::createLooseContainerLoot: Weight of ${this.logger.writeItemName(whitelist[i], true)} is ${itemWeight}`) + this.logger.debug(`LocationLootGeneratorOverrides::createLooseContainerLoot: Weight of ${this.logger.writeItemName(whitelist[i], true)} is ${itemWeight} for ${tpl}`) - weight.push(itemWeight); - } - - const itemArray = new ProbabilityObjectArray(this.mathUtil, this.jsonUtil); - for (let i = 0; i < whitelist.length; i++) { - itemArray.push(new ProbabilityObject(whitelist[i], weight[i])); + itemArray.push(new ProbabilityObject(whitelist[i], itemWeight)); } const generatedItems: IItem[] = []; From f37525470ffe821cf6ef80d4dca63dc309c4fe4c Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 21 Nov 2024 22:30:25 +0100 Subject: [PATCH 17/23] Update log --- src/overrides/LocationLootGeneratorOverrides.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overrides/LocationLootGeneratorOverrides.ts b/src/overrides/LocationLootGeneratorOverrides.ts index 06383c9..f8522c5 100644 --- a/src/overrides/LocationLootGeneratorOverrides.ts +++ b/src/overrides/LocationLootGeneratorOverrides.ts @@ -230,7 +230,7 @@ export class LocationLootGeneratorOverrides { children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); } else { // RSP30 (62178be9d0050232da3485d9/624c0b3340357b5f566e8766) doesnt have any default presets and kills this code below as it has no chidren to reparent - this.logger.debug(`createItem() No preset found for weapon: ${tpl}`); + this.logger.warning(`LocationLootGeneratorOverrides::createStaticLootItem: No preset found for weapon: ${tpl}`); } const rootItem = items[0]; From 77a46a3df16beec3f06dc2b03899dcbe7e6836a9 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 25 Nov 2024 17:04:32 +0100 Subject: [PATCH 18/23] Disable loose container loot generator if value is 0 --- config/config.json5 | 4 ++-- src/overrides/LocationLootGeneratorOverrides.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/config.json5 b/config/config.json5 index adfe0c2..f6758ac 100644 --- a/config/config.json5 +++ b/config/config.json5 @@ -10,9 +10,9 @@ "disableFleaRestrictions": false, //Allows the rusted key room on Streets of Tarkov to also spawn keycards "rustedKeyRoomIncludesKeycards": false, - //Changes the max amount of items spawned in Loose Containers, Value: 0 - 1 + //Changes the max amount of items spawned in Loose Containers (things like T H I C C item cases, docs cases and such.. Setting this to 0 will turn this behavior off.) | Value: 0 - 1 "looseContainerModifier": 1, - //Changes the max amount of items spawned in Backpacks, Value: 0 - 1 + //Changes the max amount of items spawned in Backpacks spawned in the world (Setting this to 0 will turn this off.) | Value: 0 - 1 "looseBackpackModifier": 1, //Cheaper items are more likely to spawn in containers "itemWeights": true, diff --git a/src/overrides/LocationLootGeneratorOverrides.ts b/src/overrides/LocationLootGeneratorOverrides.ts index f8522c5..beb38eb 100644 --- a/src/overrides/LocationLootGeneratorOverrides.ts +++ b/src/overrides/LocationLootGeneratorOverrides.ts @@ -321,6 +321,11 @@ export class LocationLootGeneratorOverrides { } public createLooseContainerLoot(tpl: string, id: string, staticAmmoDist: Record, modifier = 0.5): IItem[] { + if (modifier === 0) + { + return []; + } + const tables = this.databaseService.getTables(); const items = tables.templates.items; From 046ef641eacef21c2481b2eef46c627b44f82433 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 25 Nov 2024 17:08:45 +0100 Subject: [PATCH 19/23] Update config --- config/config.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.json5 b/config/config.json5 index f6758ac..fedfdd9 100644 --- a/config/config.json5 +++ b/config/config.json5 @@ -10,7 +10,7 @@ "disableFleaRestrictions": false, //Allows the rusted key room on Streets of Tarkov to also spawn keycards "rustedKeyRoomIncludesKeycards": false, - //Changes the max amount of items spawned in Loose Containers (things like T H I C C item cases, docs cases and such.. Setting this to 0 will turn this behavior off.) | Value: 0 - 1 + //Changes the max amount of items spawned in Loose Containers (things like item cases, docs cases and such.. Setting this to 0 will turn this behavior off.) | Value: 0 - 1 "looseContainerModifier": 1, //Changes the max amount of items spawned in Backpacks spawned in the world (Setting this to 0 will turn this off.) | Value: 0 - 1 "looseBackpackModifier": 1, @@ -65,7 +65,7 @@ "laboratory": 25000, "rezervbase": 40000, "shoreline": 15000, - "woods": 7500, + "woods": 10000, "tarkovstreets": 50000, "lighthouse": 20000, "sandbox": 15000, From a1adcea769fd7a2f26e6fcff87ff0215d511744c Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 25 Nov 2024 17:23:46 +0100 Subject: [PATCH 20/23] Update .buildignore --- .buildignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildignore b/.buildignore index 96e72a1..0c054d5 100644 --- a/.buildignore +++ b/.buildignore @@ -8,6 +8,8 @@ /.nvmrc /.prettierrc /.vscode +/biome.json +/README.md /build.mjs /dist /images From 0124c37d229d0fe867933420fc9f60b2d7805793 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 26 Nov 2024 15:31:24 +0100 Subject: [PATCH 21/23] Change naming --- .../LocationLootGeneratorOverrides.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/overrides/LocationLootGeneratorOverrides.ts b/src/overrides/LocationLootGeneratorOverrides.ts index beb38eb..3c9380b 100644 --- a/src/overrides/LocationLootGeneratorOverrides.ts +++ b/src/overrides/LocationLootGeneratorOverrides.ts @@ -230,7 +230,7 @@ export class LocationLootGeneratorOverrides { children = this.itemHelper.reparentItemAndChildren(defaultPreset._items[0], defaultPreset._items); } else { // RSP30 (62178be9d0050232da3485d9/624c0b3340357b5f566e8766) doesnt have any default presets and kills this code below as it has no chidren to reparent - this.logger.warning(`LocationLootGeneratorOverrides::createStaticLootItem: No preset found for weapon: ${tpl}`); + this.logger.debug(`LocationLootGeneratorOverrides::createStaticLootItem: No preset found for weapon: ${tpl}`); } const rootItem = items[0]; @@ -416,7 +416,7 @@ export class LocationLootGeneratorOverrides { itemWeight = 100; } - this.logger.debug(`LocationLootGeneratorOverrides::createLooseContainerLoot: Weight of ${this.logger.writeItemName(whitelist[i], true)} is ${itemWeight} for ${tpl}`) + //this.logger.debug(`LocationLootGeneratorOverrides::createLooseContainerLoot: Weight of ${this.logger.writeItemName(whitelist[i], true)} is ${itemWeight} for ${tpl}`) itemArray.push(new ProbabilityObject(whitelist[i], itemWeight)); } @@ -424,22 +424,22 @@ export class LocationLootGeneratorOverrides { const generatedItems: IItem[] = []; while (true) { - let cont: string; + let drawnItemTpl: string; if (this.config.getConfig().general.itemWeights) { - cont = itemArray.draw(1, true)[0]; + drawnItemTpl = itemArray.draw(1, true)[0]; } else { - cont = whitelist[this.randomUtil.getInt(0, whitelist.length - 1)]; + drawnItemTpl = whitelist[this.randomUtil.getInt(0, whitelist.length - 1)]; } - const positem = this.createStaticLootItem(cont, staticAmmoDist, id); - positem.items[0].slotId = "main"; - fill += positem.height * positem.width; + const lootItem = this.createStaticLootItem(drawnItemTpl, staticAmmoDist, id); + lootItem.items[0].slotId = "main"; + fill += lootItem.height * lootItem.width; if (fill > amount) { break; } - for (const item of positem.items) { + for (const item of lootItem.items) { generatedItems.push(item); } } From f0c3c6032f1abdd8a010897869ad947f65943529 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 26 Nov 2024 15:32:48 +0100 Subject: [PATCH 22/23] Run startup of mod asynchronously --- src/LotsofLoot.ts | 4 +- src/controllers/LotsofLootController.ts | 6 +- .../LotsofLootMarkedRoomController.ts | 68 ++++++------ src/helpers/LotsofLootHelper.ts | 104 +++++++++--------- 4 files changed, 95 insertions(+), 87 deletions(-) diff --git a/src/LotsofLoot.ts b/src/LotsofLoot.ts index 972f981..f13d599 100644 --- a/src/LotsofLoot.ts +++ b/src/LotsofLoot.ts @@ -34,8 +34,8 @@ export class LotsofLoot { } public async postDBLoadAsync(_container: DependencyContainer): Promise { - this.lotsofLootController.applyLotsOfLootModifications(); - this.lotsofLootMarkedRoomController.adjustMarkedRoomItems(); + await this.lotsofLootController.applyLotsOfLootModifications(); + await this.lotsofLootMarkedRoomController.adjustMarkedRoomItems(); this.logger.logInfo(`Finished loading`); } diff --git a/src/controllers/LotsofLootController.ts b/src/controllers/LotsofLootController.ts index 7365e0f..c5e07dd 100644 --- a/src/controllers/LotsofLootController.ts +++ b/src/controllers/LotsofLootController.ts @@ -30,7 +30,7 @@ export class LotsofLootController { ) { } - public applyLotsOfLootModifications(): void { + public async applyLotsOfLootModifications(): Promise { const lotsofLootConfig = this.config.getConfig(); const tables = this.databaseService.getTables(); const locations = tables.locations; @@ -75,11 +75,11 @@ export class LotsofLootController { } for (const itemId in lotsofLootConfig.changeRelativeProbabilityInPool) { - this.lotsofLootHelper.changeRelativeProbabilityInPool(itemId, lotsofLootConfig.changeRelativeProbabilityInPool[itemId]); + await this.lotsofLootHelper.changeRelativeProbabilityInPoolAsync(itemId, lotsofLootConfig.changeRelativeProbabilityInPool[itemId]); } for (const itemId in lotsofLootConfig.changeProbabilityOfPool) { - this.lotsofLootHelper.changeProbabilityOfPool(itemId, lotsofLootConfig.changeProbabilityOfPool[itemId]); + await this.lotsofLootHelper.changeProbabilityOfPoolAsync(itemId, lotsofLootConfig.changeProbabilityOfPool[itemId]); } if (lotsofLootConfig.general.disableFleaRestrictions) { diff --git a/src/controllers/LotsofLootMarkedRoomController.ts b/src/controllers/LotsofLootMarkedRoomController.ts index 12dc1f4..beacc0d 100644 --- a/src/controllers/LotsofLootMarkedRoomController.ts +++ b/src/controllers/LotsofLootMarkedRoomController.ts @@ -22,7 +22,7 @@ export class LotsofLootMarkedRoomController { ) { } - public adjustMarkedRoomItems(): void { + public async adjustMarkedRoomItems(): Promise { const spawnPointsCustoms = this.databaseService.getTables().locations.bigmap.looseLoot.spawnpoints; const spawnPointsReserve = this.databaseService.getTables().locations.rezervbase.looseLoot.spawnpoints; const spawnPointsStreets = this.databaseService.getTables().locations.tarkovstreets.looseLoot.spawnpoints; @@ -33,8 +33,8 @@ export class LotsofLootMarkedRoomController { if (spawnpoint.template.Position.x > 180 && spawnpoint.template.Position.x < 185 && spawnpoint.template.Position.z > 180 && spawnpoint.template.Position.z < 185 && spawnpoint.template.Position.y > 6 && spawnpoint.template.Position.y < 7) { this.logger.debug(`Marked room (Customs) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.customs; - this.markedAddExtraItems(spawnpoint); - this.markedItemGroups(spawnpoint); + await this.markedAddExtraItemsAsync(spawnpoint); + await this.adjustMarkedItemGroupsAsync(spawnpoint); } } @@ -42,18 +42,18 @@ export class LotsofLootMarkedRoomController { if (spawnpoint.template.Position.x > -125 && spawnpoint.template.Position.x < -120 && spawnpoint.template.Position.z > 25 && spawnpoint.template.Position.z < 30 && spawnpoint.template.Position.y > -15 && spawnpoint.template.Position.y < -14) { this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.reserve; - this.markedAddExtraItems(spawnpoint); - this.markedItemGroups(spawnpoint); + await this.markedAddExtraItemsAsync(spawnpoint); + await this.adjustMarkedItemGroupsAsync(spawnpoint); } else if (spawnpoint.template.Position.x > -155 && spawnpoint.template.Position.x < -150 && spawnpoint.template.Position.z > 70 && spawnpoint.template.Position.z < 75 && spawnpoint.template.Position.y > -9 && spawnpoint.template.Position.y < -8) { this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.reserve; - this.markedAddExtraItems(spawnpoint); - this.markedItemGroups(spawnpoint); + await this.markedAddExtraItemsAsync(spawnpoint); + await this.adjustMarkedItemGroupsAsync(spawnpoint); } else if (spawnpoint.template.Position.x > 190 && spawnpoint.template.Position.x < 195 && spawnpoint.template.Position.z > -230 && spawnpoint.template.Position.z < -225 && spawnpoint.template.Position.y > -6 && spawnpoint.template.Position.y < -5) { this.logger.debug(`Marked room (Reserve) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.reserve; - this.markedAddExtraItems(spawnpoint); - this.markedItemGroups(spawnpoint); + await this.markedAddExtraItemsAsync(spawnpoint); + await this.adjustMarkedItemGroupsAsync(spawnpoint); } } @@ -62,15 +62,15 @@ export class LotsofLootMarkedRoomController { if (spawnpoint.template.Position.x > -133 && spawnpoint.template.Position.x < -129 && spawnpoint.template.Position.z > 265 && spawnpoint.template.Position.z < 275 && spawnpoint.template.Position.y > 8.5 && spawnpoint.template.Position.y < 11) { this.logger.debug(`Marked room (Streets) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.streets; - this.markedAddExtraItems(spawnpoint); - this.markedItemGroups(spawnpoint); + await this.markedAddExtraItemsAsync(spawnpoint); + await this.adjustMarkedItemGroupsAsync(spawnpoint); } //Chek 13 Marked Room else if (spawnpoint.template.Position.x > 186 && spawnpoint.template.Position.x < 191 && spawnpoint.template.Position.z > 224 && spawnpoint.template.Position.z < 229 && spawnpoint.template.Position.y > -0.5 && spawnpoint.template.Position.y < 1.5) { this.logger.debug(`Marked room (Streets) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.streets; - this.markedAddExtraItems(spawnpoint); - this.markedItemGroups(spawnpoint); + await this.markedAddExtraItemsAsync(spawnpoint); + await this.adjustMarkedItemGroupsAsync(spawnpoint); } } @@ -79,46 +79,52 @@ export class LotsofLootMarkedRoomController { if (spawnpoint.template.Position.x > 319 && spawnpoint.template.Position.x < 330 && spawnpoint.template.Position.z > 482 && spawnpoint.template.Position.z < 489 && spawnpoint.template.Position.y > 5 && spawnpoint.template.Position.y < 6.5) { this.logger.debug(`Marked room (Lighthouse) ${spawnpoint.template.Id}`); spawnpoint.probability *= this.config.getConfig().markedRoom.multiplier.lighthouse; - this.markedAddExtraItems(spawnpoint); - this.markedItemGroups(spawnpoint); + await this.markedAddExtraItemsAsync(spawnpoint); + await this.adjustMarkedItemGroupsAsync(spawnpoint); } } } - private markedAddExtraItems(spawnpoint: ISpawnpoint): void { - for (const item of Object.entries(this.config.getConfig().markedRoom.extraItems)) { - if (spawnpoint.template.Items.find((x) => x._tpl === item[0])) { - continue; + private async markedAddExtraItemsAsync(spawnpoint: ISpawnpoint): Promise { + const extraItems = Object.entries(await this.config.getConfig().markedRoom.extraItems); + + await Promise.all(extraItems.map(async ([itemTpl, relativeProbability]) => { + if (spawnpoint.template.Items.find((x) => x._tpl === itemTpl)) { + return; // Skip if the item already exists } const key = this.hashUtil.generate(); spawnpoint.template.Items.push({ _id: key, - _tpl: item[0], + _tpl: itemTpl, }); spawnpoint.itemDistribution.push({ composedKey: { key: key }, - relativeProbability: item[1], + relativeProbability: relativeProbability, }); - this.logger.debug(`Added ${item[0]} to ${spawnpoint.template.Id}`); - } + this.logger.debug(`Added ${itemTpl} to ${spawnpoint.template.Id}`); + })); } + - private markedItemGroups(spawnpoint: ISpawnpoint): void { - for (const item of spawnpoint.template.Items) { - for (const group in this.config.getConfig().markedRoom.itemGroups) { + private async adjustMarkedItemGroupsAsync(spawnpoint: ISpawnpoint): Promise { + const itemGroups = this.config.getConfig().markedRoom.itemGroups; + + await Promise.all(spawnpoint.template.Items.map(async (item) => { + await Promise.all(Object.keys(itemGroups).map(async (group) => { if (this.itemHelper.isOfBaseclass(item._tpl, group)) { - for (const dist of spawnpoint.itemDistribution) { + await Promise.all(spawnpoint.itemDistribution.map(async (dist) => { if (dist.composedKey.key === item._id) { - dist.relativeProbability *= this.config.getConfig().markedRoom.itemGroups[group]; + dist.relativeProbability *= itemGroups[group]; + this.logger.debug(`markedItemGroups: Changed ${item._tpl} to ${dist.relativeProbability}`); } - } + })); } - } - } + })); + })); } } diff --git a/src/helpers/LotsofLootHelper.ts b/src/helpers/LotsofLootHelper.ts index 5f9f256..86d25f0 100644 --- a/src/helpers/LotsofLootHelper.ts +++ b/src/helpers/LotsofLootHelper.ts @@ -29,62 +29,64 @@ export class LotsofLootHelper { } } - public changeRelativeProbabilityInPool(itemtpl: string, mult: number): void { + public async changeRelativeProbabilityInPoolAsync(itemtpl: string, mult: number): Promise { const locations = this.databaseService.getTables().locations; - - for (const locationId in locations) { - if (locations.hasOwnProperty(locationId)) { - const location: ILocation = locations[locationId]; - - if (!location.looseLoot) { - this.logger.debug(`Skipping ${locationId} as it has no loose loot!`); - continue; - } - - location.looseLoot.spawnpoints.forEach((spawnpoint) => { - const item = spawnpoint.template.Items.find((i) => i._tpl == itemtpl); - - if (item) { - const itemDistribution = spawnpoint.itemDistribution.find((i) => i.composedKey.key == item._id); - - if (itemDistribution) { - itemDistribution.relativeProbability *= mult; - - this.logger.debug(`${locationId}, ${spawnpoint.template.Id}, ${item._tpl}, ${itemDistribution.relativeProbability}`); - } - } - }); + const locationIds = Object.keys(locations); + + //Process each location asynchronously + await Promise.all(locationIds.map(async (locationId) => { + const location: ILocation = locations[locationId]; + + if (!location.looseLoot) { + this.logger.debug(`Skipping ${locationId} as it has no loose loot!`); + return; //Return skips this location, keeps the loop going. } - } + + //Process spawnpoints asynchronously + await Promise.all(location.looseLoot.spawnpoints.map(async (spawnpoint) => { + const item = spawnpoint.template.Items.find((i) => i._tpl == itemtpl); + + if (item) { + const itemDistribution = spawnpoint.itemDistribution.find((i) => i.composedKey.key == item._id); + + if (itemDistribution) { + itemDistribution.relativeProbability *= mult; + + this.logger.debug(`${locationId}, ${spawnpoint.template.Id}, ${item._tpl}, ${itemDistribution.relativeProbability}`); + } + } + })); + })); } - public changeProbabilityOfPool(itemtpl: string, mult: number): void { + public async changeProbabilityOfPoolAsync(itemtpl: string, mult: number): Promise { const locations = this.databaseService.getTables().locations; - - for (const locationId in locations) { - if (locations.hasOwnProperty(locationId)) { - const location: ILocation = locations[locationId]; - - if (!location.looseLoot) { - this.logger.debug(`Skipping ${locationId} as it has no loose loot!`); - continue; - } - - location.looseLoot.spawnpoints.forEach((spawnpoint) => { - const item = spawnpoint.template.Items.find((i) => i._tpl == itemtpl); - - if (item) { - spawnpoint.probability *= mult; - - //Clamp probability back down to 1 - if (spawnpoint.probability > 1) { - spawnpoint.probability = 1; - } - - this.logger.debug(`${locationId}, Pool:${spawnpoint.template.Id}, Chance:${spawnpoint.probability}`); - } - }); + const locationIds = Object.keys(locations); + + //Process each location asynchronously + await Promise.all(locationIds.map(async (locationId) => { + const location: ILocation = locations[locationId]; + + if (!location.looseLoot) { + this.logger.debug(`Skipping ${locationId} as it has no loose loot!`); + return; //Return skips this location, keeps the loop going. } - } + + //Process spawnpoints asynchronously + await Promise.all(location.looseLoot.spawnpoints.map(async (spawnpoint) => { + const item = spawnpoint.template.Items.find((i) => i._tpl == itemtpl); + + if (item) { + spawnpoint.probability *= mult; + + //Clamp probability to 1 if it exceeds + if (spawnpoint.probability > 1) { + spawnpoint.probability = 1; + } + + this.logger.debug(`${locationId}, Pool:${spawnpoint.template.Id}, Chance:${spawnpoint.probability}`); + } + })); + })); } } From c45226a95ae1c312e5c1db2851abbbfd0b268f38 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 26 Nov 2024 15:34:56 +0100 Subject: [PATCH 23/23] Update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e2d618..8712e28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LotsOfLoot Redux", - "version": "2.3.0", + "version": "2.4.0", "main": "src/mod.js", "license": "MIT", "author": "ArchangelWTF",