Compare commits

..

4 Commits

Author SHA1 Message Date
4d4a625292 Fix run interval seconds 2024-04-03 19:36:21 +11:00
cc06f69961 Default some configs to false pre release 2024-04-03 19:36:06 +11:00
108ab78799 Update types 2024-04-02 21:15:25 +11:00
671eec11c3 Update scarce offers values 2024-04-02 21:14:18 +11:00
111 changed files with 1024 additions and 528 deletions

View File

@ -24,13 +24,13 @@
// When an item doesn't have a flea price because it was blacklisted by default, multiply the handbook price by this number to get the new flea price. Default 3. // When an item doesn't have a flea price because it was blacklisted by default, multiply the handbook price by this number to get the new flea price. Default 3.
"handbookPriceMultiplier": 3, "handbookPriceMultiplier": 3,
// Overrides ragfairConfig.runIntervalSeconds if config.enableFasterSales is true. Default 3s. // Overrides ragfairConfig.runIntervalValues.outOfRaid if config.enableFasterSales is true. Default 3s.
"runIntervalSecondsOverride": 3, "runIntervalSecondsOverride": 3,
// When config.enableScarceOffers is true, use these values to limit the number of offers on the flea. // When config.enableScarceOffers is true, use these values to limit the number of offers on the flea.
"offerItemCountOverride": { "offerItemCountOverride": {
"max": 3, "max": 4,
"min": 1 "min": 2
}, },
// When config.enableScarceOffers is true, use these values to limit the quantity of a stackable item (like ammo) per offer on the flea. // When config.enableScarceOffers is true, use these values to limit the quantity of a stackable item (like ammo) per offer on the flea.
@ -41,7 +41,7 @@
// When config.enableScarceOffers is true, use these values to limit the quantity of a non-stackable item (most items) per offer on the flea. // When config.enableScarceOffers is true, use these values to limit the quantity of a non-stackable item (most items) per offer on the flea.
"nonStackableCountOverride": { "nonStackableCountOverride": {
"max": 3, "max": 2,
"min": 1 "min": 1
}, },

View File

@ -6,10 +6,10 @@
"enableFasterSales": true, "enableFasterSales": true,
// Reduces the number of offers and quantities per offer to make the flea experience more hardcore. Highly recommend to enable but default is false. // Reduces the number of offers and quantities per offer to make the flea experience more hardcore. Highly recommend to enable but default is false.
"enableScarceOffers": true, "enableScarceOffers": false,
// Adds an extra offer for your current flea market rating bracket. So a new account at level 15 can create 3 offers instead of 2. Default is false. Extra amount is configurable in advancedConfigs. // Adds an extra offer for your current flea market rating bracket. So a new account at level 15 can create 3 offers instead of 2. Default is false. Extra amount is configurable in advancedConfigs.
"addExtraOfferSlot": true, "addExtraOfferSlot": false,
// Balances the flea price of all ammo types, not just the blacklisted ammo types. Can be useful if you find some ammo prices are unbalanced, this generally makes them very balanced for what they do. Default false. // Balances the flea price of all ammo types, not just the blacklisted ammo types. Can be useful if you find some ammo prices are unbalanced, this generally makes them very balanced for what they do. Default false.
"useBalancedPricingForAllAmmo": false, "useBalancedPricingForAllAmmo": false,

View File

@ -124,7 +124,7 @@ class TheBlacklistMod implements IPostDBLoadModAsync {
} }
if (this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) { if (this.config.enableFasterSales && !isNaN(this.advancedConfig.runIntervalSecondsOverride)) {
ragfairConfig.runIntervalSeconds = this.advancedConfig.runIntervalSecondsOverride; ragfairConfig.runIntervalValues.outOfRaid = this.advancedConfig.runIntervalSecondsOverride;
} }
if (this.config.enableScarceOffers) { if (this.config.enableScarceOffers) {

View File

@ -1,18 +1,13 @@
import { BundleLoader } from "@spt-aki/loaders/BundleLoader"; import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export declare class BundleCallbacks { export declare class BundleCallbacks {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
protected bundleLoader: BundleLoader; protected bundleLoader: BundleLoader;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); constructor(httpResponse: HttpResponseUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
/** /**
* Handle singleplayer/bundles * Handle singleplayer/bundles
*/ */

View File

@ -1,14 +1,28 @@
import { ClientLogController } from "@spt-aki/controllers/ClientLogController"; import { ClientLogController } from "@spt-aki/controllers/ClientLogController";
import { ModLoadOrder } from "@spt-aki/loaders/ModLoadOrder";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IClientLogRequest } from "@spt-aki/models/spt/logging/IClientLogRequest"; import { IClientLogRequest } from "@spt-aki/models/spt/logging/IClientLogRequest";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
/** Handle client logging related events */ /** Handle client logging related events */
export declare class ClientLogCallbacks { export declare class ClientLogCallbacks {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected clientLogController: ClientLogController; protected clientLogController: ClientLogController;
constructor(httpResponse: HttpResponseUtil, clientLogController: ClientLogController); protected configServer: ConfigServer;
protected localisationService: LocalisationService;
protected modLoadOrder: ModLoadOrder;
constructor(httpResponse: HttpResponseUtil, clientLogController: ClientLogController, configServer: ConfigServer, localisationService: LocalisationService, modLoadOrder: ModLoadOrder);
/** /**
* Handle /singleplayer/log * Handle /singleplayer/log
*/ */
clientLog(url: string, info: IClientLogRequest, sessionID: string): INullResponseData; clientLog(url: string, info: IClientLogRequest, sessionID: string): INullResponseData;
/**
* Handle /singleplayer/release
*/
releaseNotes(): string;
/**
* Handle /singleplayer/enableBSGlogging
*/
bsgLogging(): string;
} }

View File

@ -26,11 +26,11 @@ export declare class HideoutCallbacks implements OnUpdate {
/** /**
* Handle HideoutUpgrade event * Handle HideoutUpgrade event
*/ */
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Handle HideoutUpgradeComplete event * Handle HideoutUpgradeComplete event
*/ */
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Handle HideoutPutItemsInAreaSlots * Handle HideoutPutItemsInAreaSlots
*/ */
@ -62,11 +62,11 @@ export declare class HideoutCallbacks implements OnUpdate {
/** /**
* Handle HideoutQuickTimeEvent * Handle HideoutQuickTimeEvent
*/ */
handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse; handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Handle client/game/profile/items/moving - RecordShootingRangePoints * Handle client/game/profile/items/moving - RecordShootingRangePoints
*/ */
recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse; recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Handle client/game/profile/items/moving - RecordShootingRangePoints * Handle client/game/profile/items/moving - RecordShootingRangePoints
*/ */

View File

@ -62,4 +62,6 @@ export declare class InraidCallbacks {
* Handle singleplayer/traderServices/itemDelivery * Handle singleplayer/traderServices/itemDelivery
*/ */
itemDelivery(url: string, request: IItemDeliveryRequestData, sessionId: string): INullResponseData; itemDelivery(url: string, request: IItemDeliveryRequestData, sessionId: string): INullResponseData;
getTraitorScavHostileChance(url: string, info: IEmptyRequestData, sessionId: string): string;
getSandboxMaxPatrolValue(url: string, info: IEmptyRequestData, sessionId: string): string;
} }

View File

@ -27,35 +27,35 @@ export declare class InventoryCallbacks {
protected questController: QuestController; protected questController: QuestController;
constructor(inventoryController: InventoryController, questController: QuestController); constructor(inventoryController: InventoryController, questController: QuestController);
/** Handle client/game/profile/items/moving Move event */ /** Handle client/game/profile/items/moving Move event */
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** Handle Remove event */ /** Handle Remove event */
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** Handle Split event */ /** Handle Split event */
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, request: IInventoryTransferRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** Handle Swap */ /** Handle Swap */
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse; swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse; foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse; toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse; tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse; bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
unbindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse; unbindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** Handle ReadEncyclopedia */ /** Handle ReadEncyclopedia */
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle ApplyInventoryChanges */ /** Handle ApplyInventoryChanges */
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** Handle OpenRandomLootContainer */ /** Handle OpenRandomLootContainer */
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
setFavoriteItem(pmcData: IPmcData, body: ISetFavoriteItems, sessionId: string): IItemEventRouterResponse; setFavoriteItem(pmcData: IPmcData, body: ISetFavoriteItems, sessionId: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* TODO - MOVE INTO QUEST CODE * TODO - MOVE INTO QUEST CODE
* Handle game/profile/items/moving - QuestFail * Handle game/profile/items/moving - QuestFail
*/ */
failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
} }

View File

@ -9,5 +9,11 @@ export declare class ItemEventCallbacks {
protected itemEventRouter: ItemEventRouter; protected itemEventRouter: ItemEventRouter;
constructor(httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter); constructor(httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter);
handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): IGetBodyResponseData<IItemEventRouterResponse>; handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): IGetBodyResponseData<IItemEventRouterResponse>;
/**
* Return true if the passed in list of warnings contains critical issues
* @param warnings The list of warnings to check for critical errors
* @returns
*/
private isCriticalError;
protected getErrorCode(warnings: Warning[]): number; protected getErrorCode(warnings: Warning[]): number;
} }

View File

@ -1,16 +1,14 @@
import { MatchController } from "@spt-aki/controllers/MatchController"; import { MatchController } from "@spt-aki/controllers/MatchController";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData"; import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IAcceptGroupInviteRequest } from "@spt-aki/models/eft/match/IAcceptGroupInviteRequest"; import { IAcceptGroupInviteRequest } from "@spt-aki/models/eft/match/IAcceptGroupInviteRequest";
import { IAcceptGroupInviteResponse } from "@spt-aki/models/eft/match/IAcceptGroupInviteResponse"; import { IAcceptGroupInviteResponse } from "@spt-aki/models/eft/match/IAcceptGroupInviteResponse";
import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGroupInviteRequest"; import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGroupInviteRequest";
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData"; import { IDeclineGroupInviteRequest } from "@spt-aki/models/eft/match/IDeclineGroupInviteRequest";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult"; import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult";
@ -39,29 +37,27 @@ export declare class MatchCallbacks {
sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string>; sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string>;
/** Handle client/match/group/invite/accept */ /** Handle client/match/group/invite/accept */
acceptGroupInvite(url: string, info: IAcceptGroupInviteRequest, sessionID: string): IGetBodyResponseData<IAcceptGroupInviteResponse[]>; acceptGroupInvite(url: string, info: IAcceptGroupInviteRequest, sessionID: string): IGetBodyResponseData<IAcceptGroupInviteResponse[]>;
/** Handle client/match/group/invite/decline */
declineGroupInvite(url: string, info: IDeclineGroupInviteRequest, sessionID: string): IGetBodyResponseData<any>;
/** Handle client/match/group/invite/cancel */ /** Handle client/match/group/invite/cancel */
cancelGroupInvite(url: string, info: ICancelGroupInviteRequest, sessionID: string): IGetBodyResponseData<boolean>; cancelGroupInvite(url: string, info: ICancelGroupInviteRequest, sessionID: string): IGetBodyResponseData<boolean>;
/** Handle client/match/group/transfer */ /** Handle client/match/group/transfer */
transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean>; transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean>;
/** Handle client/match/group/invite/cancel-all */ /** Handle client/match/group/invite/cancel-all */
cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelAllGroupInvite(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
/** @deprecated - not called on raid start/end or game start/exit */ /** @deprecated - not called on raid start/end or game start/exit */
putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData;
/** Handle raid/profile/list */
getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
/** Handle match/group/start_game */ /** Handle match/group/start_game */
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult>; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult>;
/** Handle client/getMetricsConfig */ /** Handle client/getMetricsConfig */
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
/** /**
* @deprecated - not called on raid start/end or game start/exit * Called periodically while in a group
* Handle client/match/group/status * Handle client/match/group/status
* @returns * @returns
*/ */
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<IGetGroupStatusResponse>; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<IGetGroupStatusResponse>;
/** Handle client/match/group/create */
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
/** Handle client/match/group/delete */ /** Handle client/match/group/delete */
deleteGroup(url: string, info: any, sessionID: string): INullResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>; leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;

View File

@ -15,6 +15,7 @@ import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { ILootConfig } from "@spt-aki/models/spt/config/ILootConfig"; import { ILootConfig } from "@spt-aki/models/spt/config/ILootConfig";
@ -60,6 +61,7 @@ export declare class GameController {
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
protected lootConfig: ILootConfig; protected lootConfig: ILootConfig;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;

View File

@ -70,18 +70,18 @@ export declare class HideoutController {
* @param pmcData Player profile * @param pmcData Player profile
* @param request upgrade start request * @param request upgrade start request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Handle HideoutUpgradeComplete event * Handle HideoutUpgradeComplete event
* Complete a hideout area upgrade * Complete a hideout area upgrade
* @param pmcData Player profile * @param pmcData Player profile
* @param request Completed upgrade request * @param request Completed upgrade request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Upgrade wall status to visible in profile if medstation/water collector are both level 1 * Upgrade wall status to visible in profile if medstation/water collector are both level 1
* @param pmcData Player profile * @param pmcData Player profile
@ -222,14 +222,6 @@ export declare class HideoutController {
* @param output Output object to update * @param output Output object to update
*/ */
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void; protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): void;
/**
* Start area production for item by adding production to profiles' Hideout.Production array
* @param pmcData Player profile
* @param request Start production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Get quick time event list for hideout * Get quick time event list for hideout
* // TODO - implement this * // TODO - implement this
@ -244,7 +236,7 @@ export declare class HideoutController {
* @param pmcData Profile to adjust * @param pmcData Profile to adjust
* @param request QTE result object * @param request QTE result object
*/ */
handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse; handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData, output: IItemEventRouterResponse): void;
/** /**
* Record a high score from the shooting range into a player profiles overallcounters * Record a high score from the shooting range into a player profiles overallcounters
* @param sessionId Session id * @param sessionId Session id
@ -252,7 +244,7 @@ export declare class HideoutController {
* @param request shooting range score request * @param request shooting range score request
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse; recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): void;
/** /**
* Handle client/game/profile/items/moving - HideoutImproveArea * Handle client/game/profile/items/moving - HideoutImproveArea
* @param sessionId Session id * @param sessionId Session id

View File

@ -13,7 +13,10 @@ import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgre
import { PlayerRaidEndState } from "@spt-aki/models/enums/PlayerRaidEndState"; import { PlayerRaidEndState } from "@spt-aki/models/enums/PlayerRaidEndState";
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig"; import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig"; import { IBTRConfig } from "@spt-aki/models/spt/config/IBTRConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel"; import { ITraderServiceModel } from "@spt-aki/models/spt/services/ITraderServiceModel";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -56,6 +59,9 @@ export declare class InraidController {
protected btrConfig: IBTRConfig; protected btrConfig: IBTRConfig;
protected inRaidConfig: IInRaidConfig; protected inRaidConfig: IInRaidConfig;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil);
/** /**
* Save locationId to active profiles inraid object AND app context * Save locationId to active profiles inraid object AND app context
@ -104,6 +110,20 @@ export declare class InraidController {
* @param postRaidRequest Post-raid data of raid * @param postRaidRequest Post-raid data of raid
*/ */
protected savePlayerScavProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void; 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 * Does provided profile contain any condition counters
* @param profile Profile to check for condition counters * @param profile Profile to check for condition counters
@ -140,8 +160,9 @@ export declare class InraidController {
* Update profile with scav karma values based on in-raid actions * Update profile with scav karma values based on in-raid actions
* @param pmcData Pmc profile * @param pmcData Pmc profile
* @param offraidData Post-raid save request * @param offraidData Post-raid save request
* @param scavData Scav profile
*/ */
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData): void; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData): void;
/** /**
* Get the inraid config from configs/inraid.json * Get the inraid config from configs/inraid.json
* @returns InRaid Config * @returns InRaid Config
@ -166,4 +187,6 @@ export declare class InraidController {
* Handle singleplayer/traderServices/itemDelivery * Handle singleplayer/traderServices/itemDelivery
*/ */
itemDelivery(sessionId: string, traderId: string, items: Item[]): void; itemDelivery(sessionId: string, traderId: string, items: Item[]): void;
getTraitorScavHostileChance(url: string, sessionID: string): number;
getSandboxMaxPatrolValue(url: string, sessionID: string): number;
} }

View File

@ -27,6 +27,7 @@ import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/invento
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { ISetFavoriteItems } from "@spt-aki/models/eft/inventory/ISetFavoriteItems"; import { ISetFavoriteItems } from "@spt-aki/models/eft/inventory/ISetFavoriteItems";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
@ -67,55 +68,52 @@ export declare class InventoryController {
* @param pmcData Profile * @param pmcData Profile
* @param moveRequest Move request data * @param moveRequest Move request data
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Get a event router response with inventory trader message * Get a event router response with inventory trader message
* @param output Item event router response * @param output Item event router response
* @returns Item event router response * @returns Item event router response
*/ */
protected getTraderExploitErrorResponse(output: IItemEventRouterResponse): IItemEventRouterResponse; protected appendTraderExploitErrorResponse(output: IItemEventRouterResponse): void;
/**
* Remove Item from Profile
* Deep tree item deletion, also removes items from insurance list
*/
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Handle Remove event * Handle Remove event
* Implements functionality "Discard" from Main menu (Stash etc.) * Implements functionality "Discard" from Main menu (Stash etc.)
* Removes item from PMC Profile * Removes item from PMC Profile
*/ */
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; discardItem(pmcData: IPmcData, request: IInventoryRemoveRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Split Item * Split Item
* spliting 1 stack into 2 * spliting 1 stack into 2
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
* @param request Split request * @param request Split request
* @param sessionID Session/player id * @param sessionID Session/player id
* @param output Client response
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer') * Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer')
* Deletes item from `body.item` and adding number of stacks into `body.with` * Deletes item from `body.item` and adding number of stacks into `body.with`
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile) * @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
* @param body Merge request * @param body Merge request
* @param sessionID Player id * @param sessionID Player id
* @param output Client response
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* TODO: Adds no data to output to send to client, is this by design? * TODO: Adds no data to output to send to client, is this by design?
* TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc
* Transfer items from one stack into another while keeping original stack * Transfer items from one stack into another while keeping original stack
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload" * Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
* @param pmcData Player profile * @param pmcData Player profile
* @param body Transfer request * @param body Transfer request
* @param sessionID Session id * @param sessionID Session id
* @param output Client response
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
/** /**
* Swap Item * Swap Item
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment * its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
@ -125,7 +123,7 @@ export declare class InventoryController {
/** /**
* Handles folding of Weapons * Handles folding of Weapons
*/ */
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse; foldItem(pmcData: IPmcData, request: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Toggles "Toggleable" items like night vision goggles and face shields. * Toggles "Toggleable" items like night vision goggles and face shields.
* @param pmcData player profile * @param pmcData player profile
@ -150,25 +148,26 @@ export declare class InventoryController {
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse; bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): void;
/** /**
* Unbind an inventory item from quick access menu at bottom of player screen * Unbind an inventory item from quick access menu at bottom of player screen
* Handle unbind event * Handle unbind event
* @param pmcData Player profile * @param pmcData Player profile
* @param bindRequest Request object * @param bindRequest Request object
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
unbindItem(pmcData: IPmcData, request: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse; unbindItem(pmcData: IPmcData, request: IInventoryBindRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Handles examining an item * Handles examining an item
* @param pmcData player profile * @param pmcData player profile
* @param body request object * @param body request object
* @param sessionID session id * @param sessionID session id
* @param output Client response
* @returns response * @returns response
*/ */
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], fullProfile: IAkiProfile): void;
/** /**
* Get the tplid of an item from the examine request object * Get the tplid of an item from the examine request object
* @param request Response request * @param request Response request
@ -182,33 +181,33 @@ export declare class InventoryController {
* @param pmcData Player profile * @param pmcData Player profile
* @param request sort request * @param request sort request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse
*/ */
sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): void;
/** /**
* Add note to a map * Add note to a map
* @param pmcData Player profile * @param pmcData Player profile
* @param request Add marker request * @param request Add marker request
* @param sessionID Session id * @param sessionID Session id
* @param output Client response
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
createMapMarker(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Delete a map marker * Delete a map marker
* @param pmcData Player profile * @param pmcData Player profile
* @param request Delete marker request * @param request Delete marker request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
deleteMapMarker(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Edit an existing map marker * Edit an existing map marker
* @param pmcData Player profile * @param pmcData Player profile
* @param request Edit marker request * @param request Edit marker request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
editMapMarker(pmcData: IPmcData, request: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, request: IInventoryEditMarkerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Strip out characters from note string that are not: letter/numbers/unicode/spaces * Strip out characters from note string that are not: letter/numbers/unicode/spaces
* @param mapNoteText Marker text to sanitise * @param mapNoteText Marker text to sanitise
@ -219,11 +218,11 @@ export declare class InventoryController {
* Handle OpenRandomLootContainer event * Handle OpenRandomLootContainer event
* Handle event fired when a container is unpacked (currently only the halloween pumpkin) * Handle event fired when a container is unpacked (currently only the halloween pumpkin)
* @param pmcData Profile data * @param pmcData Profile data
* @param body open loot container request data * @param body Open loot container request data
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string, output: IItemEventRouterResponse): void;
redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): void;
setFavoriteItem(pmcData: IPmcData, request: ISetFavoriteItems, sessionId: string): IItemEventRouterResponse; setFavoriteItem(pmcData: IPmcData, request: ISetFavoriteItems, sessionId: string): void;
} }

View File

@ -13,6 +13,7 @@ import { LootRequest } from "@spt-aki/models/spt/services/LootRequest";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService";
import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil";
@ -28,6 +29,7 @@ export declare class LocationController {
protected locationGenerator: LocationGenerator; protected locationGenerator: LocationGenerator;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected raidTimeAdjustmentService: RaidTimeAdjustmentService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService;
protected itemFilterService: ItemFilterService;
protected lootGenerator: LootGenerator; protected lootGenerator: LootGenerator;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -35,7 +37,7 @@ export declare class LocationController {
protected applicationContext: ApplicationContext; protected applicationContext: ApplicationContext;
protected airdropConfig: IAirdropConfig; protected airdropConfig: IAirdropConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext); constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext);
/** /**
* Handle client/location/getLocalloot * Handle client/location/getLocalloot
* Get a location (map) with generated loot data * Get a location (map) with generated loot data

View File

@ -3,11 +3,9 @@ import { LootGenerator } from "@spt-aki/generators/LootGenerator";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData"; import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData"; import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse"; import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData"; import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData"; import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult"; import { IJoinMatchResult } from "@spt-aki/models/eft/match/IJoinMatchResult";
@ -48,10 +46,6 @@ export declare class MatchController {
protected pmcConfig: IPmcConfig; 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, 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);
getEnabled(): boolean; getEnabled(): boolean;
/** Handle raid/profile/list */
getProfile(info: IGetProfileRequestData): IPmcData[];
/** Handle client/match/group/create */
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
/** Handle client/match/group/delete */ /** Handle client/match/group/delete */
deleteGroup(info: any): void; deleteGroup(info: any): void;
/** Handle match/group/start_game */ /** Handle match/group/start_game */

