Compare commits

..

6 Commits
2.0.1 ... main

Author SHA1 Message Date
8f245bc6d6 Merge pull request 'Allow using _parent Ids to set prices for a group of items' (#6) from egbog/the-blacklist:main into main
Reviewed-on: #6
Reviewed-by: Platinum <platinum@noreply.dev.sp-tarkov.com>
2024-11-30 06:08:42 +00:00
egbog
10ec79ba47 Allow using _parent Ids to set prices for a group of items
added parentId to config
2024-11-27 22:22:24 -07:00
78601ef83f Merge pull request 'Update to 3.10' (#5) from Archangel/the-blacklist:main into main
Reviewed-on: #5
Reviewed-by: Platinum <platinum@noreply.dev.sp-tarkov.com>
2024-11-27 09:42:20 +00:00
e6d4487a6f Update to 3.10 2024-11-26 19:33:10 +01:00
aedfdd8b19 Filter new dogtags 2024-11-26 19:32:55 +01:00
1b421da7d9 Update eslint to what I normally like 2024-07-18 07:10:44 +10:00
320 changed files with 4392 additions and 2783 deletions

View File

@ -1,98 +1,75 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
"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", "1tbs"],
"@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"]
}
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
"@typescript-eslint/indent": ["warn", 2],
"@typescript-eslint/no-unused-expressions": [
"warn",
{
"allowShortCircuit": false,
"allowTernary": false
}
],
"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
}
}
"@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
}
}
]
}

View File

@ -25,6 +25,11 @@
// You can manually add flea prices to items, set a multiplier to their existing price or blacklist them entirely.
"customItemConfigs": [
{
// Headwear parent id. Affects all items under this parent. ie. Team Wendy Exfil, Airframe etc.,
"parentId": "5a341c4086f77401f2541505",
"priceMultiplier": 12.5
},
{
// .338 AP round, the best round in the game so it's quite expensive. This also demonstrates the use of the priceMultiplier property. You can lower this if you think it's too expensive.",
"itemId": "5fc382a9d724d907e2077dab",
@ -55,10 +60,30 @@
"itemId": "59f32bb586f774757e1e8442",
"blacklisted": true
},
{
// Dogtag BEAR (EOD)
"itemId": "6662e9aca7e0b43baa3d5f74",
"blacklisted": true
},
{
// Dogtag BEAR (Unhinged edition)
"itemId": "6662e9cda7e0b43baa3d5f76",
"blacklisted": true
},
{
// Dogtag USEC
"itemId": "59f32c3b86f77472a31742f0",
"blacklisted": true
},
{
// Dogtag USEC (EOD)
"itemId": "6662e9f37fa79a6d83730fa0",
"blacklisted": true
},
{
// Dogtag USEC (Unhinged edition)
"itemId": "6662ea05f6259762c56f3189",
"blacklisted": true
}
]
}

View File

@ -1,24 +1,24 @@
{
"name": "The Blacklist",
"version": "2.0.1",
"version": "2.0.2",
"main": "src/mod.js",
"license": "GPLv3",
"author": "Platinum",
"sptVersion": "3.9.*",
"sptVersion": "3.10.*",
"scripts": {
"setup": "npm i",
"build": "node ./packageBuild.ts"
},
"devDependencies": {
"@types/node": "16.18.10",
"@types/node": "~20.11",
"@typescript-eslint/eslint-plugin": "5.46.1",
"@typescript-eslint/parser": "5.46.1",
"bestzip": "2.2.1",
"eslint": "8.30.0",
"fs-extra": "11.1.0",
"fs-extra": "~11.2",
"glob": "8.0.3",
"tsyringe": "4.7.0",
"typescript": "4.9.4",
"tsyringe": "4.8.0",
"typescript": "5.4",
"jsonc": "^2.0.0"
}
}

View File