View File

@ -1,8 +1,10 @@
import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
export declare class PresetController { export declare class PresetController {
protected logger: ILogger;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
constructor(presetHelper: PresetHelper, databaseServer: DatabaseServer); constructor(logger: ILogger, presetHelper: PresetHelper, databaseServer: DatabaseServer);
initialize(): void; initialize(): void;
} }

View File

@ -69,12 +69,6 @@ export declare class QuestController {
* @returns true = show to player * @returns true = show to player
*/ */
protected showEventQuestToPlayer(questId: string): boolean; protected showEventQuestToPlayer(questId: string): boolean;
/**
* Is the quest for the opposite side the player is on
* @param playerSide Player side (usec/bear)
* @param questId QuestId to check
*/
protected questIsForOtherSide(playerSide: string, questId: string): boolean;
/** /**
* Handle QuestAccept event * Handle QuestAccept event
* Handle the client accepting a quest and starting it * Handle the client accepting a quest and starting it
@ -114,6 +108,12 @@ export declare class QuestController {
* @returns ItemEvent client response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; 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 * Remove a quest entirely from a profile
* @param sessionId Player id * @param sessionId Player id
@ -191,5 +191,5 @@ export declare class QuestController {
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
} }

View File

@ -70,9 +70,17 @@ export declare class RagfairController {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Handles client/ragfair/find
* Returns flea offers that match required search parameters
* @param sessionID Player id
* @param searchRequest Search request data
* @returns IGetOffersResult
*/
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult; getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/** /**
* Handle client/ragfair/offer/findbyid * Handle client/ragfair/offer/findbyid
* Occurs when searching for `#x` on flea
* @param sessionId Player id * @param sessionId Player id
* @param request Request data * @param request Request data
* @returns IRagfairOffer * @returns IRagfairOffer
@ -81,7 +89,7 @@ export declare class RagfairController {
/** /**
* Get offers for the client based on type of search being performed * Get offers for the client based on type of search being performed
* @param searchRequest Client search request data * @param searchRequest Client search request data
* @param itemsToAdd comes from ragfairHelper.filterCategories() * @param itemsToAdd Comes from ragfairHelper.filterCategories()
* @param traderAssorts Trader assorts * @param traderAssorts Trader assorts
* @param pmcProfile Player profile * @param pmcProfile Player profile
* @returns array of offers * @returns array of offers
@ -90,7 +98,7 @@ export declare class RagfairController {
/** /**
* Get categories for the type of search being performed, linked/required/all * Get categories for the type of search being performed, linked/required/all
* @param searchRequest Client search request data * @param searchRequest Client search request data
* @param offers ragfair offers to get categories for * @param offers Ragfair offers to get categories for
* @returns record with templates + counts * @returns record with templates + counts
*/ */
protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>; protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
@ -101,16 +109,26 @@ export declare class RagfairController {
protected addIndexValueToOffers(offers: IRagfairOffer[]): void; protected addIndexValueToOffers(offers: IRagfairOffer[]): void;
/** /**
* Update a trader flea offer with buy restrictions stored in the traders assort * Update a trader flea offer with buy restrictions stored in the traders assort
* @param offer flea offer to update * @param offer Flea offer to update
* @param profile full profile of player * @param fullProfile Players full profile
*/ */
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void; protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, fullProfile: IAkiProfile): void;
/** /**
* Adjust ragfair offer stack count to match same value as traders assort stack count * Adjust ragfair offer stack count to match same value as traders assort stack count
* @param offer Flea offer to adjust * @param offer Flea offer to adjust stack size of
*/ */
protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected setTraderOfferStackSize(offer: IRagfairOffer): void;
/**
* Is the flea search being performed a 'linked' search type
* @param info Search request
* @returns True if it is a 'linked' search type
*/
protected isLinkedSearch(info: ISearchRequestData): boolean; protected isLinkedSearch(info: ISearchRequestData): boolean;
/**
* Is the flea search being performed a 'required' search type
* @param info Search request
* @returns True if it is a 'required' search type
*/
protected isRequiredSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean;
/** /**
* Check all profiles and sell player offers / send player money for listing if it sold * Check all profiles and sell player offers / send player money for listing if it sold
@ -165,7 +183,7 @@ export declare class RagfairController {
items: Item[] | null; items: Item[] | null;
errorMessage: string | null; errorMessage: string | null;
}; };
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer;
getAllFleaPrices(): Record<string, number>; getAllFleaPrices(): Record<string, number>;
getStaticPrices(): Record<string, number>; getStaticPrices(): Record<string, number>;
/** /**

View File

@ -1,3 +1,4 @@
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
@ -20,8 +21,9 @@ export declare class RepairController {
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected repairHelper: RepairHelper; protected repairHelper: RepairHelper;
protected repairService: RepairService; protected repairService: RepairService;
protected profileHelper: ProfileHelper;
protected repairConfig: IRepairConfig; protected repairConfig: IRepairConfig;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService); constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService, profileHelper: ProfileHelper);
/** /**
* Handle TraderRepair event * Handle TraderRepair event
* Repair with trader * Repair with trader

View File

@ -1,13 +1,13 @@
import { RepeatableQuestGenerator } from "@spt-aki/generators/RepeatableQuestGenerator"; import { RepeatableQuestGenerator } from "@spt-aki/generators/RepeatableQuestGenerator";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper"; import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IRepeatableQuestChangeRequest } from "@spt-aki/models/eft/quests/IRepeatableQuestChangeRequest"; import { IRepeatableQuestChangeRequest } from "@spt-aki/models/eft/quests/IRepeatableQuestChangeRequest";
import { ELocationName } from "@spt-aki/models/enums/ELocationName";
import { IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -30,7 +30,6 @@ export declare class RepeatableQuestController {
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService; protected profileFixerService: ProfileFixerService;
protected ragfairServerHelper: RagfairServerHelper;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected objectId: ObjectId; protected objectId: ObjectId;
@ -39,7 +38,7 @@ export declare class RepeatableQuestController {
protected questHelper: QuestHelper; protected questHelper: QuestHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, eventOutputHolder: EventOutputHolder, paymentService: PaymentService, objectId: ObjectId, repeatableQuestGenerator: RepeatableQuestGenerator, repeatableQuestHelper: RepeatableQuestHelper, questHelper: QuestHelper, configServer: ConfigServer);
/** /**
* Handle client/repeatalbeQuests/activityPeriods * Handle client/repeatalbeQuests/activityPeriods
* Returns an array of objects in the format of repeatable quests to the client. * Returns an array of objects in the format of repeatable quests to the client.
@ -95,6 +94,20 @@ export declare class RepeatableQuestController {
*/ */
protected generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; protected generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool;
protected createBaseQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; protected createBaseQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool;
/**
* Return the locations this PMC is allowed to get daily quests for based on their level
* @param locations The original list of locations
* @param pmcLevel The level of the player PMC
* @returns A filtered list of locations that allow the player PMC level to access it
*/
protected getAllowedLocations(locations: Record<ELocationName, string[]>, pmcLevel: number): Partial<Record<ELocationName, string[]>>;
/**
* Return true if the given pmcLevel is allowed on the given location
* @param location The location name to check
* @param pmcLevel The level of the pmc
* @returns True if the given pmc level is allowed to access the given location
*/
protected isPmcLevelAllowedOnLocation(location: string, pmcLevel: number): boolean;
debugLogRepeatableQuestIds(pmcData: IPmcData): void; debugLogRepeatableQuestIds(pmcData: IPmcData): void;
/** /**
* Handle RepeatableQuestChange event * Handle RepeatableQuestChange event

View File

@ -3,14 +3,18 @@ import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { ITraderAssort, ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader"; import { ITraderAssort, ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { FenceService } from "@spt-aki/services/FenceService"; import { FenceService } from "@spt-aki/services/FenceService";
import { TraderAssortService } from "@spt-aki/services/TraderAssortService"; import { TraderAssortService } from "@spt-aki/services/TraderAssortService";
import { TraderPurchasePersisterService } from "@spt-aki/services/TraderPurchasePersisterService"; import { TraderPurchasePersisterService } from "@spt-aki/services/TraderPurchasePersisterService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class TraderController { export declare class TraderController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected traderAssortHelper: TraderAssortHelper; protected traderAssortHelper: TraderAssortHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -20,10 +24,12 @@ export declare class TraderController {
protected fenceService: FenceService; protected fenceService: FenceService;
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil, configServer: ConfigServer);
/** /**
* Runs when onLoad event is fired * Runs when onLoad event is fired
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService
* Store timestamp of next assort refresh in nextResupply property of traders .base object * Store timestamp of next assort refresh in nextResupply property of traders .base object
*/ */
load(): void; load(): void;

View File

@ -21,7 +21,7 @@ export declare class DynamicRouter extends Router {
getHandledRoutes(): HandledRoute[]; getHandledRoutes(): HandledRoute[];
} }
export declare class ItemEventRouterDefinition extends Router { export declare class ItemEventRouterDefinition extends Router {
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse; handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string, output: IItemEventRouterResponse): void;
} }
export declare class SaveLoadRouter extends Router { export declare class SaveLoadRouter extends Router {
handleLoad(profile: IAkiProfile): IAkiProfile; handleLoad(profile: IAkiProfile): IAkiProfile;

View File

@ -4,7 +4,7 @@ import { BotDifficultyHelper } from "@spt-aki/helpers/BotDifficultyHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper"; import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Health as PmcHealth, IBaseJsonSkills, IBaseSkill, IBotBase, Info, Skills as botSkills } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Appearance, Health, IBotType } from "@spt-aki/models/eft/common/tables/IBotType"; import { Appearance, Health, IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "@spt-aki/models/spt/bots/BotGenerationDetails"; import { BotGenerationDetails } from "@spt-aki/models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";

View File

@ -1,7 +1,8 @@
import { BotWeaponGenerator } from "@spt-aki/generators/BotWeaponGenerator"; import { BotWeaponGenerator } from "@spt-aki/generators/BotWeaponGenerator";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper"; import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper"; import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Inventory as PmcInventory } from "@spt-aki/models/eft/common/tables/IBotBase";
@ -9,6 +10,7 @@ import { IBotType, Inventory, ModsChances } from "@spt-aki/models/eft/common/tab
import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots"; import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots";
import { IItemSpawnLimitSettings } from "@spt-aki/models/spt/bots/IItemSpawnLimitSettings";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -17,24 +19,28 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService"; import { BotLootCacheService } from "@spt-aki/services/BotLootCacheService";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BotLootGenerator { export declare class BotLootGenerator {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected jsonUtil: JsonUtil;
protected inventoryHelper: InventoryHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGenerator: BotWeaponGenerator;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected weightedRandomHelper: WeightedRandomHelper; protected weightedRandomHelper: WeightedRandomHelper;
protected botHelper: BotHelper;
protected botLootCacheService: BotLootCacheService; protected botLootCacheService: BotLootCacheService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, jsonUtil: JsonUtil, inventoryHelper: InventoryHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
protected getItemSpawnLimitsForBot(botRole: string): IItemSpawnLimitSettings;
/** /**
* Add loot to bots containers * Add loot to bots containers
* @param sessionId Session id * @param sessionId Session id
@ -67,23 +73,25 @@ export declare class BotLootGenerator {
protected getRandomisedCount(min: number, max: number, nValue: number): 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 * 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 * @param pool Pool of items to pick from with weight
* @param equipmentSlots What equipment slot will the loot items be added to * @param equipmentSlots What equipment slot will the loot items be added to
* @param totalItemCount Max count of items to add * @param totalItemCount Max count of items to add
* @param inventoryToAddItemsTo Bot inventory loot will be added to * @param inventoryToAddItemsTo Bot inventory loot will be added to
* @param botRole Role of the bot loot is being generated for (assault/pmcbot) * @param botRole Role of the bot loot is being generated for (assault/pmcbot)
* @param useLimits Should item limit counts be used as defined in config/bot.json * @param itemSpawnLimits Item spawn limits the bot must adhere to
* @param totalValueLimitRub Total value of loot allowed in roubles * @param totalValueLimitRub Total value of loot allowed in roubles
* @param isPmc Is bot being generated for a pmc * @param isPmc Is bot being generated for a pmc
*/ */
protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void; protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
protected createWalletLoot(walletId: string): Item[][];
/** /**
* Some items need child items to function, add them to the itemToAddChildrenTo array * Some items need child items to function, add them to the itemToAddChildrenTo array
* @param itemToAddTemplate Db template of item to check * @param itemToAddTemplate Db template of item to check
* @param itemToAddChildrenTo Item to add children to * @param itemToAddChildrenTo Item to add children to
* @param isPmc Is the item being generated for a pmc (affects money/ammo stack sizes) * @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): void; protected addRequiredChildItemsToParent(itemToAddTemplate: ITemplateItem, itemToAddChildrenTo: Item[], isPmc: boolean, botRole: string): void;
/** /**
* Add generated weapons to inventory as loot * Add generated weapons to inventory as loot
* @param botInventory inventory to add preset to * @param botInventory inventory to add preset to
@ -94,44 +102,28 @@ export declare class BotLootGenerator {
* @param isPmc are we generating for a pmc * @param isPmc are we generating for a pmc
*/ */
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void; protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
/**
* Get a random item from the pool parameter using the biasedRandomNumber system
* @param pool Pool of items to pick an item from
* @param isPmc Is the bot being created a pmc
* @returns ITemplateItem object
*/
protected getRandomItemFromPoolByBotRole(pool: ITemplateItem[], botRole: string): ITemplateItem;
/**
* Get the loot nvalue from botconfig
* @param botRole Role of bot e.g. assault/bosstagilla/sptBear
* @returns nvalue as number
*/
protected getBotLootNValueByRole(botRole: string): number;
/** /**
* Hydrate item limit array to contain items that have a limit for a specific bot type * Hydrate item limit array to contain items that have a limit for a specific bot type
* All values are set to 0 * All values are set to 0
* @param isPmc Is the bot a pmc
* @param botRole Role the bot has * @param botRole Role the bot has
* @param limitCount * @param limitCount
*/ */
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void; protected initItemLimitArray(botRole: string, limitCount: Record<string, number>): void;
/** /**
* Check if an item has reached its bot-specific spawn limit * Check if an item has reached its bot-specific spawn limit
* @param itemTemplate Item we check to see if its reached spawn limit * @param itemTemplate Item we check to see if its reached spawn limit
* @param botRole Bot type * @param botRole Bot type
* @param isPmc Is bot we're working with a pmc * @param itemSpawnLimits
* @param limitCount Spawn limits for items on bot
* @param itemSpawnLimits The limits this bot is allowed to have
* @returns true if item has reached spawn limit * @returns true if item has reached spawn limit
*/ */
protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record<string, number>, itemSpawnLimits: Record<string, number>): boolean; protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, itemSpawnLimits: IItemSpawnLimitSettings): boolean;
/** /**
* Randomise the stack size of a money object, uses different values for pmc or scavs * Randomise the stack size of a money object, uses different values for pmc or scavs
* @param isPmc Is money on a PMC bot * @param botRole Role bot has that has money stack
* @param itemTemplate item details from db * @param itemTemplate item details from db
* @param moneyItem Money item to randomise * @param moneyItem Money item to randomise
*/ */
protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void; protected randomiseMoneyStackSize(botRole: string, itemTemplate: ITemplateItem, moneyItem: Item): void;
/** /**
* Randomise the size of an ammo stack * Randomise the size of an ammo stack
* @param isPmc Is ammo on a PMC bot * @param isPmc Is ammo on a PMC bot
@ -142,11 +134,10 @@ export declare class BotLootGenerator {
/** /**
* Get spawn limits for a specific bot type from bot.json config * 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 * If no limit found for a non pmc bot, fall back to defaults
* @param isPmc is the bot we want limits for a pmc
* @param botRole what role does the bot have * @param botRole what role does the bot have
* @returns Dictionary of tplIds and limit * @returns Dictionary of tplIds and limit
*/ */
protected getItemSpawnLimitsForBotType(isPmc: boolean, botRole: string): Record<string, number>; protected getItemSpawnLimitsForBotType(botRole: string): Record<string, number>;
/** /**
* Get the parentId or tplId of item inside spawnLimits object if it exists * Get the parentId or tplId of item inside spawnLimits object if it exists
* @param itemTemplate item we want to look for in spawn limits * @param itemTemplate item we want to look for in spawn limits

View File

@ -28,6 +28,8 @@ export declare class FenceBaseAssortGenerator {
* Create base fence assorts dynamically and store in memory * Create base fence assorts dynamically and store in memory
*/ */
generateFenceBaseAssorts(): void; generateFenceBaseAssorts(): void;
protected getItemPrice(itemTpl: string, items: Item[]): number;
protected getAmmoBoxPrice(items: Item[]): number;
/** /**
* Add soft inserts + armor plates to an armor * Add soft inserts + armor plates to an armor
* @param armor Armor item array to add mods into * @param armor Armor item array to add mods into

View File

@ -4,6 +4,7 @@ import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
/** /**
* Handle the generation of dynamic PMC loot in pockets and backpacks * Handle the generation of dynamic PMC loot in pockets and backpacks
@ -14,22 +15,23 @@ export declare class PMCLootGenerator {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected ragfairPriceService: RagfairPriceService;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected pocketLootPool: string[]; protected pocketLootPool: Record<string, number>;
protected vestLootPool: string[]; protected vestLootPool: Record<string, number>;
protected backpackLootPool: string[]; protected backpackLootPool: Record<string, number>;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService);
/** /**
* Create an array of loot items a PMC can have in their pockets * Create an array of loot items a PMC can have in their pockets
* @returns string array of tpls * @returns string array of tpls
*/ */
generatePMCPocketLootPool(): string[]; generatePMCPocketLootPool(botRole: string): Record<string, number>;
/** /**
* Create an array of loot items a PMC can have in their vests * Create an array of loot items a PMC can have in their vests
* @returns string array of tpls * @returns string array of tpls
*/ */
generatePMCVestLootPool(): string[]; generatePMCVestLootPool(botRole: string): Record<string, number>;
/** /**
* Check if item has a width/height that lets it fit into a 2x2 slot * Check if item has a width/height that lets it fit into a 2x2 slot
* 1x1 / 1x2 / 2x1 / 2x2 * 1x1 / 1x2 / 2x1 / 2x2
@ -41,5 +43,12 @@ export declare class PMCLootGenerator {
* Create an array of loot items a PMC can have in their backpack * Create an array of loot items a PMC can have in their backpack
* @returns string array of tpls * @returns string array of tpls
*/ */
generatePMCBackpackLootPool(): string[]; generatePMCBackpackLootPool(botRole: string): Record<string, number>;
/**
* Find the greated common divisor of all weights and use it on the passed in dictionary
* @param weightedDict
*/
protected reduceWeightValues(weightedDict: Record<string, number>): void;
protected commonDivisor(numbers: number[]): number;
protected gcd(a: number, b: number): number;
} }

View File

@ -1,11 +1,10 @@
import { BotGenerator } from "@spt-aki/generators/BotGenerator"; import { BotGenerator } from "@spt-aki/generators/BotGenerator";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper"; import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotHelper } from "@spt-aki/helpers/BotHelper"; import { BotHelper } from "@spt-aki/helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { Skills, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IBotBase, Skills, Stats } from "@spt-aki/models/eft/common/tables/IBotBase";
import { IBotType } from "@spt-aki/models/eft/common/tables/IBotType"; import { IBotType } from "@spt-aki/models/eft/common/tables/IBotType";
import { IPlayerScavConfig, KarmaLevel } from "@spt-aki/models/spt/config/IPlayerScavConfig"; import { IPlayerScavConfig, KarmaLevel } from "@spt-aki/models/spt/config/IPlayerScavConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -24,7 +23,6 @@ export declare class PlayerScavGenerator {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -36,13 +34,20 @@ export declare class PlayerScavGenerator {
protected botGenerator: BotGenerator; protected botGenerator: BotGenerator;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected playerScavConfig: IPlayerScavConfig; protected playerScavConfig: IPlayerScavConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
/** /**
* Update a player profile to include a new player scav profile * Update a player profile to include a new player scav profile
* @param sessionID session id to specify what profile is updated * @param sessionID session id to specify what profile is updated
* @returns profile object * @returns profile object
*/ */
generate(sessionID: string): IPmcData; generate(sessionID: string): IPmcData;
/**
* Add items picked from `playerscav.lootItemsToAddChancePercent`
* @param possibleItemsToAdd dict of tpl + % chance to be added
* @param scavData
* @param containersToAddTo Possible slotIds to add loot to
*/
protected addAdditionalLootToPlayerScavContainers(possibleItemsToAdd: Record<string, number>, scavData: IBotBase, containersToAddTo: string[]): void;
/** /**
* Get the scav karama level for a profile * Get the scav karama level for a profile
* Is also the fence trader rep level * Is also the fence trader rep level

View File

@ -1,54 +1,34 @@
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { RepeatableQuestRewardGenerator } from "@spt-aki/generators/RepeatableQuestRewardGenerator";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper"; import { RepeatableQuestHelper } from "@spt-aki/helpers/RepeatableQuestHelper";
import { Exit } from "@spt-aki/models/eft/common/ILocationBase"; import { Exit } from "@spt-aki/models/eft/common/ILocationBase";
import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase"; import { TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IQuestCondition, IQuestConditionCounterCondition } from "@spt-aki/models/eft/common/tables/IQuest";
import { IQuestCondition, IQuestConditionCounterCondition, IQuestReward, IQuestRewards } from "@spt-aki/models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IBaseQuestConfig, IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool"; import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PaymentService } from "@spt-aki/services/PaymentService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId"; import { ObjectId } from "@spt-aki/utils/ObjectId";
import { ProbabilityObjectArray, RandomUtil } from "@spt-aki/utils/RandomUtil"; import { ProbabilityObjectArray, RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class RepeatableQuestGenerator { export declare class RepeatableQuestGenerator {
protected timeUtil: TimeUtil;
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected httpResponse: HttpResponseUtil;
protected mathUtil: MathUtil; protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService;
protected handbookHelper: HandbookHelper;
protected ragfairServerHelper: RagfairServerHelper;
protected eventOutputHolder: EventOutputHolder;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected paymentService: PaymentService;
protected objectId: ObjectId; protected objectId: ObjectId;
protected itemFilterService: ItemFilterService;
protected repeatableQuestHelper: RepeatableQuestHelper; protected repeatableQuestHelper: RepeatableQuestHelper;
protected repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, repeatableQuestHelper: RepeatableQuestHelper, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer);
/** /**
* This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest * It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
@ -125,7 +105,7 @@ export declare class RepeatableQuestGenerator {
/** /**
* Filter a maps exits to just those for the desired side * Filter a maps exits to just those for the desired side
* @param locationKey Map id (e.g. factory4_day) * @param locationKey Map id (e.g. factory4_day)
* @param playerSide Scav/Bear * @param playerSide Scav/Pmc
* @returns Array of Exit objects * @returns Array of Exit objects
*/ */
protected getLocationExitsForSide(locationKey: string, playerSide: string): Exit[]; protected getLocationExitsForSide(locationKey: string, playerSide: string): Exit[];
@ -144,71 +124,6 @@ export declare class RepeatableQuestGenerator {
* @returns {object} Exit condition * @returns {object} Exit condition
*/ */
protected generateExplorationExitCondition(exit: Exit): IQuestConditionCounterCondition; protected generateExplorationExitCondition(exit: Exit): IQuestConditionCounterCondition;
/**
* Generate the reward for a mission. A reward can consist of
* - Experience
* - Money
* - Items
* - Trader Reputation
*
* 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.
*
* 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
*/
protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards;
protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void;
protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number;
/**
* Should reward item have stack size increased (25% chance)
* @param item Item to possibly increase stack size of
* @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking
* @returns True if it should
*/
protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean;
/**
* Get a randomised number a reward items stack size should be based on its handbook price
* @param item Reward item to get stack size for
* @returns Stack size value
*/
protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number;
/**
* Select a number of items that have a colelctive value of the passed in parameter
* @param repeatableConfig Config
* @param roublesBudget Total value of items to return
* @returns Array of reward items that fit budget
*/
protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[];
/**
* Helper to create a reward item structured as required by the client
*
* @param {string} tpl ItemId of the rewarded item
* @param {integer} value Amount of items to give
* @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index
* @returns {object} Object of "Reward"-item-type
*/
protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward;
/**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @param repeatableQuestConfig Config file
* @returns List of rewardable items [[_tpl, itemTemplate],...]
*/
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][];
/**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {string} tpl template id of item to check
* @returns True if item is valid reward
*/
protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean;
/** /**
* Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json * 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 * The templates include Elimination, Completion and Extraction quest types

View File

@ -0,0 +1,106 @@
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { IQuestReward, IQuestRewards } from "@spt-aki/models/eft/common/tables/IQuest";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class RepeatableQuestRewardGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected handbookHelper: HandbookHelper;
protected localisationService: LocalisationService;
protected objectId: ObjectId;
protected itemFilterService: ItemFilterService;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Generate the reward for a mission. A reward can consist of
* - Experience
* - Money
* - Items
* - Trader Reputation
*
* 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.
*
* 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
*/
generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards;
/**
* @param rewardItems List of reward items to filter
* @param roublesBudget The budget remaining for rewards
* @param minPrice The minimum priced item to include
* @returns True if any items remain in `rewardItems`, false otherwise
*/
protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[];
/**
* Get a randomised number a reward items stack size should be based on its handbook price
* @param item Reward item to get stack size for
* @returns Stack size value
*/
protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number;
/**
* Should reward item have stack size increased (25% chance)
* @param item Item to possibly increase stack size of
* @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking
* @returns True if it should
*/
protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean;
protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number;
/**
* Select a number of items that have a colelctive value of the passed in parameter
* @param repeatableConfig Config
* @param roublesBudget Total value of items to return
* @returns Array of reward items that fit budget
*/
protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[];
/**
* Helper to create a reward item structured as required by the client
*
* @param {string} tpl ItemId of the rewarded item
* @param {integer} value Amount of items to give
* @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index
* @returns {object} Object of "Reward"-item-type
*/
protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward;
/**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @param repeatableQuestConfig Config file
* @returns List of rewardable items [[_tpl, itemTemplate],...]
*/
getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][];
/**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {string} tpl template id of item to check
* @returns True if item is valid reward
*/
protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean;
protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void;
}

View File