@ -26,7 +26,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ConfigServer } from "@spt/servers/ConfigServer";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
import { HandbookItem } from "@spt/models/eft/common/tables/IHandbookBase";
import { IHandbookItem } from "@spt/models/eft/common/tables/IHandbookBase";
import { isBulletOrShotgunShell } from "./helpers";
import { IGlobals } from "@spt/models/eft/common/IGlobals";
@ -71,7 +71,7 @@ class TheBlacklistMod implements IPostDBLoadModAsync {
const item = itemTable[handbookItem.Id];
const originalPrice = prices[item._id];
const customItemConfig = this.config.customItemConfigs.find(conf => conf.itemId === item._id);
const customItemConfig = this.config.customItemConfigs.find(conf => conf.itemId === item._id || conf.parentId === item._parent);
// We found a custom item config override to use. That's all we care about for this item. Move on to the next item.
if (customItemConfig && this.updateItemUsingCustomItemConfig(customItemConfig, item, prices, originalPrice, ragfairConfig)) {
@ -234,7 +234,7 @@ class TheBlacklistMod implements IPostDBLoadModAsync {
return this.advancedConfig.baselineBulletPrice * penetrationMultiplier * damageMultiplier * this.config.blacklistedAmmoAdditionalPriceMultiplier;
}
private getUpdatedPrice(handbookItem: HandbookItem, item: ITemplateItem, prices: Record<string, number>): number | undefined {
private getUpdatedPrice(handbookItem: IHandbookItem, item: ITemplateItem, prices: Record<string, number>): number | undefined {
// If a flea price doesn't exist for an item, we can multiply its handbook price which usually exists.
if (prices[item._id] == null) {
const handbookPrice = handbookItem.Price;

View File

@ -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<string, Difficulties>;
getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record<string, IDifficulties>;
/**
* 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

View File

@ -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<IHideoutSettingsBase>;
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
getHideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProductionData>;
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
/**
* 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<IGetItemPricesResponse>;
}

View File

@ -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<IChatServer[]>;
/** Handle client/mail/dialog/list */
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<IDialogueInfo[]>;
/** Handle client/mail/dialog/view */
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
/** Handle client/mail/dialog/info */
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<IDialogueInfo>;
/** Handle client/mail/dialog/remove */
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
/** Handle client/mail/dialog/pin */

View File

@ -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";
@ -76,10 +78,29 @@ 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 | IGetBodyResponseData<ISurveyResponseData>;
/**
* 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;
}

View File

@ -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<string>;
/**
* Custom spt server request found in modules/QTEPatch.cs
* @param url

View File

@ -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<boolean>;
getRoute(): string;
}

View File

@ -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
@ -22,42 +21,18 @@ 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
* @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;
}

View File

@ -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;
}

View File

@ -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<ILocationsGenerateAllResponse>;
/** Handle client/location/getLocalloot */
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
/** Handle client/location/getAirdropLoot */
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
/** Handle client/airdrop/loot */
getAirdropLoot(url: string, info: IGetAirdropLootRequest, sessionID: string): IGetBodyResponseData<IGetAirdropLootResponse>;
}

View File

@ -1,8 +1,9 @@
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 { 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 +16,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,13 +48,13 @@ export declare class MatchCallbacks {
transferGroup(url: string, info: IMatchGroupTransferRequest, sessionId: string): IGetBodyResponseData<boolean>;
/** Handle client/match/group/invite/cancel-all */
cancelAllGroupInvite(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData<boolean>;
/** @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<boolean>;
/** Handle match/group/start_game */
joinMatch(url: string, info: IMatchGroupStartGameRequest, sessionID: string): IGetBodyResponseData<IProfileStatusResponse>;
/** Handle client/getMetricsConfig */
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<IMetrics>;
/**
* Called periodically while in a group
* Handle client/match/group/status
@ -63,8 +66,10 @@ export declare class MatchCallbacks {
leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
/** Handle client/match/group/player/remove */
removePlayerFromGroup(url: string, info: IMatchGroupPlayerRemoveRequest, sessionID: string): IGetBodyResponseData<boolean>;
/** 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<IStartLocalRaidResponseData>;
/** 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 */

View File

@ -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<GetProfileStatusResponseData>;
getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetProfileStatusResponseData>;
/**
* Handle client/profile/view
* Called when viewing another players profile

View File

@ -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<void>;
onUpdate(): Promise<boolean>;
getRoute(): string;
@ -19,4 +22,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate {
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
/** Handle client/trading/api/getTraderAssort */
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
/** Handle /singleplayer/moddedTraders */
getModdedTraderData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IModdedTraders>;
}

View File

@ -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<IWeatherData>;
/** Handle client/localGame/weather */
getLocalWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetLocalWeatherResponseData>;
}

View File

@ -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;
}

View File

@ -3,9 +3,11 @@ 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,
RAID_ADJUSTMENTS = 4
RAID_ADJUSTMENTS = 4,
/** Data returned from client request object from endLocalRaid() */
TRANSIT_INFO = 5
}

View File

@ -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<string, any>;
/**
* 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[]
*/
generateBotsFirstTime(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise<IBotBase[]>;
protected generateMultipleBotsAndCache(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise<IBotBase[]>;
protected getMostRecentRaidSettings(): IGetRaidConfigurationRequestData;
/**
* Get min/max level range values for a specific map
* @param location Map name e.g. factory4_day
* @returns MinMax
*/
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<void>;
protected generateWithBotDetails(condition: ICondition, botGenerationDetails: IBotGenerationDetails, sessionId: string): Promise<void>;
/**
* 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<void>;
protected generateSingleBotAndStoreInCache(botGenerationDetails: IBotGenerationDetails, sessionId: string, cacheKey: string): Promise<void>;
/**
* 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<IBotBase[]>;
protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: BotGenerationDetails, possibleBossTypeWeights: Record<string, number>): void;
protected returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): Promise<IBotBase[]>;
protected getPmcConversionMinMaxForLocation(requestedBotRole: string, location: string): MinMax;
protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: IBotGenerationDetails, possibleBossTypeWeights: Record<string, number>): void;
/**
* Get the difficulty passed in, if its not "asonline", get selected difficulty from config
* @param requestedDifficulty

View File

@ -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;

View File

@ -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[];
}

View File

@ -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;
}

View File

@ -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";
@ -13,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";
@ -30,14 +29,15 @@ 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";
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,11 +45,13 @@ 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;
protected profileFixerService: ProfileFixerService;
protected localisationService: LocalisationService;
protected postDbLoadService: PostDbLoadService;
protected customLocationWaveService: CustomLocationWaveService;
protected openZoneService: OpenZoneService;
protected seasonalEventService: SeasonalEventService;
@ -62,32 +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, 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 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;
protected migrate39xProfile(fullProfile: ISptProfile): void;
/**
* Handle client/game/config
*/
@ -116,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
@ -168,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;
}

View File

@ -5,15 +5,14 @@ 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";
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;
@ -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

View File

@ -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;
}

View File

@ -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
@ -72,124 +28,18 @@ 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
*/
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(offraidProfileData: 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[];
}

View File

@ -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<string>;
protected findItemsToDelete(rootItemParentID: string, insured: IInsurance): Set<string>;
/**
* 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<string, Item>): Map<string, Item[]>;
protected populateParentAttachmentsMap(rootItemParentID: string, insured: IInsurance, itemsMap: Map<string, IItem>): Map<string, IItem[]>;
/**
* 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<string, Item[]>, itemsMap: Map<string, Item>): Map<string, Item[]>;
protected removeNonModdableAttachments(parentAttachmentsMap: Map<string, IItem[]>, itemsMap: Map<string, IItem>): Map<string, IItem[]>;
/**
* 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<string>, parentAttachmentsMap: Map<string, Item[]>): void;
protected processRegularItems(insured: IInsurance, toDelete: Set<string>, parentAttachmentsMap: Map<string, IItem[]>): 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<string, Item[]>, itemsMap: Map<string, Item>, traderId: string, toDelete: Set<string>): void;
protected processAttachments(mainParentToAttachmentsMap: Map<string, IItem[]>, itemsMap: Map<string, IItem>, traderId: string, toDelete: Set<string>): 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<string>): void;
protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record<string, number>): void;
protected weightAttachmentsByPrice(attachments: Item[]): Record<string, number>;
protected processAttachmentByParent(attachments: IItem[], traderId: string, toDelete: Set<string>): void;
protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: IItem[], attachmentPrices: Record<string, number>): void;
protected weightAttachmentsByPrice(attachments: IItem[]): Record<string, number>;
/**
* 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<string>): void;
protected removeItemsFromInsurance(insured: IInsurance, toDelete: Set<string>): void;
/**
* Handle sending the insurance message to the user that potentially contains the valid insurance items.
*
@ -175,7 +175,12 @@ 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;
protected IsMapLabsAndInsuranceDisabled(insurance: IInsurance, labsId?: string): boolean;
/**
* Update IInsurance object with new messageTemplateId and wipe out items array data
*/
protected handleLabsInsurance(traderDialogMessages: Record<string, 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 +189,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 +200,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

View File

@ -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";
@ -37,10 +38,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;
@ -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;
}

View File

@ -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[];
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -5,8 +5,7 @@ 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 { 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 +22,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;
@ -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
@ -72,6 +64,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
@ -101,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: Item[]): 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
@ -167,7 +123,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

View File

@ -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<string, number>;
getStaticPrices(): Record<string, number>;
/**

View File

@ -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;

View File

@ -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<string, number>, traderDetails: ITraderBase): number;
protected getPriceOfItemAndChildren(parentItemId: string, items: IItem[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1,6 +1,5 @@
/// <reference types="node" />
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<void>;
canHandle(something: string): boolean;
}

View File

@ -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,15 @@ export declare class BotEquipmentModGenerator {
*/
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
* @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 +156,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<T>(itemsToAddToArray: T[]): ExhaustableArray<T>;
/**
* 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>): 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<string, string[]>, 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 +199,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 +210,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 +225,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 +235,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 +243,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 +251,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 +259,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 +270,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 +286,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, string[]>): string[];
protected filterSightsByWeaponType(weapon: IItem, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -1,25 +1,26 @@
import { BotInventoryGenerator } from "@spt/generators/BotInventoryGenerator";
import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator";
import { BotDifficultyHelper } from "@spt/helpers/BotDifficultyHelper";
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 { 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 { 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";
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 +33,15 @@ export declare class BotGenerator {
protected botEquipmentFilterService: BotEquipmentFilterService;
protected weightedRandomHelper: WeightedRandomHelper;
protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper;
protected botGeneratorHelper: BotGeneratorHelper;
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, botGeneratorHelper: BotGeneratorHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner);
/**
* Generate a player scav bot object
* @param role e.g. assault / pmcbot
@ -50,12 +51,12 @@ 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
*/
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 +78,50 @@ 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;
/**
* 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<string, MinMax>, 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<string, number>, 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<string, number>, 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
* @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 +133,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 +172,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

View File

@ -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<string, string[]>;
protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: Record<string, string[]>): Record<string, string[]>;
/**
* 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;
}

View File

@ -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;
}

View File

@ -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
@ -63,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
@ -83,7 +83,7 @@ export declare class BotLootGenerator {
* @param isPmc Is bot being generated for a pmc
*/
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): 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 +91,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 +101,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<string>): void;
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: IInventory, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): 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 +123,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