@ -10,6 +10,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil";
@ -25,12 +26,13 @@ export declare class ScavCaseRewardGenerator {
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected seasonalEventService: SeasonalEventService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected scavCaseConfig: IScavCaseConfig; protected scavCaseConfig: IScavCaseConfig;
protected dbItemsCache: ITemplateItem[]; protected dbItemsCache: ITemplateItem[];
protected dbAmmoItemsCache: ITemplateItem[]; protected dbAmmoItemsCache: ITemplateItem[];
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Create an array of rewards that will be given to the player upon completing their scav case build * Create an array of rewards that will be given to the player upon completing their scav case build
* @param recipeId recipe of the scav case craft * @param recipeId recipe of the scav case craft

View File

@ -29,13 +29,13 @@ export declare class WeatherGenerator {
* @param currentDate current date * @param currentDate current date
* @returns formatted time * @returns formatted time
*/ */
protected getBsgFormattedInRaidTime(currentDate: Date): string; protected getBsgFormattedInRaidTime(): string;
/** /**
* Get the current in-raid time * Get the current in-raid time
* @param currentDate (new Date()) * @param currentDate (new Date())
* @returns Date object of current in-raid time * @returns Date object of current in-raid time
*/ */
getInRaidTime(currentDate: Date): Date; getInRaidTime(): Date;
/** /**
* Get current time formatted to fit BSGs requirement * Get current time formatted to fit BSGs requirement
* @param date date to format into bsg style * @param date date to format into bsg style

View File

@ -1,5 +1,6 @@
import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen"; import { IInventoryMagGen } from "@spt-aki/generators/weapongen/IInventoryMagGen";
import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen"; import { InventoryMagGen } from "@spt-aki/generators/weapongen/InventoryMagGen";
import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper"; import { BotWeaponGeneratorHelper } from "@spt-aki/helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
@ -11,8 +12,9 @@ export declare class ExternalInventoryMagGen implements IInventoryMagGen {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
constructor(logger: ILogger, itemHelper: ItemHelper, localisationService: LocalisationService, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, randomUtil: RandomUtil); constructor(logger: ILogger, itemHelper: ItemHelper, localisationService: LocalisationService, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
getPriority(): number; getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean; canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void; process(inventoryMagGen: InventoryMagGen): void;

View File

@ -1,8 +1,12 @@
import { ApplicationContext } from "@spt-aki/context/ApplicationContext"; import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { ContainerHelper } from "@spt-aki/helpers/ContainerHelper";
import { DurabilityLimitsHelper } from "@spt-aki/helpers/DurabilityLimitsHelper"; import { DurabilityLimitsHelper } from "@spt-aki/helpers/DurabilityLimitsHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { Grid, ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { ItemAddedResult } from "@spt-aki/models/enums/ItemAddedResult";
import { IChooseRandomCompatibleModResult } from "@spt-aki/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt-aki/models/spt/bots/IChooseRandomCompatibleModResult";
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt-aki/models/spt/config/IBotConfig"; import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt-aki/models/spt/config/IBotConfig";
import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig";
@ -10,7 +14,6 @@ import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class BotGeneratorHelper { export declare class BotGeneratorHelper {
protected logger: ILogger; protected logger: ILogger;
@ -18,12 +21,14 @@ export declare class BotGeneratorHelper {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected durabilityLimitsHelper: DurabilityLimitsHelper; protected durabilityLimitsHelper: DurabilityLimitsHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected inventoryHelper: InventoryHelper;
protected containerHelper: ContainerHelper;
protected applicationContext: ApplicationContext; protected applicationContext: ApplicationContext;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, applicationContext: ApplicationContext, localisationService: LocalisationService, configServer: ConfigServer);
/** /**
* Adds properties to an item * Adds properties to an item
* e.g. Repairable / HasHinge / Foldable / MaxDurability * e.g. Repairable / HasHinge / Foldable / MaxDurability
@ -78,15 +83,21 @@ export declare class BotGeneratorHelper {
* @returns Equipment role (e.g. pmc / assault / bossTagilla) * @returns Equipment role (e.g. pmc / assault / bossTagilla)
*/ */
getBotEquipmentRole(botRole: string): string; getBotEquipmentRole(botRole: string): string;
} /**
/** TODO - move into own class */ * Adds an item with all its children into specified equipmentSlots, wherever it fits.
export declare class ExhaustableArray<T> { * @param equipmentSlots Slot to add item+children into
private itemPool; * @param rootItemId Root item id to use as mod items parentid
private randomUtil; * @param rootItemTplId Root itms tpl id
private jsonUtil; * @param itemWithChildren Item to add
private pool; * @param inventory Inventory to add item+children into
constructor(itemPool: T[], randomUtil: RandomUtil, jsonUtil: JsonUtil); * @returns ItemAddedResult result object
getRandomValue(): T; */
getFirstValue(): T; addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
hasValues(): boolean; /**
* 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;
} }

View File

@ -1,13 +1,11 @@
import { ContainerHelper } from "@spt-aki/helpers/ContainerHelper"; import { BotGeneratorHelper } from "@spt-aki/helpers/BotGeneratorHelper";
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase";
import { GenerationData } from "@spt-aki/models/eft/common/tables/IBotType"; import { GenerationData } from "@spt-aki/models/eft/common/tables/IBotType";
import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { Grid, ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots"; import { EquipmentSlots } from "@spt-aki/models/enums/EquipmentSlots";
import { ItemAddedResult } from "@spt-aki/models/enums/ItemAddedResult";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
@ -19,11 +17,10 @@ export declare class BotWeaponGeneratorHelper {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected inventoryHelper: InventoryHelper;
protected weightedRandomHelper: WeightedRandomHelper; protected weightedRandomHelper: WeightedRandomHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected containerHelper: ContainerHelper; constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, localisationService: LocalisationService);
constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
/** /**
* Get a randomized number of bullets for a specific magazine * Get a randomized number of bullets for a specific magazine
* @param magCounts Weights of magazines * @param magCounts Weights of magazines
@ -65,22 +62,4 @@ export declare class BotWeaponGeneratorHelper {
* @returns tpl of magazine * @returns tpl of magazine
*/ */
getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string; getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string;
/**
* TODO - move into BotGeneratorHelper, this is not the class for it
* Adds an item with all its children into specified equipmentSlots, wherever it fits.
* @param equipmentSlots Slot to add item+children into
* @param rootItemId Root item id to use as mod items parentid
* @param rootItemTplId Root itms tpl id
* @param itemWithChildren Item to add
* @param inventory Inventory to add item+children into
* @returns ItemAddedResult result object
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): 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;
} }

View File

@ -3,6 +3,7 @@ import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig";
import { IWeatherConfig } from "@spt-aki/models/spt/config/IWeatherConfig";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { GiftService } from "@spt-aki/services/GiftService"; import { GiftService } from "@spt-aki/services/GiftService";
import { MailSendService } from "@spt-aki/services/MailSendService"; import { MailSendService } from "@spt-aki/services/MailSendService";
@ -14,6 +15,7 @@ export declare class SptDialogueChatBot implements IDialogueChatBot {
protected giftService: GiftService; protected giftService: GiftService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected weatherConfig: IWeatherConfig;
constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer);
getChatBot(): IUserDialogInfo; getChatBot(): IUserDialogInfo;
/** /**

View File

@ -10,6 +10,7 @@ import { IHideoutProduction } from "@spt-aki/models/eft/hideout/IHideoutProducti
import { IHideoutSingleProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "@spt-aki/models/eft/hideout/IHideoutSingleProductionStartRequestData";
import { IHideoutTakeProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutTakeProductionRequestData } from "@spt-aki/models/eft/hideout/IHideoutTakeProductionRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig"; import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
@ -19,6 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PlayerService } from "@spt-aki/services/PlayerService"; import { PlayerService } from "@spt-aki/services/PlayerService";
import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class HideoutHelper { export declare class HideoutHelper {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +35,7 @@ export declare class HideoutHelper {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected jsonUtil: JsonUtil;
static bitcoinFarm: string; static bitcoinFarm: string;
static bitcoinProductionId: string; static bitcoinProductionId: string;
static waterCollector: string; static waterCollector: string;
@ -40,7 +43,7 @@ export declare class HideoutHelper {
static expeditionaryFuelTank: string; static expeditionaryFuelTank: string;
static maxSkillPoint: number; static maxSkillPoint: number;
protected hideoutConfig: IHideoutConfig; protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, itemHelper: ItemHelper, configServer: ConfigServer, jsonUtil: JsonUtil);
/** /**
* Add production to profiles' Hideout.Production array * Add production to profiles' Hideout.Production array
* @param pmcData Profile to add production to * @param pmcData Profile to add production to
@ -82,6 +85,16 @@ export declare class HideoutHelper {
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/**
* Iterate over productions and update their progress timers
* @param pmcData Profile to check for productions and update
* @param hideoutProperties Hideout properties
*/
protected updateProductionTimers(pmcData: IPmcData, hideoutProperties: {
btcFarmCGs: number;
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
}): void;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -93,16 +106,6 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
/**
* Iterate over productions and update their progress timers
* @param pmcData Profile to check for productions and update
* @param hideoutProperties Hideout properties
*/
protected updateProductionTimers(pmcData: IPmcData, hideoutProperties: {
btcFarmCGs: number;
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
}): void;
/** /**
* Update a productions progress value based on the amount of time that has passed * Update a productions progress value based on the amount of time that has passed
* @param pmcData Player profile * @param pmcData Player profile
@ -147,7 +150,19 @@ export declare class HideoutHelper {
* @param isGeneratorOn Is the generator turned on since last update * @param isGeneratorOn Is the generator turned on since last update
*/ */
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, hideoutProperties: {
btcFarmCGs: number;
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
}): void;
/**
* Get craft time and make adjustments to account for dev profile + crafting skill level
* @param pmcData Player profile making craft
* @param recipeId Recipe being crafted
* @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation
* @returns Items craft time with bonuses subtracted
*/
protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update
@ -163,9 +178,9 @@ export declare class HideoutHelper {
* @param totalProductionTime Total time collecting water * @param totalProductionTime Total time collecting water
* @param productionProgress how far water collector has progressed * @param productionProgress how far water collector has progressed
* @param baseFilterDrainRate Base drain rate * @param baseFilterDrainRate Base drain rate
* @returns * @returns drain rate (adjusted)
*/ */
protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; protected getTimeAdjustedWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number;
/** /**
* Get the water filter drain rate based on hideout bonues player has * Get the water filter drain rate based on hideout bonues player has
* @param pmcData Player profile * @param pmcData Player profile
@ -185,7 +200,7 @@ export declare class HideoutHelper {
* @param resourceUnitsConsumed * @param resourceUnitsConsumed
* @returns Upd * @returns Upd
*/ */
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd;
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void;
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
/** /**
@ -220,12 +235,21 @@ export declare class HideoutHelper {
*/ */
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
/** /**
* Adjust craft time based on crafting skill level found in player profile * Get a multipler based on players skill level and value per level
* @param pmcData Player profile
* @param skill Player skill from profile
* @param valuePerLevel Value from globals.config.SkillsSettings - `PerLevel`
* @returns Multipler from 0 to 1
*/
protected getSkillBonusMultipliedBySkillLevel(pmcData: IPmcData, skill: SkillTypes, valuePerLevel: number): number;
/**
* @param pmcData Player profile * @param pmcData Player profile
* @param productionTime Time to complete hideout craft in seconds * @param productionTime Time to complete hideout craft in seconds
* @returns Adjusted craft time in seconds * @param skill Skill bonus to get reduction from
* @param amountPerLevel Skill bonus amount to apply
* @returns Seconds to reduce craft time by
*/ */
protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number; getSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number, skill: SkillTypes, amountPerLevel: number): number;
isProduction(productive: Productive): productive is Production; isProduction(productive: Productive): productive is Production;
/** /**
* Gather crafted BTC from hideout area and add to inventory * Gather crafted BTC from hideout area and add to inventory

View File

@ -3,7 +3,7 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; import { QuestHelper } from "@spt-aki/helpers/QuestHelper";
import { IPmcData, IPostRaidPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { IPmcData, IPostRaidPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IQuestStatus, TraderInfo, Victim } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IQuestStatus, TraderInfo } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
@ -47,19 +47,6 @@ export declare class InRaidHelper {
* @param items Items array to check * @param items Items array to check
*/ */
addUpdToMoneyFromRaid(items: Item[]): void; addUpdToMoneyFromRaid(items: Item[]): void;
/**
* Add karma changes up and return the new value
* @param existingFenceStanding Current fence standing level
* @param victims Array of kills player performed
* @returns adjusted karma level after kills are taken into account
*/
calculateFenceStandingChangeFromKills(existingFenceStanding: number, victims: Victim[]): number;
/**
* Get the standing gain/loss for killing an npc
* @param victim Who was killed by player
* @returns a numerical standing gain or loss
*/
protected getFenceStandingChangeForKillAsScav(victim: Victim): number;
/** /**
* Reset a profile to a baseline, used post-raid * Reset a profile to a baseline, used post-raid
* Reset points earned during session property * Reset points earned during session property
@ -137,9 +124,8 @@ export declare class InRaidHelper {
* @param sessionID Session id * @param sessionID Session id
* @param serverProfile Profile to update * @param serverProfile Profile to update
* @param postRaidProfile Profile returned by client after a raid * @param postRaidProfile Profile returned by client after a raid
* @returns Updated profile
*/ */
setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData): IPmcData; setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData): void;
/** /**
* Clear PMC inventory of all items except those that are exempt * Clear PMC inventory of all items except those that are exempt
* Used post-raid to remove items after death * Used post-raid to remove items after death

View File

@ -16,6 +16,7 @@ import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInven
import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData";
import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData";
import { IInventorySplitRequestData } from "@spt-aki/models/eft/inventory/IInventorySplitRequestData"; import { IInventorySplitRequestData } from "@spt-aki/models/eft/inventory/IInventorySplitRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IInventoryConfig, RewardDetails } from "@spt-aki/models/spt/config/IInventoryConfig"; import { IInventoryConfig, RewardDetails } from "@spt-aki/models/spt/config/IInventoryConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -73,14 +74,41 @@ export declare class InventoryHelper {
* @param itemWithChildren An item * @param itemWithChildren An item
* @param foundInRaid Item was found in raid * @param foundInRaid Item was found in raid
*/ */
private setFindInRaidStatusForItem; protected setFindInRaidStatusForItem(itemWithChildren: Item[], foundInRaid: boolean): void;
/** /**
* Remove properties from a Upd object used by a trader/ragfair * Remove properties from a Upd object used by a trader/ragfair that are unnecessary to a player
* @param upd Object to update * @param upd Object to update
*/ */
protected removeTraderRagfairRelatedUpdProperties(upd: Upd): void; protected removeTraderRagfairRelatedUpdProperties(upd: Upd): 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: Item[][]): boolean;
canPlaceItemInInventory(stashFS2D: number[][], itemWithChildren: Item[]): 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;
/**
* 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;
/**
* Find a free location inside a container to fit the item
* @param containerFS2D Container grid to add item to
* @param itemWithChildren Item to add to grid
* @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;
/** /**
* Find a location to place an item into inventory and place it * Find a location to place an item into inventory and place it
* @param stashFS2D 2-dimensional representation of the container slots * @param stashFS2D 2-dimensional representation of the container slots
@ -92,9 +120,10 @@ export declare class InventoryHelper {
*/ */
protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void;
/** /**
* Split an items stack size based on its StackMaxSize value
* @param assortItems Items to add to inventory * @param assortItems Items to add to inventory
* @param requestItem Details of purchased item to add to inventory * @param requestItem Details of purchased item to add to inventory
* @param result Array split stacks are added to * @param result Array split stacks are appended to
*/ */
protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void;
/** /**
@ -104,16 +133,51 @@ export declare class InventoryHelper {
* @param profile Profile to remove item from (pmc or scav) * @param profile Profile to remove item from (pmc or scav)
* @param itemId Items id to remove * @param itemId Items id to remove
* @param sessionID Session id * @param sessionID Session id
* @param output Existing IItemEventRouterResponse object to append data to, creates new one by default if not supplied * @param output OPTIONAL - IItemEventRouterResponse
*/
removeItem(profile: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): void;
/**
* Delete desired item from a player profiles mail
* @param sessionId Session id
* @param removeRequest Remove request
* @param output OPTIONAL - IItemEventRouterResponse
*/
removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output?: IItemEventRouterResponse): void;
/**
* Find item by id in player inventory and remove x of its count
* @param pmcData player profile
* @param itemId Item id to decrement StackObjectsCount of
* @param countToRemove Number of item to remove
* @param sessionID Session id
* @param output IItemEventRouterResponse
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
removeItem(profile: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, countToRemove: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): void; /**
removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; * Get the height and width of an item - can have children that alter size
* @param itemTpl Item to get size of
* @param itemID Items id to get size of
* @param inventoryItems
* @returns [width, height]
*/
getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[];
protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[];
/**
* Get a blank two-dimentional representation of a container
* @param containerH Horizontal size of container
* @param containerY Vertical size of container
* @returns Two-dimensional representation of container
*/
protected getBlankContainerMap(containerH: number, containerY: number): number[][];
/**
* @param containerH Horizontal size of container
* @param containerV Vertical size of container
* @param itemList
* @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; protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash;
getContainerMap(containerW: number, containerH: number, itemList: Item[], containerId: string): number[][];
/** /**
* Return the inventory that needs to be modified (scav/pmc etc) * Return the inventory that needs to be modified (scav/pmc etc)
* Changes made to result apply to character inventory * Changes made to result apply to character inventory
@ -122,19 +186,31 @@ export declare class InventoryHelper {
* @param sessionId Session id / playerid * @param sessionId Session id / playerid
* @returns OwnerInventoryItems with inventory of player/scav to adjust * @returns OwnerInventoryItems with inventory of player/scav to adjust
*/ */
getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData, sessionId: string): IOwnerInventoryItems; getOwnerInventoryItems(request: IInventoryMoveRequestData | IInventorySplitRequestData | IInventoryMergeRequestData | IInventoryTransferRequestData, sessionId: string): IOwnerInventoryItems;
/** /**
* Made a 2d array table with 0 - free slot and 1 - used slot * Get a two dimensional array to represent stash slots
* @param {Object} pmcData * 0 value = free, 1 = taken
* @param {string} sessionID * @param pmcData Player profile
* @returns Array * @param sessionID session id
* @returns 2-dimensional array
*/ */
protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][]; protected getStashSlotMap(pmcData: IPmcData, sessionID: string): number[][];
/**
* Get a blank two-dimensional array representation of a container
* @param containerTpl Container to get data for
* @returns blank two-dimensional array
*/
getContainerSlotMap(containerTpl: string): number[][];
/**
* Get a two-dimensional array representation of the players sorting table
* @param pmcData Player profile
* @returns two-dimensional array
*/
protected getSortingTableSlotMap(pmcData: IPmcData): number[][]; protected getSortingTableSlotMap(pmcData: IPmcData): number[][];
/** /**
* Get Player Stash Proper Size * Get Players Stash Size
* @param sessionID Playerid * @param sessionID Players id
* @returns Array of 2 values, x and y stash size * @returns Array of 2 values, horizontal and vertical stash size
*/ */
protected getPlayerStashSize(sessionID: string): Record<number, number>; protected getPlayerStashSize(sessionID: string): Record<number, number>;
/** /**

View File

@ -59,12 +59,28 @@ export declare class ItemHelper {
* @returns Does item have the possibility ot need soft inserts * @returns Does item have the possibility ot need soft inserts
*/ */
armorItemCanHoldMods(itemTpl: string): boolean; armorItemCanHoldMods(itemTpl: string): boolean;
/**
* Does the provided item tpl need soft/removable inserts to function
* @param itemTpl Armor item
* @returns True if item needs some kind of insert
*/
armorItemHasRemovableOrSoftInsertSlots(itemTpl: string): boolean;
/**
* Does the pased in tpl have ability to hold removable plate items
* @param itemTpl item tpl to check for plate support
* @returns True when armor can hold plates
*/
armorItemHasRemovablePlateSlots(itemTpl: string): boolean;
/** /**
* Does the provided item tpl require soft inserts to become a valid armor item * Does the provided item tpl require soft inserts to become a valid armor item
* @param itemTpl Item tpl to check * @param itemTpl Item tpl to check
* @returns True if it needs armor inserts * @returns True if it needs armor inserts
*/ */
itemRequiresSoftInserts(itemTpl: string): boolean; itemRequiresSoftInserts(itemTpl: string): boolean;
/**
* Get all soft insert slot ids
* @returns An array of soft insert ids (e.g. soft_armor_back, helmet_top)
*/
getSoftInsertSlotIds(): string[]; getSoftInsertSlotIds(): string[];
/** /**
* Returns the items total price based on the handbook or as a fallback from the prices.json if the item is not * Returns the items total price based on the handbook or as a fallback from the prices.json if the item is not
@ -215,6 +231,12 @@ export declare class ItemHelper {
* @returns Item[] * @returns Item[]
*/ */
replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[]; replaceIDs(originalItems: Item[], pmcData?: IPmcData | null, insuredItems?: InsuredItem[] | null, fastPanel?: any): Item[];
/**
* 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;
/** /**
* 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 * 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 * @param {string} tpl Items tpl to check parents of
@ -426,6 +448,13 @@ export declare class ItemHelper {
* @returns A Map where the keys are the item IDs and the values are the corresponding Item objects. * @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: Item[]): Map<string, Item>;
/**
* 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;
} }
declare namespace ItemHelper { declare namespace ItemHelper {
interface ItemSize { interface ItemSize {

View File

@ -38,4 +38,10 @@ export declare class PresetHelper {
*/ */
getDefaultPreset(templateId: string): IPreset; getDefaultPreset(templateId: string): IPreset;
getBaseItemTpl(presetId: string): string; getBaseItemTpl(presetId: string): string;
/**
* Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists
* @param tpl The item template to get the price of
* @returns The price of the given item preset, or base item if no preset exists
*/
getDefaultPresetOrItemPrice(tpl: string): number;
} }

View File

@ -4,17 +4,21 @@ import { Common, CounterKeyValue, Stats } from "@spt-aki/models/eft/common/table
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData"; import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
import { IInventoryConfig } from "@spt-aki/models/spt/config/IInventoryConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer"; import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService"; import { ProfileSnapshotService } from "@spt-aki/services/ProfileSnapshotService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil";
import { Watermark } from "@spt-aki/utils/Watermark"; import { Watermark } from "@spt-aki/utils/Watermark";
export declare class ProfileHelper { export declare class ProfileHelper {
protected logger: ILogger; protected logger: ILogger;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected watermark: Watermark; protected watermark: Watermark;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
@ -22,7 +26,9 @@ export declare class ProfileHelper {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected profileSnapshotService: ProfileSnapshotService; protected profileSnapshotService: ProfileSnapshotService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService); protected configServer: ConfigServer;
protected inventoryConfig: IInventoryConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService, configServer: ConfigServer);
/** /**
* Remove/reset a completed quest condtion from players profile quest data * Remove/reset a completed quest condtion from players profile quest data
* @param sessionID Session id * @param sessionID Session id
@ -34,6 +40,11 @@ export declare class ProfileHelper {
* @returns Dictionary of profiles * @returns Dictionary of profiles
*/ */
getProfiles(): Record<string, IAkiProfile>; getProfiles(): Record<string, IAkiProfile>;
/**
* Get the pmc and scav profiles as an array by profile id
* @param sessionID
* @returns Array of IPmcData objects
*/
getCompleteProfile(sessionID: string): IPmcData[]; getCompleteProfile(sessionID: string): IPmcData[];
/** /**
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen
@ -45,37 +56,70 @@ export declare class ProfileHelper {
* @param output pmc and scav profiles array * @param output pmc and scav profiles array
* @param pmcProfile post-raid pmc profile * @param pmcProfile post-raid pmc profile
* @param scavProfile post-raid scav profile * @param scavProfile post-raid scav profile
* @returns updated profile array * @returns Updated profile array
*/ */
protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
/** /**
* Check if a nickname is used by another profile loaded by the server * Check if a nickname is used by another profile loaded by the server
* @param nicknameRequest * @param nicknameRequest nickname request object
* @param sessionID Session id * @param sessionID Session id
* @returns True if already used * @returns True if already used
*/ */
isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean;
protected profileHasInfoProperty(profile: IAkiProfile): boolean; protected profileHasInfoProperty(profile: IAkiProfile): boolean;
protected nicknameMatches(profileName: string, nicknameRequest: string): boolean; protected stringsMatch(stringA: string, stringB: string): boolean;
protected sessionIdMatchesProfileId(profileId: string, sessionId: string): boolean;
/** /**
* Add experience to a PMC inside the players profile * Add experience to a PMC inside the players profile
* @param sessionID Session id * @param sessionID Session id
* @param experienceToAdd Experience to add to PMC character * @param experienceToAdd Experience to add to PMC character
*/ */
addExperienceToPmc(sessionID: string, experienceToAdd: number): void; addExperienceToPmc(sessionID: string, experienceToAdd: number): void;
/**
* Iterate all profiles and find matching pmc profile by provided id
* @param pmcId Profile id to find
* @returns IPmcData
*/
getProfileByPmcId(pmcId: string): IPmcData; getProfileByPmcId(pmcId: string): IPmcData;
/**
* Get the experiecne for the given level
* @param level level to get xp for
* @returns Number of xp points for level
*/
getExperience(level: number): number; getExperience(level: number): number;
/**
* Get the max level a player can be
* @returns Max level
*/
getMaxLevel(): number; getMaxLevel(): number;
getDefaultAkiDataObject(): any; getDefaultAkiDataObject(): any;
/**
* Get full representation of a players profile json
* @param sessionID Profile id to get
* @returns IAkiProfile object
*/
getFullProfile(sessionID: string): IAkiProfile; getFullProfile(sessionID: string): IAkiProfile;
/**
* Get a PMC profile by its session id
* @param sessionID Profile id to return
* @returns IPmcData object
*/
getPmcProfile(sessionID: string): IPmcData; getPmcProfile(sessionID: string): IPmcData;
/**
* Get a full profiles scav-specific sub-profile
* @param sessionID Profiles id
* @returns IPmcData object
*/
getScavProfile(sessionID: string): IPmcData; getScavProfile(sessionID: string): IPmcData;
/** /**
* Get baseline counter values for a fresh profile * Get baseline counter values for a fresh profile
* @returns Stats * @returns Default profile Stats object
*/ */
getDefaultCounters(): Stats; getDefaultCounters(): Stats;
/**
* is this profile flagged for data removal
* @param sessionID Profile id
* @returns True if profile is to be wiped of data/progress
*/
protected isWiped(sessionID: string): boolean; protected isWiped(sessionID: string): boolean;
protected getServerVersion(): string; protected getServerVersion(): string;
/** /**
@ -120,6 +164,23 @@ export declare class ProfileHelper {
* @returns * @returns
*/ */
addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void; addSkillPointsToPlayer(pmcProfile: IPmcData, skill: SkillTypes, pointsToAdd: number, useSkillProgressRateMultipler?: boolean): void;
/**
* Get a speciic common skill from supplied profile
* @param pmcData Player profile
* @param skill Skill to look up and return value from
* @returns Common skill object from desired profile
*/
getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common; getSkillFromProfile(pmcData: IPmcData, skill: SkillTypes): Common;
/**
* Is the provided session id for a developer account
* @param sessionID Profile id ot check
* @returns True if account is developer
*/
isDeveloperAccount(sessionID: string): boolean; isDeveloperAccount(sessionID: string): boolean;
/**
* Add stash row bonus to profile or increments rows given count if it already exists
* @param sessionId Profile id to give rows to
* @param rowsToAdd How many rows to give profile
*/
addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void;
} }

View File

@ -128,6 +128,12 @@ export declare class QuestHelper {
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started * @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
*/ */
getNewlyAccessibleQuestsWhenStartingQuest(startedQuestId: string, sessionID: string): IQuest[]; getNewlyAccessibleQuestsWhenStartingQuest(startedQuestId: string, sessionID: string): IQuest[];
/**
* Is the quest for the opposite side the player is on
* @param playerSide Player side (usec/bear)
* @param questId QuestId to check
*/
questIsForOtherSide(playerSide: string, questId: string): boolean;
/** /**
* Get quests that can be shown to player after failing a quest * Get quests that can be shown to player after failing a quest
* @param failedQuestId Id of the quest failed by player * @param failedQuestId Id of the quest failed by player
@ -178,9 +184,8 @@ export declare class QuestHelper {
* @param failRequest Fail quest request data * @param failRequest Fail quest request data
* @param sessionID Session id * @param sessionID Session id
* @param output Client output * @param output Client output
* @returns Item event router response
*/ */
failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string, output?: IItemEventRouterResponse): void;
/** /**
* Get List of All Quests from db * Get List of All Quests from db
* NOT CLONED * NOT CLONED

View File

@ -157,6 +157,13 @@ export declare class RagfairOfferHelper {
* @returns True * @returns True
*/ */
protected passesSearchFilterCriteria(searchRequest: ISearchRequestData, offer: IRagfairOffer, pmcData: IPmcData): boolean; protected passesSearchFilterCriteria(searchRequest: ISearchRequestData, offer: IRagfairOffer, pmcData: IPmcData): boolean;
/**
* Check that the passed in offer item is functional
* @param offerRootItem The root item of the offer
* @param offer The flea offer
* @returns True if the given item is functional
*/
isItemFunctional(offerRootItem: Item, offer: IRagfairOffer): boolean;
/** /**
* Should a ragfair offer be visible to the player * Should a ragfair offer be visible to the player
* @param searchRequest Search request * @param searchRequest Search request

View File

@ -53,6 +53,12 @@ export declare class RagfairServerHelper {
* @returns True if its blacklsited * @returns True if its blacklsited
*/ */
protected isItemOnCustomFleaBlacklist(itemTemplateId: string): boolean; protected isItemOnCustomFleaBlacklist(itemTemplateId: string): boolean;
/**
* Is supplied parent id on the ragfair custom item category blacklist
* @param parentId Parent Id to check is blacklisted
* @returns true if blacklisted
*/
protected isItemCategoryOnCustomFleaBlacklist(itemParentId: string): boolean;
/** /**
* is supplied id a trader * is supplied id a trader
* @param traderId * @param traderId

View File

@ -56,13 +56,6 @@ export declare class TradeHelper {
* @param output IItemEventRouterResponse * @param output IItemEventRouterResponse
*/ */
sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string, output: IItemEventRouterResponse): void; sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/**
* Increment the assorts buy count by number of items purchased
* Show error on screen if player attempts to buy more than what the buy max allows
* @param assortBeingPurchased assort being bought
* @param itemsPurchasedCount number of items being bought
*/
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
/** /**
* Traders allow a limited number of purchases per refresh cycle (default 60 mins) * Traders allow a limited number of purchases per refresh cycle (default 60 mins)
* @param sessionId Session id * @param sessionId Session id

View File

@ -59,7 +59,7 @@ export declare class TraderHelper {
/** /**
* Reset a profiles trader data back to its initial state as seen by a level 1 player * 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 * Does NOT take into account different profile levels
* @param sessionID session id * @param sessionID session id of player
* @param traderID trader id to reset * @param traderID trader id to reset
*/ */
resetTrader(sessionID: string, traderID: string): void; resetTrader(sessionID: string, traderID: string): void;
@ -74,13 +74,13 @@ export declare class TraderHelper {
* Alter a traders unlocked status * Alter a traders unlocked status
* @param traderId Trader to alter * @param traderId Trader to alter
* @param status New status to use * @param status New status to use
* @param sessionId Session id * @param sessionId Session id of player
*/ */
setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void; setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void;
/** /**
* Add standing to a trader and level them up if exp goes over level threshold * Add standing to a trader and level them up if exp goes over level threshold
* @param sessionId Session id * @param sessionId Session id of player
* @param traderId Traders id * @param traderId Traders id to add standing to
* @param standingToAdd Standing value to add to trader * @param standingToAdd Standing value to add to trader
*/ */
addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void; addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void;
@ -121,7 +121,7 @@ export declare class TraderHelper {
count: number; count: number;
}[]; }[];
traderId: string; traderId: string;
}): void; }, itemPurchased: Item): void;
/** /**
* Get the highest rouble price for an item from traders * Get the highest rouble price for an item from traders
* UNUSED * UNUSED

2
types/ide/BleedingEdgeModsEntry.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import "reflect-metadata";
import "source-map-support/register";

View File

@ -1,33 +1,33 @@
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { BundleHashCacheService } from "@spt-aki/services/cache/BundleHashCacheService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { VFS } from "@spt-aki/utils/VFS"; import { VFS } from "@spt-aki/utils/VFS";
declare class BundleInfo { export declare class BundleInfo {
modPath: string; modpath: string;
key: string; filename: string;
path: string; crc: number;
filepath: string; dependencies: string[];
dependencyKeys: string[]; constructor(modpath: string, bundle: BundleManifestEntry, bundleHash: number);
constructor(modpath: string, bundle: any, bundlePath: string, bundleFilepath: string);
} }
export declare class BundleLoader { export declare class BundleLoader {
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected vfs: VFS; protected vfs: VFS;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected bundleHashCacheService: BundleHashCacheService;
protected bundles: Record<string, BundleInfo>; protected bundles: Record<string, BundleInfo>;
constructor(httpServerHelper: HttpServerHelper, vfs: VFS, jsonUtil: JsonUtil); constructor(httpServerHelper: HttpServerHelper, vfs: VFS, jsonUtil: JsonUtil, bundleHashCacheService: BundleHashCacheService);
/** /**
* Handle singleplayer/bundles * Handle singleplayer/bundles
*/ */
getBundles(local: boolean): BundleInfo[]; getBundles(): BundleInfo[];
getBundle(key: string, local: boolean): BundleInfo; getBundle(key: string): BundleInfo;
addBundles(modpath: string): void; addBundles(modpath: string): void;
addBundle(key: string, b: BundleInfo): void; addBundle(key: string, b: BundleInfo): void;
} }
export interface BundleManifest { export interface BundleManifest {
manifest: Array<BundleManifestEntry>; manifest: BundleManifestEntry[];
} }
export interface BundleManifestEntry { export interface BundleManifestEntry {
key: string; key: string;
path: string; dependencyKeys: string[];
} }
export {};