View File

@ -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(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem): string;
protected getWeightedCompatibleAmmo(cartridgePool: Record<string, Record<string, number>>, 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 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;
}

View File

@ -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

View File

@ -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, 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<string, IStaticAmmoDetails[]>): SpawnpointTemplate[];
generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): 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<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, 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, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): 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<string, IStaticAmmoDetails[]>): 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, items: IItem[], staticAmmoDist: Record<string, IStaticAmmoDetails[]>): 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<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
}

View File

@ -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<string, MinMax>): 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<string>;
};
/**
* 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<string, {
current: number;
max: number;
}>, 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<string, {
current: number;
max: number;
}>, 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 {};

View File

@ -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;
/**

View File

@ -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;
}

View File

@ -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,28 +133,29 @@ 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<void>;
generateDynamicOffers(expiredOffers?: IItem[][]): Promise<void>;
/**
* @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<void>;
protected createOffersFromAssort(assortItemWithChildren: IItem[], isExpiredOffer: boolean, config: IDynamic): Promise<void>;
/**
* 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 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: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
protected createSingleOfferForItem(sellerId: string, itemWithChildren: IItem[], isPreset: boolean, itemToSellDetails: ITemplateItem): Promise<void>;
/**
* Generate trader offers on flea using the traders assort data
* @param traderID Trader to generate offers for
@ -164,7 +168,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 +181,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 +189,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 +223,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[];
}

View File

@ -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<string, TraderInfo>, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record<string, ITraderInfo>, 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

View File

@ -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:

View File

@ -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

View File

@ -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,18 +43,28 @@ 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;
protected getWeightedFog(): number;
protected getWeightedRain(): number;
protected getRandomFloat(node: string): number;
protected getRandomFloat(node: string, precision?: number): number;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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<string>): ItemAddedResult;
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: IItem[], inventory: IInventory, containersIdFull?: Set<string>): 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;
}

View File

@ -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<string, MinMax>;
/**
* 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;
}

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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<string, Dialogue>;
getDialogsForProfile(sessionId: string): Record<string, IDialogue>;
}

View File

@ -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 {};

View File

@ -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

View File

@ -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;
}

View File

@ -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 itemHelper: ItemHelper;
protected databaseService: DatabaseService;
protected inventoryHelper: InventoryHelper;
protected itemHelper: ItemHelper;
protected configServer: ConfigServer;
protected cloner: ICloner;
protected databaseService: DatabaseService;
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<string, TraderInfo>, tradersClientProfile: Record<string, TraderInfo>): void;
/**
* Transfer client achievements into profile
* @param profile Player pmc profile
* @param clientAchievements Achievements from client
*/
protected updateProfileAchievements(profile: IPmcData, clientAchievements: Record<string, number>): 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,18 @@ 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;
/**
* Remove FiR status from items
* @param items Items to process
*/
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
@ -134,29 +58,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;
}

View File

@ -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<string, Item>;
byParentId: Record<string, Item[]>;
byItemId: Record<string, IItem>;
byParentId: Record<string, IItem[]>;
}
}
export {};

View File

@ -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<string>): boolean;
isSameItems(item1: IItem[], item2: IItem[], compareUpdProperties?: Set<string>): 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<string>): boolean;
isSameItem(item1: IItem, item2: IItem, compareUpdProperties?: Set<string>): 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<string, Item>): Item | undefined;
getAttachmentMainParent(itemId: string, itemsMap: Map<string, IItem>): 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<string, Item>): Item | undefined;
getEquipmentParent(itemId: string, itemsMap: Map<string, IItem>): 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<string, IStaticAmmoDetails[]>, caliber?: string, minSizePercent?: number, defaultCartridgeTpl?: string, weapon?: ITemplateItem): void;
fillMagazineWithRandomCartridge(magazine: IItem[], magTemplate: ITemplateItem, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, 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<string, number>, requiredOnly?: boolean): Item[];
addChildSlotItems(itemToAdd: IItem[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record<string, number>, 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,42 @@ 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<string, Item>;
generateItemsMap(items: IItem[]): Map<string, IItem>;
/**
* 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;
/**
* Remove FiR status from passed in items
* @param items Items to update FiR status of
*/
removeSpawnedInSessionPropertyFromItems(items: IItem[]): void;
}
declare namespace ItemHelper {
interface ItemSize {
interface IItemSize {
width: number;
height: number;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -8,10 +8,11 @@ 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";
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,10 +23,11 @@ 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 { 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;
@ -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
@ -102,20 +105,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 +145,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 +171,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 +192,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 +262,14 @@ 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[];
/**
* 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
@ -259,7 +285,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
@ -286,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;
}

View File

@ -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

View File

@ -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<string, ITraderAssort>, 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;
}

View File

@ -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[];
}

View File

@ -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[];
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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[];
}

View File

@ -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;
}

View File

@ -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

View File

@ -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";
@ -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
@ -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

25
types/helpers/WeatherHelper.d.ts vendored Normal file
View File

@ -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;
}

View File

@ -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<unknown>): string;
/**
* Choos an item from the passed in array based on the weightings of each
* @param itemArray Items and weights to use

View File

@ -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[];
}

View File

@ -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;

View File

@ -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;

View File

@ -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<string, IPackageJsonData>;
getProfileModsGroupedByModName(profileMods: ModDetails[]): ModDetails[];
getProfileModsGroupedByModName(profileMods: IModDetails[]): IModDetails[];
getModPath(mod: string): string;
protected importModsAsync(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;

View File

@ -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;

View File

@ -1,2 +1 @@
export interface IEmptyRequestData {
}
export type IEmptyRequestData = {};

View File

@ -1,15 +1,101 @@
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;
LocationInfection: ILocationInfection;
bot_presets: IBotPreset[];
AudioSettings: IAudioSettings;
EnvironmentSettings: IEnvironmentSettings;
BotWeaponScatterings: IBotWeaponScattering[];
ItemPresets: Record<string, IPreset>;
}
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<string, IArtilleryMapSettings>;
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;
@ -23,14 +109,19 @@ export interface IConfig {
MaxBotsAliveOnMapPvE: number;
SavagePlayCooldown: number;
SavagePlayCooldownNdaFree: number;
SeasonActivity: ISeasonActivity;
MarksmanAccuracy: number;
SavagePlayCooldownDevelop: number;
TODSkyDate: string;
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 +138,10 @@ export interface IConfig {
UncheckOnShot: boolean;
BotsEnabled: boolean;
BufferZone: IBufferZone;
Airdrop: IAirdropGlobalSettings;
ArmorMaterials: IArmorMaterials;
ArenaEftTransferSettings: IArenaEftTransferSettings;
KarmaCalculationSettings: IKarmaCalculationSettings;
LegsOverdamage: number;
HandsOverdamage: number;
StomachOverdamage: number;
@ -103,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;
}
@ -173,6 +274,81 @@ 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;
RestoreHealthOnDestroyedParts: boolean;
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 +405,8 @@ export interface IMatchEnd {
survivedMult: number;
runnerMult: number;
killedMult: number;
transit_exp_reward: number;
transit_mult: number[][];
}
export interface IKill {
combo: ICombo[];
@ -392,10 +570,30 @@ export interface IBodyParts {
Feet: string;
Hands: string;
}
export interface IArenaEftTransferSettings {
ArenaEftTransferSettings: ArenaEftTransferSettings;
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 ArenaEftTransferSettings {
export interface IKarmaCalculationSettings {
defaultPveKarmaValue: number;
enable: boolean;
expireDaysAfterLastRaid: number;
maxKarmaThresholdPercentile: number;
minKarmaThresholdPercentile: number;
minSurvivedRaidCount: number;
}
export interface IArenaEftTransferSettings {
ArenaEftTransferSettings: IArenaEftTransferSettings;
}
export interface IArenaEftTransferSettings {
ArenaManagerReputationTaxMultiplier: number;
CharismaTaxMultiplier: number;
CreditPriceTaxMultiplier: number;
@ -459,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;
@ -805,6 +1009,7 @@ export interface IRagFair {
balancerAveragePriceCoefficient: number;
delaySinceOfferAdd: number;
uniqueBuyerTimeoutInDays: number;
userRatingChangeFrequencyMultiplayer: number;
ratingSumForIncrease: number;
ratingIncreaseCount: number;
ratingSumForDecrease: number;
@ -813,6 +1018,7 @@ export interface IRagFair {
maxSumForDecreaseRatingPerOneSale: number;
maxSumForRarity: IMaxSumForRarity;
ChangePriceCoef: number;
ItemRestrictions: IItemGlobalRestrictions[];
balancerUserItemSaleCooldownEnabled: boolean;
balancerUserItemSaleCooldown: number;
youSellOfferMaxStorageTimeInHour: number;
@ -820,11 +1026,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 +1052,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 +1126,9 @@ export interface IAlpinist {
RequirementTip: string;
}
export interface IRestrictionsInRaid {
MaxInLobby: number;
MaxInRaid: number;
TemplateId: string;
Value: number;
}
export interface IFavoriteItemsSettings {
WeaponStandMaxItemsCount: number;
@ -1013,10 +1227,12 @@ export interface ISquadSettings {
SendRequestDelaySeconds: number;
}
export interface IInsurance {
ChangeForReturnItemsInOfflineRaid: number;
MaxStorageTimeInHour: number;
CoefOfSendingMessageTime: number;
CoefOfHavingMarkOfUnknown: number;
EditionSendingMessageTime: Record<string, IMessageSendTImeMultipler>;
OnlyInDeathCase: boolean;
}
export interface IMessageSendTImeMultipler {
multiplier: number;
@ -1028,6 +1244,7 @@ export interface ISkillsSettings {
HideoutManagement: IHideoutManagement;
Crafting: ICrafting;
Metabolism: IMetabolism;
MountingErgonomicsBonusPerLevel: number;
Immunity: Immunity;
Endurance: IEndurance;
Strength: IStrength;
@ -1053,6 +1270,7 @@ export interface ISkillsSettings {
BearAksystems: any[];
BearHeavycaliber: any[];
BearRawpower: any[];
BipodErgonomicsBonusPerLevel: number;
UsecArsystems: any[];
UsecDeepweaponmodding_Settings: any[];
UsecLongrangeoptics_Settings: any[];
@ -1112,6 +1330,7 @@ export interface IArmorCounters {
export interface IHideoutManagement {
SkillPointsPerAreaUpgrade: number;
SkillPointsPerCraft: number;
CircleOfCultistsBonusPercent: number;
ConsumptionReductionPerLevel: number;
SkillBoostPercent: number;
SkillPointsRate: ISkillPointsRate;
@ -1417,6 +1636,7 @@ export interface IFenceLevel {
PaidExitCostModifier: number;
BotFollowChance: number;
ScavEquipmentSpawnChanceModifier: number;
TransitGridSize: Ixyz;
PriceModifier: number;
HostileBosses: boolean;
HostileScavs: boolean;
@ -1435,6 +1655,7 @@ export interface IFenceLevel {
ReactOnMarkOnUnknownsPVE: boolean;
DeliveryGridSize: Ixyz;
CanInteractWithBtr: boolean;
CircleOfCultistsBonusPercent: number;
}
export interface IInertia {
InertiaLimits: Ixyz;
@ -1550,7 +1771,7 @@ export interface IPreset {
_changeWeaponName: boolean;
_name: string;
_parent: string;
_items: Item[];
_items: IItem[];
/** Default presets have this property */
_encyclopedia?: string;
}

View File

@ -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<string, IContainerMinMax>;
@ -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;
}

View File

@ -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,30 +69,44 @@ export interface ILocationBase {
ScavMaxPlayersInGroup: number;
Rules: string;
SafeLocation: boolean;
Scene: Scene;
SpawnPointParams: SpawnPointParam[];
Scene: IScene;
SpawnPointParams: ISpawnPointParam[];
UnixDateTime: number;
_Id: string;
doors: any[];
EscapeTimeLimit: number;
EscapeTimeLimitCoop: number;
EscapeTimeLimitPVE: number;
Events: ILocationEvents;
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;
name: string;
conditions: string;
description: string;
id: number;
location: string;
target: string;
time: number;
}
export interface INonWaveGroupScenario {
Chance: number;
@ -101,7 +117,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 +129,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 +151,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 MinMaxBot extends MinMax {
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 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 +226,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 +258,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;
@ -232,11 +273,40 @@ export interface Wave {
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",
PMCBOT = "pmcbot"
PMCBOT = "pmcbot",
BOSSKILLA = "bosskilla",
BOSSKNIGHT = "bossknight"
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<string, boolean>;
TaskConditionCounters: Record<string, ITaskConditionCounter>;
InsuredItems: InsuredItem[];
Hideout: Hideout;
InsuredItems: IInsuredItem[];
Hideout: IHideout;
Quests: IQuestStatus[];
TradersInfo: Record<string, TraderInfo>;
TradersInfo: Record<string, ITraderInfo>;
UnlockedInfo: IUnlockedInfo;
RagfairInfo: RagfairInfo;
RagfairInfo: IRagfairInfo;
/** Achievement id and timestamp */
Achievements: Record<string, number>;
RepeatableQuests: IPmcDataRepeatableQuest[];
Bonuses: Bonus[];
Notes: Notes;
Bonuses: IBonus[];
Notes: INotes;
CarExtractCounts: Record<string, number>;
CoopExtractCounts: Record<string, number>;
SurvivorClass: SurvivorClass;
WishList: string[];
WishList: Record<string, number>;
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,27 +72,28 @@ 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;
StandingForKill: number;
AggressorBonus: number;
UseSimpleAnimator: boolean;
}
export interface IBan {
banType: BanType;
@ -105,42 +108,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 IBodyPartsHealth {
Head: IBodyPartHealth;
Chest: IBodyPartHealth;
Stomach: IBodyPartHealth;
LeftArm: IBodyPartHealth;
RightArm: IBodyPartHealth;
LeftLeg: IBodyPartHealth;
RightLeg: IBodyPartHealth;
}
export interface BodyPartHealth {
Health: CurrentMax;
Effects?: Record<string, BodyPartEffectProperties>;
export interface IBodyPartHealth {
Health: ICurrentMax;
Effects?: Record<string, IBodyPartEffectProperties>;
}
export interface BodyPartEffectProperties {
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 +153,16 @@ export interface Inventory {
/** Key is hideout area enum numeric as string e.g. "24", value is area _id */
hideoutAreaStashes: Record<string, string>;
fastPanel: Record<string, string>;
favoriteItems: string[];
favoriteItems: IItem[];
}
export interface IBaseJsonSkills {
Common: Record<string, Common>;
Mastering: Record<string, Mastering>;
Mastering: Record<string, IMastering>;
Points: number;
}
export interface Skills {
export interface ISkills {
Common: Common[];
Mastering: Mastering[];
Mastering: IMastering[];
Points: number;
}
export interface IBaseSkill {
@ -171,26 +175,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 +204,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;
@ -215,18 +219,19 @@ export interface Victim {
Level: number;
Weapon: string;
Role: string;
Location: 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 +242,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 +255,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 IBodyPartsDamageHistory {
Head: IDamageStats[];
Chest: IDamageStats[];
Stomach: IDamageStats[];
LeftArm: IDamageStats[];
RightArm: IDamageStats[];
LeftLeg: IDamageStats[];
RightLeg: IDamageStats[];
Common: IDamageStats[];
}
export interface DamageStats {
export interface IDamageStats {
Amount: number;
Type: string;
SourceId: string;
@ -268,55 +273,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<string, string>;
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<string, Productive>;
Areas: HideoutArea[];
Improvement: Record<string, IHideoutImprovement>;
export interface IHideout {
Production: Record<string, IProduction>;
Areas: IBotHideoutArea[];
Improvements: Record<string, IHideoutImprovement>;
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 +344,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 +368,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 +403,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 +428,7 @@ export interface Bonus {
filter?: string[];
skillType?: BonusSkillType;
}
export interface Note {
export interface INote {
Time: number;
Text: string;
}

Some files were not shown because too many files have changed in this diff Show More