View File

@ -1,21 +1,17 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck"; import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader"; import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { IModLoader } from "@spt-aki/models/spt/mod/IModLoader"; import { IModLoader } from "@spt-aki/models/spt/mod/IModLoader";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { VFS } from "@spt-aki/utils/VFS";
export declare class PostAkiModLoader implements IModLoader { export declare class PostAkiModLoader implements IModLoader {
protected logger: ILogger; protected logger: ILogger;
protected bundleLoader: BundleLoader;
protected vfs: VFS;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected modTypeCheck: ModTypeCheck; protected modTypeCheck: ModTypeCheck;
constructor(logger: ILogger, bundleLoader: BundleLoader, vfs: VFS, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck); protected container: DependencyContainer;
constructor(logger: ILogger, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
getModPath(mod: string): string; getModPath(mod: string): string;
load(): Promise<void>; load(): Promise<void>;
protected executeMods(container: DependencyContainer): Promise<void>; protected executeModsAsync(): Promise<void>;
protected addBundles(): void;
} }

View File

@ -1,17 +1,21 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
import { OnLoad } from "@spt-aki/di/OnLoad"; import { OnLoad } from "@spt-aki/di/OnLoad";
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck"; import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader"; import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
export declare class PostDBModLoader implements OnLoad { export declare class PostDBModLoader implements OnLoad {
protected logger: ILogger; protected logger: ILogger;
protected bundleLoader: BundleLoader;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected modTypeCheck: ModTypeCheck; protected modTypeCheck: ModTypeCheck;
constructor(logger: ILogger, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck); protected container: DependencyContainer;
constructor(logger: ILogger, bundleLoader: BundleLoader, preAkiModLoader: PreAkiModLoader, localisationService: LocalisationService, modTypeCheck: ModTypeCheck);
onLoad(): Promise<void>; onLoad(): Promise<void>;
getRoute(): string; getRoute(): string;
getModPath(mod: string): string; getModPath(mod: string): string;
protected executeMods(container: DependencyContainer): Promise<void>; protected executeModsAsync(): Promise<void>;
protected addBundles(): void;
} }

View File

@ -1,5 +1,4 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
import { ModLoadOrder } from "@spt-aki/loaders/ModLoadOrder"; import { ModLoadOrder } from "@spt-aki/loaders/ModLoadOrder";
import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck"; import { ModTypeCheck } from "@spt-aki/loaders/ModTypeCheck";
import { ModDetails } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ModDetails } from "@spt-aki/models/eft/profile/IAkiProfile";
@ -17,12 +16,11 @@ export declare class PreAkiModLoader implements IModLoader {
protected vfs: VFS; protected vfs: VFS;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected modCompilerService: ModCompilerService; protected modCompilerService: ModCompilerService;
protected bundleLoader: BundleLoader;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected modLoadOrder: ModLoadOrder; protected modLoadOrder: ModLoadOrder;
protected modTypeCheck: ModTypeCheck; protected modTypeCheck: ModTypeCheck;
protected static container: DependencyContainer; protected container: DependencyContainer;
protected readonly basepath = "user/mods/"; protected readonly basepath = "user/mods/";
protected readonly modOrderPath = "user/mods/order.json"; protected readonly modOrderPath = "user/mods/order.json";
protected order: Record<string, number>; protected order: Record<string, number>;
@ -30,7 +28,7 @@ export declare class PreAkiModLoader implements IModLoader {
protected akiConfig: ICoreConfig; protected akiConfig: ICoreConfig;
protected serverDependencies: Record<string, string>; protected serverDependencies: Record<string, string>;
protected skippedMods: Set<string>; protected skippedMods: Set<string>;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck); constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, localisationService: LocalisationService, configServer: ConfigServer, modLoadOrder: ModLoadOrder, modTypeCheck: ModTypeCheck);
load(container: DependencyContainer): Promise<void>; load(container: DependencyContainer): Promise<void>;
/** /**
* Returns a list of mods with preserved load order * Returns a list of mods with preserved load order
@ -68,10 +66,9 @@ export declare class PreAkiModLoader implements IModLoader {
protected isModCombatibleWithAki(mod: IPackageJsonData): boolean; protected isModCombatibleWithAki(mod: IPackageJsonData): boolean;
/** /**
* Execute each mod found in this.imported * Execute each mod found in this.imported
* @param container Dependence container to give to mod when it runs
* @returns void promise * @returns void promise
*/ */
protected executeModsAsync(container: DependencyContainer): Promise<void>; protected executeModsAsync(): Promise<void>;
/** /**
* Read loadorder.json (create if doesnt exist) and return sorted list of mods * Read loadorder.json (create if doesnt exist) and return sorted list of mods
* @returns string array of sorted mod names * @returns string array of sorted mod names

View File

@ -40,6 +40,7 @@ export interface IConfig {
BaseLoadTime: number; BaseLoadTime: number;
BaseUnloadTime: number; BaseUnloadTime: number;
BaseCheckTime: number; BaseCheckTime: number;
BluntDamageReduceFromSoftArmorMod: number;
Customization: ICustomization; Customization: ICustomization;
UncheckOnShot: boolean; UncheckOnShot: boolean;
BotsEnabled: boolean; BotsEnabled: boolean;
@ -682,6 +683,7 @@ export interface IBodyPartsSetting {
Minimum: number; Minimum: number;
Maximum: number; Maximum: number;
Default: number; Default: number;
EnvironmentDamageMultiplier: number;
OverDamageReceivedMultiplier: number; OverDamageReceivedMultiplier: number;
} }
export interface IHealthFactorsSettings { export interface IHealthFactorsSettings {

View File

@ -1,9 +1,10 @@
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase"; import { Exit, ILocationBase } from "@spt-aki/models/eft/common/ILocationBase";
import { ILooseLoot } from "@spt-aki/models/eft/common/ILooseLoot"; import { ILooseLoot } from "@spt-aki/models/eft/common/ILooseLoot";
export interface ILocation { export interface ILocation {
base: ILocationBase; base: ILocationBase;
looseLoot: ILooseLoot; looseLoot: ILooseLoot;
statics: IStaticContainer; statics: IStaticContainer;
allExtracts: Exit[];
} }
export interface IStaticContainer { export interface IStaticContainer {
containersGroups: Record<string, IContainerMinMax>; containersGroups: Record<string, IContainerMinMax>;

View File

@ -205,6 +205,7 @@ export interface Exit {
PassageRequirement: string; PassageRequirement: string;
PlayersCount: number; PlayersCount: number;
RequirementTip: string; RequirementTip: string;
Side?: string;
} }
export interface MaxItemCountInLocation { export interface MaxItemCountInLocation {
TemplateId: string; TemplateId: string;

View File

@ -54,6 +54,7 @@ export interface Info {
LowerNickname: string; LowerNickname: string;
Side: string; Side: string;
SquadInviteRestriction: boolean; SquadInviteRestriction: boolean;
HasCoopExtension: boolean;
Voice: string; Voice: string;
Level: number; Level: number;
Experience: number; Experience: number;
@ -181,6 +182,7 @@ export interface IEftStats {
LastPlayerState?: LastPlayerState; LastPlayerState?: LastPlayerState;
TotalInGameTime: number; TotalInGameTime: number;
SurvivorClass?: string; SurvivorClass?: string;
sptLastRaidFenceRepChange?: number;
} }
export interface IDroppedItem { export interface IDroppedItem {
QuestId: string; QuestId: string;
@ -314,6 +316,8 @@ export interface Productive {
sptIsComplete?: boolean; sptIsComplete?: boolean;
/** Is the craft a Continuous, e.g bitcoins/water collector */ /** Is the craft a Continuous, e.g bitcoins/water collector */
sptIsContinuous?: boolean; 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[];
} }
export interface Production extends Productive { export interface Production extends Productive {
RecipeId: string; RecipeId: string;

View File

@ -120,7 +120,7 @@ export interface GenerationData {
/** key: number of items, value: weighting */ /** key: number of items, value: weighting */
weights: Record<string, number>; weights: Record<string, number>;
/** Array of item tpls */ /** Array of item tpls */
whitelist: string[]; whitelist: Record<string, number>;
} }
export interface Health { export interface Health {
BodyParts: BodyPart[]; BodyParts: BodyPart[];
@ -160,10 +160,10 @@ export interface Equipment {
TacticalVest: Record<string, number>; TacticalVest: Record<string, number>;
} }
export interface Items { export interface Items {
Backpack: string[]; Backpack: Record<string, number>;
Pockets: string[]; Pockets: Record<string, number>;
SecuredContainer: string[]; SecuredContainer: Record<string, number>;
SpecialLoot: string[]; SpecialLoot: Record<string, number>;
TacticalVest: string[]; TacticalVest: Record<string, number>;
} }
export type Mods = Record<string, Record<string, string[]>>; export type Mods = Record<string, Record<string, string[]>>;

View File

@ -33,6 +33,7 @@ export interface Upd {
Foldable?: Foldable; Foldable?: Foldable;
SideEffect?: SideEffect; SideEffect?: SideEffect;
RepairKit?: RepairKit; RepairKit?: RepairKit;
CultistAmulet?: ICultistAmulet;
} }
export interface Buff { export interface Buff {
rarity: string; rarity: string;
@ -119,3 +120,6 @@ export interface SideEffect {
export interface RepairKit { export interface RepairKit {
Resource: number; Resource: number;
} }
export interface ICultistAmulet {
NumberOfUsages: number;
}

View File

@ -175,6 +175,7 @@ export interface Props {
armorClass?: string | number; armorClass?: string | number;
armorColliders?: string[]; armorColliders?: string[];
armorPlateColliders?: string[]; armorPlateColliders?: string[];
bluntDamageReduceFromSoftArmor?: boolean;
mousePenalty?: number; mousePenalty?: number;
weaponErgonomicPenalty?: number; weaponErgonomicPenalty?: number;
BluntThroughput?: number; BluntThroughput?: number;

View File

@ -2,6 +2,7 @@ export interface IHideoutSingleProductionStartRequestData {
Action: "HideoutSingleProductionStart"; Action: "HideoutSingleProductionStart";
recipeId: string; recipeId: string;
items: Item[]; items: Item[];
tools: Item[];
timestamp: number; timestamp: number;
} }
export interface Item { export interface Item {

View File

@ -1,3 +1,4 @@
import { IItemEventRouterBase } from "@spt-aki/models/eft/itemEvent/IItemEventRouterBase"; import { IItemEventRouterBase } from "@spt-aki/models/eft/itemEvent/IItemEventRouterBase";
/** An object sent back to the game client that contains alterations the client must make to ensure server/client are in sync */
export interface IItemEventRouterResponse extends IItemEventRouterBase { export interface IItemEventRouterResponse extends IItemEventRouterBase {
} }

View File

@ -0,0 +1,2 @@
export interface IDeclineGroupInviteRequest {
}

View File

@ -9,6 +9,8 @@ export interface IGetRaidConfigurationRequestData {
timeAndWeatherSettings: TimeAndWeatherSettings; timeAndWeatherSettings: TimeAndWeatherSettings;
botSettings: BotSettings; botSettings: BotSettings;
wavesSettings: WavesSettings; wavesSettings: WavesSettings;
CanShowGroupPreview: boolean;
MaxGroupCount: number;
} }
export interface TimeAndWeatherSettings { export interface TimeAndWeatherSettings {
isRandomTime: boolean; isRandomTime: boolean;

View File

@ -62,6 +62,7 @@ export declare enum BackendErrorCodes {
BANNEDERRORCODE = 1513, BANNEDERRORCODE = 1513,
INSUFFICIENTNUMBERINSTOCK = 1516, INSUFFICIENTNUMBERINSTOCK = 1516,
TOOMANYITEMSTOSELL = 1517, TOOMANYITEMSTOSELL = 1517,
INCORRECTCLIENTPRICE = 1519,
EXAMINATIONFAILED = 22001, EXAMINATIONFAILED = 22001,
ITEMALREADYEXAMINED = 22002, ITEMALREADYEXAMINED = 22002,
UNKNOWNNGINXERROR = 9000, UNKNOWNNGINXERROR = 9000,
@ -81,5 +82,6 @@ export declare enum BackendErrorCodes {
PLAYERISNOTSEARCHINGFORGROUP = 502018, PLAYERISNOTSEARCHINGFORGROUP = 502018,
PLAYERALREADYLOOKINGFORGAME = 503001, PLAYERALREADYLOOKINGFORGAME = 503001,
PLAYERINRAID = 503002, PLAYERINRAID = 503002,
LIMITFORPRESETSREACHED = 504001 LIMITFORPRESETSREACHED = 504001,
PLAYERPROFILENOTFOUND = 505001
} }

View File

@ -95,7 +95,7 @@ export declare enum BaseClasses {
PORTABLE_RANGE_FINDER = "61605ddea09d851a0a0c1bbc", PORTABLE_RANGE_FINDER = "61605ddea09d851a0a0c1bbc",
ITEM = "54009119af1c881c07000029", ITEM = "54009119af1c881c07000029",
CYLINDER_MAGAZINE = "610720f290b75a49ff2e5e25", CYLINDER_MAGAZINE = "610720f290b75a49ff2e5e25",
AUXILARY_MOD = "5a74651486f7744e73386dd1", AUXILIARY_MOD = "5a74651486f7744e73386dd1",
BIPOD = "55818afb4bdc2dde698b456d", BIPOD = "55818afb4bdc2dde698b456d",
HEADPHONES = "5645bcb74bdc2ded0b8b4578", HEADPHONES = "5645bcb74bdc2ded0b8b4578",
RANDOM_LOOT_CONTAINER = "62f109593b54472778797866", RANDOM_LOOT_CONTAINER = "62f109593b54472778797866",
@ -103,5 +103,11 @@ export declare enum BaseClasses {
BUILT_IN_INSERTS = "65649eb40bf0ed77b8044453", BUILT_IN_INSERTS = "65649eb40bf0ed77b8044453",
ARMOR_PLATE = "644120aa86ffbe10ee032b6f", ARMOR_PLATE = "644120aa86ffbe10ee032b6f",
CULTIST_AMULET = "64b69b0c8f3be32ed22682f8", CULTIST_AMULET = "64b69b0c8f3be32ed22682f8",
RADIO_TRANSMITTER = "62e9103049c018f425059f38" RADIO_TRANSMITTER = "62e9103049c018f425059f38",
HANDGUARD = "55818a104bdc2db9688b4569",
PISTOL_GRIP = "55818a684bdc2ddd698b456d",
RECEIVER = "55818a304bdc2db5418b457d",
BARREL = "555ef6e44bdc2de9068b457e",
CHARGING_HANDLE = "55818a6f4bdc2db9688b456b",
COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 "
} }

View File

@ -28,5 +28,6 @@ export declare enum BonusType {
STASH_SIZE = "StashSize", STASH_SIZE = "StashSize",
MAXIMUM_ENERGY_RESERVE = "MaximumEnergyReserve", MAXIMUM_ENERGY_RESERVE = "MaximumEnergyReserve",
TEXT_BONUS = "TextBonus", TEXT_BONUS = "TextBonus",
SKILL_GROUP_LEVELING_BOOST = "SkillGroupLevelingBoost" SKILL_GROUP_LEVELING_BOOST = "SkillGroupLevelingBoost",
STASH_ROWS = "StashRows"
} }

View File

@ -39,6 +39,12 @@ export declare enum WildSpawnTypeNumber {
PEACEFULLZRYACHIYEVENT = 38, PEACEFULLZRYACHIYEVENT = 38,
SECTACTPRIESTEVENT = 39, SECTACTPRIESTEVENT = 39,
RAVANGEZRYACHIYEVENT = 40, RAVANGEZRYACHIYEVENT = 40,
SPTUSEC = 41, FOLLOWERBOARCLOSE1 = 41,
SPTBEAR = 42 FOLLOWERBOARCLOSE2 = 42,
BOSSKOLONTAY = 43,
FOLLOWERKOLONTAYASSAULT = 44,
FOLLOWERKOLONTAYSECURITY = 45,
SHOOTERBTR = 46,
SPTUSEC = 47,
SPTBEAR = 48
} }

View File

@ -1,15 +1,14 @@
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
export interface IBotLootCache { export interface IBotLootCache {
backpackLoot: ITemplateItem[]; backpackLoot: Record<string, number>;
pocketLoot: ITemplateItem[]; pocketLoot: Record<string, number>;
vestLoot: ITemplateItem[]; vestLoot: Record<string, number>;
secureLoot: ITemplateItem[]; secureLoot: Record<string, number>;
combinedPoolLoot: ITemplateItem[]; combinedPoolLoot: Record<string, number>;
specialItems: ITemplateItem[]; specialItems: Record<string, number>;
healingItems: ITemplateItem[]; healingItems: Record<string, number>;
drugItems: ITemplateItem[]; drugItems: Record<string, number>;
stimItems: ITemplateItem[]; stimItems: Record<string, number>;
grenadeItems: ITemplateItem[]; grenadeItems: Record<string, number>;
} }
export declare enum LootCacheType { export declare enum LootCacheType {
SPECIAL = "Special", SPECIAL = "Special",

View File

@ -0,0 +1,4 @@
export interface IItemSpawnLimitSettings {
currentLimits: Record<string, number>;
globalLimits: Record<string, number>;
}

View File

@ -1,3 +1,7 @@
export interface IBaseConfig { export interface IBaseConfig {
kind: string; kind: string;
} }
export interface IRunIntervalValues {
inRaid: number;
outOfRaid: number;
}

View File

@ -14,8 +14,6 @@ export interface IBotConfig extends IBaseConfig {
durability: IBotDurability; durability: IBotDurability;
/** Controls the percentage values of randomization item resources */ /** Controls the percentage values of randomization item resources */
lootItemResourceRandomization: Record<string, IRandomisedResourceDetails>; lootItemResourceRandomization: Record<string, IRandomisedResourceDetails>;
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */ /** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
revenge: Record<string, string[]>; revenge: Record<string, string[]>;
/** Control how many items are allowed to spawn on a bot /** Control how many items are allowed to spawn on a bot
@ -37,6 +35,10 @@ export interface IBotConfig extends IBaseConfig {
secureContainerAmmoStackCount: number; secureContainerAmmoStackCount: number;
/** Bot roles in this array will be given a dog tag on generation */ /** Bot roles in this array will be given a dog tag on generation */
botRolesWithDogTags: string[]; botRolesWithDogTags: string[];
/** Settings to control the items that get added into wallets on bots */
walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>;
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {
@ -77,9 +79,14 @@ export interface PresetBatch {
sptUsec: number; sptUsec: number;
sptBear: number; sptBear: number;
} }
export interface LootNvalue { export interface IWalletLootSettings {
scav: number; /** Chance wallets have loot in them */
pmc: number; chancePercent: number;
itemCount: MinMax;
stackSizeWeight: Record<string, number>;
currencyWeight: Record<string, number>;
/** What wallets will have money in them */
walletTplPool: string[];
} }
export interface EquipmentFilters { export interface EquipmentFilters {
/** Limits for mod types per weapon .e.g. scopes */ /** Limits for mod types per weapon .e.g. scopes */

View File

@ -7,6 +7,8 @@ export interface ICoreConfig extends IBaseConfig {
serverName: string; serverName: string;
profileSaveIntervalSeconds: number; profileSaveIntervalSeconds: number;
sptFriendNickname: string; sptFriendNickname: string;
bsgLogging: IBsgLogging;
release: IRelease;
fixes: IGameFixes; fixes: IGameFixes;
features: IServerFeatures; features: IServerFeatures;
/** Commit hash build server was created from */ /** Commit hash build server was created from */
@ -14,6 +16,37 @@ export interface ICoreConfig extends IBaseConfig {
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
} }
export interface IBsgLogging {
/**
* verbosity of what to log, yes I know this is backwards, but its how nlog deals with ordinals.
* complain to them about it! In all cases, better exceptions will be logged.
* WARNING: trace-info logging will quickly create log files in the megabytes.
* 0 - trace
* 1 - debug
* 2 - info
* 3 - warn
* 4 - error
* 5 - fatal
* 6 - off
*/
verbosity: number;
sendToServer: boolean;
}
export interface IRelease {
betaDisclaimerText?: string;
betaDisclaimerAcceptText: string;
serverModsLoadedText: string;
serverModsLoadedDebugText: string;
clientModsLoadedText: string;
clientModsLoadedDebugText: string;
illegalPluginsLoadedText: string;
illegalPluginsExceptionText: string;
releaseSummaryText?: string;
isBeta?: boolean;
isModdable?: boolean;
isModded: boolean;
betaDisclaimerTimeoutDelay: number;
}
export interface IGameFixes { export interface IGameFixes {
/** Shotguns use a different value than normal guns causing huge pellet dispersion */ /** Shotguns use a different value than normal guns causing huge pellet dispersion */
fixShotgunDispersion: boolean; fixShotgunDispersion: boolean;

View File

@ -1,7 +1,10 @@
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; import { IBaseConfig, IRunIntervalValues } from "@spt-aki/models/spt/config/IBaseConfig";
export interface IHideoutConfig extends IBaseConfig { export interface IHideoutConfig extends IBaseConfig {
kind: "aki-hideout"; kind: "aki-hideout";
/** How many seconds should pass before hideout crafts / fuel usage is checked and procesed */
runIntervalSeconds: number; runIntervalSeconds: number;
/** Default values used to hydrate `runIntervalSeconds` with */
runIntervalValues: IRunIntervalValues;
hoursForSkillCrafting: number; hoursForSkillCrafting: number;
expCraftAmount: number; expCraftAmount: number;
} }

View File

@ -20,6 +20,8 @@ export interface IInRaidConfig extends IBaseConfig {
pmcKillProbabilityForScavGain: number; pmcKillProbabilityForScavGain: number;
/** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */
keepFiRSecureContainerOnDeath: boolean; keepFiRSecureContainerOnDeath: boolean;
/** Percentage chance a player scav hot is hostile to the player when scavving */
playerScavHostileChancePercent: number;
} }
export interface RaidMenuSettings { export interface RaidMenuSettings {
aiAmount: string; aiAmount: string;

View File

@ -8,6 +8,8 @@ export interface IInventoryConfig extends IBaseConfig {
sealedAirdropContainer: ISealedAirdropContainerSettings; sealedAirdropContainer: ISealedAirdropContainerSettings;
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
customMoneyTpls: string[]; customMoneyTpls: string[];
/** Multipliers for skill gain when inside menus, NOT in-game */
skillGainMultiplers: Record<string, number>;
} }
export interface RewardDetails { export interface RewardDetails {
rewardCount: number; rewardCount: number;

View File

@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig {
kind: "aki-item"; kind: "aki-item";
/** Items that should be globally blacklisted */ /** Items that should be globally blacklisted */
blacklist: string[]; blacklist: string[];
/** items that should not be given as rewards */
rewardItemBlacklist: string[];
/** Items that can only be found on bosses */ /** Items that can only be found on bosses */
bossItems: string[]; bossItems: string[];
handbookPriceOverride: Record<string, number>; handbookPriceOverride: Record<string, number>;

View File

@ -42,6 +42,8 @@ export interface ILocationConfig extends IBaseConfig {
scavRaidTimeSettings: IScavRaidTimeSettings; scavRaidTimeSettings: IScavRaidTimeSettings;
/** Settings to adjust mods for lootable equipment in raid */ /** Settings to adjust mods for lootable equipment in raid */
equipmentLootSettings: IEquipmentLootSettings; equipmentLootSettings: IEquipmentLootSettings;
/** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/
sandboxMaxPatrolvalue: number;
} }
export interface IEquipmentLootSettings { export interface IEquipmentLootSettings {
modSpawnChancePercent: Record<string, number>; modSpawnChancePercent: Record<string, number>;

View File

@ -16,6 +16,7 @@ export interface Equipment {
ArmorVest: boolean; ArmorVest: boolean;
Eyewear: boolean; Eyewear: boolean;
TacticalVest: boolean; TacticalVest: boolean;
PocketItems: boolean;
Backpack: boolean; Backpack: boolean;
Holster: boolean; Holster: boolean;
FirstPrimaryWeapon: boolean; FirstPrimaryWeapon: boolean;

View File

@ -9,7 +9,7 @@ export interface KarmaLevel {
modifiers: Modifiers; modifiers: Modifiers;
itemLimits: ItemLimits; itemLimits: ItemLimits;
equipmentBlacklist: Record<string, string[]>; equipmentBlacklist: Record<string, string[]>;
labsAccessCardChancePercent: number; lootItemsToAddChancePercent: Record<string, number>;
} }
export interface Modifiers { export interface Modifiers {
equipment: Record<string, number>; equipment: Record<string, number>;

View File

@ -13,7 +13,6 @@ export interface IPmcConfig extends IBaseConfig {
pocketLoot: SlotLootSettings; pocketLoot: SlotLootSettings;
/** Global whitelist/blacklist of backpack loot for PMCs */ /** Global whitelist/blacklist of backpack loot for PMCs */
backpackLoot: SlotLootSettings; backpackLoot: SlotLootSettings;
dynamicLoot: DynamicLoot;
/** Use difficulty defined in config/bot.json/difficulty instead of chosen difficulty dropdown value */ /** Use difficulty defined in config/bot.json/difficulty instead of chosen difficulty dropdown value */
useDifficultyOverride: boolean; useDifficultyOverride: boolean;
/** Difficulty override e.g. "AsOnline/Hard" */ /** Difficulty override e.g. "AsOnline/Hard" */
@ -55,8 +54,4 @@ export interface PmcTypes {
export interface SlotLootSettings { export interface SlotLootSettings {
whitelist: string[]; whitelist: string[];
blacklist: string[]; blacklist: string[];
moneyStackLimits: Record<string, number>;
}
export interface DynamicLoot {
moneyStackLimits: Record<string, number>;
} }

View File

@ -1,9 +1,11 @@
import { MinMax } from "@spt-aki/models/common/MinMax"; import { MinMax } from "@spt-aki/models/common/MinMax";
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; import { IBaseConfig, IRunIntervalValues } from "@spt-aki/models/spt/config/IBaseConfig";
export interface IRagfairConfig extends IBaseConfig { export interface IRagfairConfig extends IBaseConfig {
kind: "aki-ragfair"; kind: "aki-ragfair";
/** How many seconds should pass before expired offers and procesed + player offers checked if sold */ /** How many seconds should pass before expired offers and procesed + player offers checked if sold */
runIntervalSeconds: number; runIntervalSeconds: number;
/** Default values used to hydrate `runIntervalSeconds` with */
runIntervalValues: IRunIntervalValues;
/** Player listing settings */ /** Player listing settings */
sell: Sell; sell: Sell;
/** Trader ids + should their assorts be listed on flea*/ /** Trader ids + should their assorts be listed on flea*/
@ -16,9 +18,7 @@ export interface Sell {
/** Settings to control chances of offer being sold */ /** Settings to control chances of offer being sold */
chance: Chance; chance: Chance;
/** Settings to control how long it takes for a player offer to sell */ /** Settings to control how long it takes for a player offer to sell */
time: Time; time: MinMax;
/** Player offer reputation gain/loss settings */
reputation: Reputation;
/**Seconds from clicking remove to remove offer from market */ /**Seconds from clicking remove to remove offer from market */
expireSeconds: number; expireSeconds: number;
} }
@ -32,13 +32,6 @@ export interface Chance {
/** Min possible sell chance % for a player listed offer */ /** Min possible sell chance % for a player listed offer */
minSellChancePercent: number; minSellChancePercent: number;
} }
export interface Time extends MinMax {
base: number;
}
export interface Reputation {
gain: number;
loss: number;
}
export interface Dynamic { export interface Dynamic {
purchasesAreFoundInRaid: boolean; purchasesAreFoundInRaid: boolean;
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
@ -65,6 +58,8 @@ export interface Dynamic {
nonStackableCount: MinMax; nonStackableCount: MinMax;
/** Range of rating offers for items being listed */ /** Range of rating offers for items being listed */
rating: MinMax; rating: MinMax;
/** Armor specific flea settings */
armor: IArmorSettings;
/** A multipler to apply to individual tpls price just prior to item quality adjustment */ /** A multipler to apply to individual tpls price just prior to item quality adjustment */
itemPriceMultiplier: Record<string, number>; itemPriceMultiplier: Record<string, number>;
/** Percentages to sell offers in each currency */ /** Percentages to sell offers in each currency */
@ -136,6 +131,10 @@ export interface Blacklist {
traderItems: boolean; traderItems: boolean;
/** Maximum level an armor plate can be found in a flea-listed armor item */ /** Maximum level an armor plate can be found in a flea-listed armor item */
armorPlate: IArmorPlateBlacklistSettings; armorPlate: IArmorPlateBlacklistSettings;
/** Should specific categories be blacklisted from the flea, true = use blacklist */
enableCustomItemCategoryList: boolean;
/** Custom category blacklist for parent Ids */
customItemCategoryList: string[];
} }
export interface IArmorPlateBlacklistSettings { export interface IArmorPlateBlacklistSettings {
/** Max level of plates an armor can have without being removed */ /** Max level of plates an armor can have without being removed */
@ -151,3 +150,9 @@ export interface IUnreasonableModPrices {
/** The new multiplier for items found using above property, e.g. a value of 4 means set items price to 4x handbook price */ /** The new multiplier for items found using above property, e.g. a value of 4 means set items price to 4x handbook price */
newPriceHandbookMultiplier: number; newPriceHandbookMultiplier: number;
} }
export interface IArmorSettings {
/** % chance / 100 that armor plates will be removed from an offer before listing */
removeRemovablePlateChance: number;
/** What slots are to be removed when removeRemovablePlateChance is true */
plateSlotIdToRemovePool: string[];
}

View File

@ -5,15 +5,16 @@ export interface ITraderConfig extends IBaseConfig {
kind: "aki-trader"; kind: "aki-trader";
updateTime: UpdateTime[]; updateTime: UpdateTime[];
purchasesAreFoundInRaid: boolean; purchasesAreFoundInRaid: boolean;
/** Should trader reset times be set based on server start time (false = bsg time - on the hour) */
tradersResetFromServerStart: boolean;
updateTimeDefault: number; updateTimeDefault: number;
traderPriceMultipler: number; traderPriceMultipler: number;
/** Keep track of purchased trader-limited items beyond server restarts to prevent server-restart item scumming */
persistPurchaseDataInProfile: boolean;
fence: FenceConfig; fence: FenceConfig;
} }
export interface UpdateTime { export interface UpdateTime {
traderId: string; traderId: string;
seconds: number; /** Seconds between trader resets */
seconds: MinMax;
} }
export interface FenceConfig { export interface FenceConfig {
discountOptions: DiscountOptions; discountOptions: DiscountOptions;
@ -24,12 +25,14 @@ export interface FenceConfig {
equipmentPresetMinMax: MinMax; equipmentPresetMinMax: MinMax;
itemPriceMult: number; itemPriceMult: number;
presetPriceMult: number; presetPriceMult: number;
armorMaxDurabilityPercentMinMax: MinMax; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax;
presetMaxDurabilityPercentMinMax: MinMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax;
chancePlateExistsInArmorPercent: number; chancePlateExistsInArmorPercent: number;
/** Key: item tpl */ /** Key: item tpl */
itemStackSizeOverrideMinMax: Record<string, MinMax>; itemStackSizeOverrideMinMax: Record<string, MinMax>;
itemTypeLimits: Record<string, number>; itemTypeLimits: Record<string, number>;
/** Prevent duplicate offers of items of specific categories by parentId*/
preventDuplicateOffersOfCategory: string[];
regenerateAssortsOnRefresh: boolean; regenerateAssortsOnRefresh: boolean;
/** Max rouble price before item is not listed on flea */ /** Max rouble price before item is not listed on flea */
itemCategoryRoublePriceLimit: Record<string, number>; itemCategoryRoublePriceLimit: Record<string, number>;
@ -41,6 +44,10 @@ export interface FenceConfig {
coopExtractGift: CoopExtractReward; coopExtractGift: CoopExtractReward;
btrDeliveryExpireHours: number; btrDeliveryExpireHours: number;
} }
export interface IItemDurabilityCurrentMax {
current: MinMax;
max: MinMax;
}
export interface CoopExtractReward extends LootRequest { export interface CoopExtractReward extends LootRequest {
sendGift: boolean; sendGift: boolean;
messageLocaleIds: string[]; messageLocaleIds: string[];

View File

@ -3,8 +3,3 @@ import { Chances, Generation, Inventory } from "@spt-aki/models/eft/common/table
export interface IBotGenerator { export interface IBotGenerator {
generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory; generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
} }
export interface IExhaustableArray<T> {
getRandomValue(): T;
getFirstValue(): T;
hasValues(): boolean;
}

View File

@ -7,5 +7,5 @@ export declare enum LogTextColor {
MAGENTA = "magenta", MAGENTA = "magenta",
CYAN = "cyan", CYAN = "cyan",
WHITE = "white", WHITE = "white",
GRAY = "" GRAY = "gray"
} }

View File

@ -0,0 +1,17 @@
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
export declare class ExhaustableArray<T> implements IExhaustableArray<T> {
private itemPool;
private randomUtil;
private jsonUtil;
private pool;
constructor(itemPool: T[], randomUtil: RandomUtil, jsonUtil: JsonUtil);
getRandomValue(): T;
getFirstValue(): T;
hasValues(): boolean;
}
export interface IExhaustableArray<T> {
getRandomValue(): T;
getFirstValue(): T;
hasValues(): boolean;
}

View File

@ -1,28 +1,23 @@
import { ILocationBase } from "@spt-aki/models/eft/common/ILocationBase"; import { ILocation } from "@spt-aki/models/eft/common/ILocation";
import { ILooseLoot } from "@spt-aki/models/eft/common/ILooseLoot";
import { ILocationsBase } from "@spt-aki/models/eft/common/tables/ILocationsBase"; import { ILocationsBase } from "@spt-aki/models/eft/common/tables/ILocationsBase";
export interface ILocations { export interface ILocations {
bigmap?: ILocationData; bigmap?: ILocation;
develop?: ILocationData; develop?: ILocation;
factory4_day?: ILocationData; factory4_day?: ILocation;
factory4_night?: ILocationData; factory4_night?: ILocation;
hideout?: ILocationData; hideout?: ILocation;
interchange?: ILocationData; interchange?: ILocation;
laboratory?: ILocationData; laboratory?: ILocation;
lighthouse?: ILocationData; lighthouse?: ILocation;
privatearea?: ILocationData; privatearea?: ILocation;
rezervbase?: ILocationData; rezervbase?: ILocation;
shoreline?: ILocationData; shoreline?: ILocation;
suburbs?: ILocationData; suburbs?: ILocation;
tarkovstreets?: ILocationData; tarkovstreets?: ILocation;
terminal?: ILocationData; terminal?: ILocation;
town?: ILocationData; town?: ILocation;
woods?: ILocationData; woods?: ILocation;
sandbox?: ILocationData; sandbox?: ILocation;
/** Holds a mapping of the linkages between locations on the UI */ /** Holds a mapping of the linkages between locations on the UI */
base?: ILocationsBase; base?: ILocationsBase;
} }
export interface ILocationData {
base: ILocationBase;
looseLoot?: ILooseLoot;
}

View File

@ -1,6 +1,18 @@
import { TraderServiceType } from "@spt-aki/models/enums/TraderServiceType"; import { TraderServiceType } from "@spt-aki/models/enums/TraderServiceType";
export interface ITraderServiceModel { export interface ITraderServiceModel {
serviceType: TraderServiceType; serviceType: TraderServiceType;
itemsToPay?: Record<string, number>[]; itemsToPay?: {
subServices?: Record<string, number>[]; [key: string]: number;
};
itemsToReceive?: string[];
subServices?: {
[key: string]: number;
};
requirements?: ITraderServiceRequirementsModel;
}
export interface ITraderServiceRequirementsModel {
completedQuests?: string[];
standings?: {
[key: string]: number;
};
} }

View File

@ -5,13 +5,15 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
export declare class ItemEventRouter { export declare class ItemEventRouter {
protected logger: ILogger; protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemEventRouters: ItemEventRouterDefinition[]; protected itemEventRouters: ItemEventRouterDefinition[];
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder); constructor(logger: ILogger, jsonUtil: JsonUtil, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder);
/** /**
* @param info Event request * @param info Event request
* @param sessionID Session id * @param sessionID Session id

View File

@ -6,5 +6,5 @@ export declare class HideoutItemEventRouter extends ItemEventRouterDefinition {
protected hideoutCallbacks: HideoutCallbacks; protected hideoutCallbacks: HideoutCallbacks;
constructor(hideoutCallbacks: HideoutCallbacks); constructor(hideoutCallbacks: HideoutCallbacks);
getHandledRoutes(): HandledRoute[]; getHandledRoutes(): HandledRoute[];
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse; handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
} }

View File

@ -8,5 +8,5 @@ export declare class InventoryItemEventRouter extends ItemEventRouterDefinition
protected hideoutCallbacks: HideoutCallbacks; protected hideoutCallbacks: HideoutCallbacks;
constructor(inventoryCallbacks: InventoryCallbacks, hideoutCallbacks: HideoutCallbacks); constructor(inventoryCallbacks: InventoryCallbacks, hideoutCallbacks: HideoutCallbacks);
getHandledRoutes(): HandledRoute[]; getHandledRoutes(): HandledRoute[];
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse; handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse;
} }

View File

@ -1,5 +1,5 @@
/// <reference types="node" /> /// <reference types="node" />
import http, { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ApplicationContext } from "@spt-aki/context/ApplicationContext"; import { ApplicationContext } from "@spt-aki/context/ApplicationContext";
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
@ -25,5 +25,5 @@ export declare class HttpServer {
*/ */
load(): void; load(): void;
protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void;
protected getCookies(req: http.IncomingMessage): Record<string, string>; protected getCookies(req: IncomingMessage): Record<string, string>;
} }

View File

@ -75,8 +75,9 @@ export declare class SaveServer {
* Save changes from in-memory profile to user/profiles json * Save changes from in-memory profile to user/profiles json
* Execute onBeforeSaveCallbacks callbacks prior to being saved to json * Execute onBeforeSaveCallbacks callbacks prior to being saved to json
* @param sessionID profile id (user/profiles/id.json) * @param sessionID profile id (user/profiles/id.json)
* @returns time taken to save in MS
*/ */
saveProfile(sessionID: string): void; saveProfile(sessionID: string): number;
/** /**
* Remove a physical profile json from user/profiles * Remove a physical profile json from user/profiles
* @param sessionID Profile id to remove * @param sessionID Profile id to remove

View File

@ -11,6 +11,7 @@ export declare class BotGenerationCacheService {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected storedBots: Map<string, IBotBase[]>; protected storedBots: Map<string, IBotBase[]>;
protected activeBotsInRaid: IBotBase[];
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper); constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper);
/** /**
* Store array of bots in cache, shuffle results before storage * Store array of bots in cache, shuffle results before storage
@ -24,6 +25,18 @@ export declare class BotGenerationCacheService {
* @returns IBotBase object * @returns IBotBase object
*/ */
getBot(key: string): IBotBase; getBot(key: string): IBotBase;
/**
* Cache a bot that has been sent to the client in memory for later use post-raid to determine if player killed a traitor scav
* @param botToStore Bot object to store
*/
storeUsedBot(botToStore: IBotBase): void;
/**
* Get a bot by its profileId that has been generated and sent to client for current raid
* Cache is wiped post-raid in client/match/offline/end endOfflineRaid()
* @param profileId Id of bot to get
* @returns IBotBase
*/
getUsedBot(profileId: string): IBotBase;
/** /**
* Remove all cached bot profiles from memory * Remove all cached bot profiles from memory
*/ */

View File

@ -30,7 +30,7 @@ export declare class BotLootCacheService {
* @param botJsonTemplate Base json db file for the bot having its loot generated * @param botJsonTemplate Base json db file for the bot having its loot generated
* @returns ITemplateItem array * @returns ITemplateItem array
*/ */
getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, botJsonTemplate: IBotType): ITemplateItem[]; getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, botJsonTemplate: IBotType): Record<string, number>;
/** /**
* Generate loot for a bot and store inside a private class property * Generate loot for a bot and store inside a private class property
* @param botRole bots role (assault / pmcBot etc) * @param botRole bots role (assault / pmcBot etc)
@ -38,17 +38,13 @@ export declare class BotLootCacheService {
* @param botJsonTemplate db template for bot having its loot generated * @param botJsonTemplate db template for bot having its loot generated
*/ */
protected addLootToCache(botRole: string, isPmc: boolean, botJsonTemplate: IBotType): void; protected addLootToCache(botRole: string, isPmc: boolean, botJsonTemplate: IBotType): void;
/**
* Sort a pool of item objects by its flea price
* @param poolToSort pool of items to sort
*/
protected sortPoolByRagfairPrice(poolToSort: ITemplateItem[]): void;
/** /**
* Add unique items into combined pool * Add unique items into combined pool
* @param combinedItemPool Pool of items to add to * @param poolToAddTo Pool of items to add to
* @param itemsToAdd items to add to combined pool if unique * @param itemsToAdd items to add to combined pool if unique
*/ */
protected addUniqueItemsToPool(combinedItemPool: ITemplateItem[], itemsToAdd: ITemplateItem[]): void; protected addUniqueItemsToPool(poolToAddTo: ITemplateItem[], itemsToAdd: ITemplateItem[]): void;
protected addItemsToPool(poolToAddTo: Record<string, number>, poolOfItemsToAdd: Record<string, number>): void;
/** /**
* Ammo/grenades have this property * Ammo/grenades have this property
* @param props * @param props

View File

@ -1,13 +1,12 @@
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
import { MinMax } from "@spt-aki/models/common/MinMax";
import { IFenceLevel } from "@spt-aki/models/eft/common/IGlobals"; import { IFenceLevel } from "@spt-aki/models/eft/common/IGlobals";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
@ -64,7 +63,7 @@ export declare class FenceService {
* @param itemMultipler multipler to use on items * @param itemMultipler multipler to use on items
* @param presetMultiplier preset multipler to use on presets * @param presetMultiplier preset multipler to use on presets
*/ */
protected adjustAssortItemPrices(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void; protected adjustAssortItemPricesByConfigMultiplier(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void;
/** /**
* Merge two trader assort files together * Merge two trader assort files together
* @param firstAssort assort 1# * @param firstAssort assort 1#
@ -153,14 +152,44 @@ export declare class FenceService {
* Add item assorts to existing assort data * Add item assorts to existing assort data
* @param assortCount Number to add * @param assortCount Number to add
* @param assorts Assorts data to add to * @param assorts Assorts data to add to
* @param baseFenceAssort Base data to draw from * @param baseFenceAssortClone Base data to draw from
* @param itemTypeCounts * @param itemTypeLimits
* @param loyaltyLevel Loyalty level to set new item to * @param loyaltyLevel Loyalty level to set new item to
*/ */
protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, itemTypeCounts: Record<string, { protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record<string, {
current: number; current: number;
max: number; max: number;
}>, loyaltyLevel: number): void; }>, loyaltyLevel: number): void;
/**
* Find an assort item that matches the first parameter, also matches based on upd properties
* e.g. salewa hp resource units left
* @param rootItemBeingAdded item to look for a match against
* @param itemDbDetails Db details of matching item
* @param fenceItemAssorts Items to search through
* @returns Matching assort item
*/
protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item;
/**
* Should this item be forced into only 1 stack on fence
* @param existingItem Existing item from fence assort
* @param itemDbDetails Item we want to add db details
* @returns True item should be force stacked
*/
protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean;
/**
* Adjust price of item based on what is left to buy (resource/uses left)
* @param barterSchemes All barter scheme for item having price adjusted
* @param itemRoot Root item having price adjusted
* @param itemTemplate Db template of item
*/
protected adjustItemPriceByQuality(barterSchemes: Record<string, IBarterScheme[][]>, itemRoot: Item, itemTemplate: ITemplateItem): void;
protected getMatchingItemLimit(itemTypeLimits: Record<string, {
current: number;
max: number;
}>, itemTpl: string): {
current: number;
max: number;
};
/** /**
* Find presets in base fence assort and add desired number to 'assorts' parameter * Find presets in base fence assort and add desired number to 'assorts' parameter
* @param desiredWeaponPresetsCount * @param desiredWeaponPresetsCount
@ -202,10 +231,10 @@ export declare class FenceService {
/** /**
* Generate a randomised current and max durabiltiy value for an armor item * Generate a randomised current and max durabiltiy value for an armor item
* @param itemDetails Item to create values for * @param itemDetails Item to create values for
* @param maxDurabilityMinMaxPercent Max durabiltiy percent min/max values * @param equipmentDurabilityLimits Max durabiltiy percent min/max values
* @returns Durability + MaxDurability values * @returns Durability + MaxDurability values
*/ */
protected getRandomisedArmorDurabilityValues(itemDetails: ITemplateItem, maxDurabilityMinMaxPercent: MinMax): Repairable; protected getRandomisedArmorDurabilityValues(itemDetails: ITemplateItem, equipmentDurabilityLimits: IItemDurabilityCurrentMax): Repairable;
/** /**
* Construct item limit record to hold max and current item count * Construct item limit record to hold max and current item count
* @param limits limits as defined in config * @param limits limits as defined in config

View File

@ -70,12 +70,6 @@ export declare class InsuranceService {
* @param mapId Id of the map player died/exited that caused the insurance to be issued on * @param mapId Id of the map player died/exited that caused the insurance to be issued on
*/ */
sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void;
/**
* Send a message to player informing them gear was completely lost
* @param sessionId Session id
* @param locationName name of map insurance was lost on
*/
sendLostInsuranceMessage(sessionId: string, locationName?: string): void;
/** /**
* Check all root insured items and remove location property + set slotId to 'hideout' * Check all root insured items and remove location property + set slotId to 'hideout'
* @param sessionId Session id * @param sessionId Session id

View File

@ -15,6 +15,17 @@ export declare class ItemFilterService {
* @returns true if blacklisted * @returns true if blacklisted
*/ */
isItemBlacklisted(tpl: string): boolean; isItemBlacklisted(tpl: string): boolean;
/**
* Check if item is blacklisted from being a reward for player
* @param tpl item tpl to check is on blacklist
* @returns True when blacklisted
*/
isItemRewardBlacklisted(tpl: string): boolean;
/**
* Get an array of items that should never be given as a reward to player
* @returns string array of item tpls
*/
getItemRewardBlacklist(): string[];
/** /**
* Return every template id blacklisted in config/item.json * Return every template id blacklisted in config/item.json
* @returns string array of blacklisted tempalte ids * @returns string array of blacklisted tempalte ids

View File

@ -1,4 +1,3 @@
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
import { SaveServer } from "@spt-aki/servers/SaveServer"; import { SaveServer } from "@spt-aki/servers/SaveServer";
import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class MatchLocationService { export declare class MatchLocationService {
@ -6,6 +5,5 @@ export declare class MatchLocationService {
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected locations: {}; protected locations: {};
constructor(timeUtil: TimeUtil, saveServer: SaveServer); constructor(timeUtil: TimeUtil, saveServer: SaveServer);
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
deleteGroup(info: any): void; deleteGroup(info: any): void;
} }

View File

@ -1,13 +1,13 @@
import ts from "typescript"; import ts from "typescript";
import type { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import type { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { HashCacheService } from "@spt-aki/services/HashCacheService"; import { ModHashCacheService } from "@spt-aki/services/cache/ModHashCacheService";
import { VFS } from "@spt-aki/utils/VFS"; import { VFS } from "@spt-aki/utils/VFS";
export declare class ModCompilerService { export declare class ModCompilerService {
protected logger: ILogger; protected logger: ILogger;
protected hashCacheService: HashCacheService; protected modHashCacheService: ModHashCacheService;
protected vfs: VFS; protected vfs: VFS;
protected serverDependencies: string[]; protected serverDependencies: string[];
constructor(logger: ILogger, hashCacheService: HashCacheService, vfs: VFS); constructor(logger: ILogger, modHashCacheService: ModHashCacheService, vfs: VFS);
/** /**
* Convert a mods TS into JS * Convert a mods TS into JS
* @param modName Name of mod * @param modName Name of mod

View File

@ -27,12 +27,12 @@ export declare class PaymentService {
constructor(logger: ILogger, hashUtil: HashUtil, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper); constructor(logger: ILogger, hashUtil: HashUtil, httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, traderHelper: TraderHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, localisationService: LocalisationService, paymentHelper: PaymentHelper);
/** /**
* Take money and insert items into return to server request * Take money and insert items into return to server request
* @param {IPmcData} pmcData Player profile * @param pmcData Pmc profile
* @param {IProcessBuyTradeRequestData} request * @param request Buy item request
* @param {string} sessionID * @param sessionID Session id
* @returns IItemEventRouterResponse * @param output Client response
*/ */
payMoney(pmcData: IPmcData, request: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; payMoney(pmcData: IPmcData, request: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): void;
/** /**
* Get the item price of a specific traders assort * Get the item price of a specific traders assort
* @param traderAssortId Id of assort to look up * @param traderAssortId Id of assort to look up

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