From aad0a36b1167aee36e7da0683f8b2e3c5d88a276 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sat, 28 Jan 2023 20:50:35 +0000 Subject: [PATCH] Update types --- .../types/callbacks/DataCallbacks.d.ts | 12 +- .../types/callbacks/HealthCallbacks.d.ts | 9 ++ .../types/callbacks/HideoutCallbacks.d.ts | 51 ++----- .../types/callbacks/MatchCallbacks.d.ts | 4 +- .../types/callbacks/RagfairCallbacks.d.ts | 6 +- .../types/context/ContextVariableType.d.ts | 2 +- .../types/controllers/BotController.d.ts | 4 +- .../types/controllers/GameController.d.ts | 20 ++- .../types/controllers/HealthController.d.ts | 15 ++ .../types/controllers/HideoutController.d.ts | 133 ++++++++++++++++-- .../controllers/InsuranceController.d.ts | 12 +- .../controllers/InventoryController.d.ts | 9 +- .../types/controllers/MatchController.d.ts | 20 +-- .../types/controllers/ProfileController.d.ts | 4 +- .../types/controllers/RagfairController.d.ts | 6 + .../RepeatableQuestController.d.ts | 9 +- .../generators/BotEquipmentModGenerator.d.ts | 2 +- .../types/generators/BotWeaponGenerator.d.ts | 17 ++- .../types/generators/LocationGenerator.d.ts | 3 +- .../generators/RagfairOfferGenerator.d.ts | 31 +++- .../implementations/UbglExternalMagGen.d.ts | 10 ++ .../helpers/BotWeaponGeneratorHelper.d.ts | 6 +- .../types/helpers/DurabilityLimitsHelper.d.ts | 2 + .../types/helpers/HealthHelper.d.ts | 19 ++- .../types/helpers/HideoutHelper.d.ts | 32 ++++- .../types/helpers/InRaidHelper.d.ts | 5 + .../types/helpers/InventoryHelper.d.ts | 35 ++++- .../types/helpers/QuestHelper.d.ts | 66 +++++---- .../types/helpers/TradeHelper.d.ts | 14 +- .../types/helpers/TraderHelper.d.ts | 11 +- .../types/loaders/PreAkiModLoader.d.ts | 2 + .../types/models/eft/common/IGlobals.d.ts | 125 +++++++++++++++- .../models/eft/common/ILocationBase.d.ts | 2 + .../models/eft/common/tables/IBotBase.d.ts | 13 ++ .../types/models/eft/common/tables/IItem.d.ts | 10 +- .../eft/common/tables/IProfileTemplate.d.ts | 2 + .../models/eft/common/tables/IQuest.d.ts | 8 +- .../eft/common/tables/ITemplateItem.d.ts | 6 + .../models/eft/common/tables/ITrader.d.ts | 7 + .../eft/game/IGetItemPricesResponse.d.ts | 5 + .../types/models/eft/health/Effect.d.ts | 4 +- .../types/models/eft/health/IWorkoutData.d.ts | 4 + .../hideout/IHandleQTEEventRequestData.d.ts | 8 ++ .../models/eft/hideout/IHideoutArea.d.ts | 38 ++++- .../IHideoutImproveAreaRequestData.d.ts | 13 ++ .../eft/hideout/IHideoutProduction.d.ts | 5 +- .../types/models/eft/hideout/IQteData.d.ts | 38 +++++ .../hideout/IRecordShootingRangePoints.d.ts | 4 + .../eft/inventory/IAddItemTempObject.d.ts | 7 + .../eft/itemEvent/IItemEventRouterBase.d.ts | 17 +++ .../IGetRaidConfigurationRequestData.d.ts | 30 ++++ .../match/IStartOffineRaidRequestData.d.ts | 30 ---- .../eft/quests/IFailQuestRequestData.d.ts | 5 + .../trade/IProcessSellTradeRequestData.d.ts | 1 + .../types/models/enums/BaseClasses.d.ts | 3 + .../types/models/enums/ELocationName.d.ts | 1 + .../types/models/enums/HideoutAreas.d.ts | 4 +- .../models/enums/HideoutEventActions.d.ts | 4 +- .../types/models/enums/ItemEventActions.d.ts | 3 +- .../types/models/enums/QuestRewardType.d.ts | 3 +- .../types/models/enums/QuestStatus.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../models/spt/bots/GenerateWeaponResult.d.ts | 3 +- .../models/spt/callbacks/IMatchCallbacks.d.ts | 25 ---- .../models/spt/config/IAirdropConfig.d.ts | 3 + .../types/models/spt/config/IBotConfig.d.ts | 1 + .../models/spt/config/IBotDurability.d.ts | 20 ++- .../models/spt/config/IHideoutConfig.d.ts | 1 + .../models/spt/config/ILocationConfig.d.ts | 5 + .../models/spt/config/IRepairConfig.d.ts | 20 +++ .../spt/config/ISeasonalEventConfig.d.ts | 6 + .../models/spt/config/ITraderConfig.d.ts | 10 +- .../models/spt/server/IDatabaseTables.d.ts | 4 +- .../types/routers/EventOutputHolder.d.ts | 25 +++- .../item_events/InventoryItemEventRouter.d.ts | 4 +- .../types/servers/SaveServer.d.ts | 56 +++++++- .../types/servers/http/AkiHttpListener.d.ts | 1 + .../services/BotEquipmentFilterService.d.ts | 9 +- .../types/services/FenceService.d.ts | 51 +++++-- .../types/services/PaymentService.d.ts | 16 ++- .../types/services/ProfileFixerService.d.ts | 21 ++- .../types/services/RagfairPriceService.d.ts | 1 + .../types/services/RepairService.d.ts | 23 ++- .../types/services/SeasonalEventService.d.ts | 8 ++ .../types/utils/RandomUtil.d.ts | 1 + .../10ScopesAndTypes/types/utils/VFS.d.ts | 2 +- .../types/controllers/BotController.d.ts | 4 +- .../types/controllers/GameController.d.ts | 21 ++- .../types/controllers/HealthController.d.ts | 18 ++- .../types/controllers/HideoutController.d.ts | 16 ++- .../types/controllers/MatchController.d.ts | 6 +- .../RepeatableQuestController.d.ts | 2 +- .../generators/BotEquipmentModGenerator.d.ts | 2 +- .../types/generators/BotWeaponGenerator.d.ts | 14 ++ .../types/generators/PMCLootGenerator.d.ts | 12 +- .../generators/RagfairAssortGenerator.d.ts | 4 +- .../implementations/UbglExternalMagGen.d.ts | 10 ++ .../types/helpers/AssortHelper.d.ts | 5 +- .../types/helpers/BotDifficultyHelper.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 6 +- .../types/helpers/BotHelper.d.ts | 16 +-- .../helpers/BotWeaponGeneratorHelper.d.ts | 18 +-- .../types/helpers/DurabilityLimitsHelper.d.ts | 8 +- .../types/helpers/HealthHelper.d.ts | 20 +-- .../types/helpers/HideoutHelper.d.ts | 36 ++++- .../types/helpers/QuestHelper.d.ts | 65 +++++---- .../types/helpers/RagfairSellHelper.d.ts | 2 +- .../types/helpers/RagfairSortHelper.d.ts | 2 +- .../types/helpers/RepairHelper.d.ts | 4 +- .../types/helpers/TradeHelper.d.ts | 2 +- .../types/helpers/TraderAssortHelper.d.ts | 8 +- .../types/helpers/TraderHelper.d.ts | 14 +- .../types/loaders/PostAkiModLoader.d.ts | 4 +- .../types/models/eft/common/IGlobals.d.ts | 5 + .../models/eft/common/tables/IBotBase.d.ts | 13 +- .../types/models/eft/common/tables/IItem.d.ts | 11 ++ .../models/eft/common/tables/IQuest.d.ts | 6 +- .../eft/common/tables/ITemplateItem.d.ts | 2 +- .../eft/itemEvent/IItemEventRouterBase.d.ts | 33 ++--- .../models/eft/match/IJoinMatchResult.d.ts | 4 +- .../profile/GetProfileStatusResponseData.d.ts | 8 +- .../eft/quests/IFailQuestRequestData.d.ts | 5 + .../types/models/enums/BaseClasses.d.ts | 1 + .../types/models/enums/QuestRewardType.d.ts | 3 +- .../types/models/enums/QuestStatus.d.ts | 3 +- .../models/spt/bots/GenerateWeaponResult.d.ts | 3 +- .../models/spt/config/IHideoutConfig.d.ts | 5 - .../models/spt/config/IInsuranceConfig.d.ts | 1 + .../models/spt/config/ILocationConfig.d.ts | 3 + .../models/spt/config/IRagfairConfig.d.ts | 3 +- .../models/spt/config/IRepairConfig.d.ts | 17 +++ .../types/routers/EventOutputHolder.d.ts | 30 +++- .../types/routers/ItemEventRouter.d.ts | 6 + .../types/servers/http/AkiHttpListener.d.ts | 3 +- .../services/BotEquipmentFilterService.d.ts | 10 +- .../types/services/InsuranceService.d.ts | 8 ++ .../types/services/PlayerService.d.ts | 4 +- .../types/services/ProfileFixerService.d.ts | 6 + .../types/services/RepairService.d.ts | 61 +++++++- .../types/services/SeasonalEventService.d.ts | 31 +++- .../1LogToConsole/types/utils/JsonUtil.d.ts | 2 +- .../1LogToConsole/types/utils/RandomUtil.d.ts | 1 + .../AbstractWinstonLogger.d.ts} | 25 ++-- .../utils/logging/WinstonMainLogger.d.ts | 13 ++ .../utils/logging/WinstonRequestLogger.d.ts | 14 ++ 145 files changed, 1553 insertions(+), 401 deletions(-) create mode 100644 TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/game/IGetItemPricesResponse.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/health/IWorkoutData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/hideout/IRecordShootingRangePoints.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemTempObject.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts delete mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/quests/IFailQuestRequestData.d.ts delete mode 100644 TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IMatchCallbacks.d.ts create mode 100644 TypeScript/1LogToConsole/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/eft/quests/IFailQuestRequestData.d.ts rename TypeScript/1LogToConsole/types/utils/{Logger.d.ts => logging/AbstractWinstonLogger.d.ts} (70%) create mode 100644 TypeScript/1LogToConsole/types/utils/logging/WinstonMainLogger.d.ts create mode 100644 TypeScript/1LogToConsole/types/utils/logging/WinstonRequestLogger.d.ts diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts index 1f359e5..a9bc1d6 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts @@ -1,8 +1,11 @@ +import { HideoutController } from "../controllers/HideoutController"; +import { RagfairController } from "../controllers/RagfairController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IGlobals } from "../models/eft/common/IGlobals"; import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem"; import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase"; import { IQuest } from "../models/eft/common/tables/IQuest"; +import { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse"; import { IHideoutArea } from "../models/eft/hideout/IHideoutArea"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; @@ -17,7 +20,9 @@ import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; protected databaseServer: DatabaseServer; - constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer); + protected ragfairController: RagfairController; + protected hideoutController: HideoutController; + constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handles client/settings * @returns ISettingsBase @@ -56,4 +61,9 @@ export declare class DataCallbacks { getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle client/hideout/qte/list + */ + getQteList(url: string, info: IEmptyRequestData, sessionID: string): string; + getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/HealthCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/HealthCallbacks.d.ts index 7edf03e..bd3e507 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/HealthCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/HealthCallbacks.d.ts @@ -7,6 +7,7 @@ import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealReques import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class HealthCallbacks { protected httpResponse: HttpResponseUtil; @@ -21,6 +22,14 @@ export declare class HealthCallbacks { * @returns empty response, no data sent back to client */ syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData; + /** + * Custom aki server request found in modules/QTEPatch.cs + * @param url + * @param info HealthListener.Instance.CurrentHealth class + * @param sessionID session id + * @returns empty response, no data sent back to client + */ + handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData; /** * Handle Eat * @returns IItemEventRouterResponse diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/HideoutCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/HideoutCallbacks.d.ts index 56450a9..f68401a 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/HideoutCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/HideoutCallbacks.d.ts @@ -1,7 +1,9 @@ import { HideoutController } from "../controllers/HideoutController"; import { OnUpdate } from "../di/OnUpdate"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; @@ -10,6 +12,7 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ConfigServer } from "../servers/ConfigServer"; @@ -21,76 +24,52 @@ export declare class HideoutCallbacks extends OnUpdate { configServer: ConfigServer); /** * Handle HideoutUpgrade - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutUpgradeComplete - * @param pmcData - * @param body - * @param sessionID - * @returns */ upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutPutItemsInAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeItemsFromAreaSlots - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutToggleArea - * @param pmcData - * @param body - * @param sessionID - * @returns */ toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutSingleProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutScavCaseProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutContinuousProductionStart - * @param pmcData - * @param body - * @param sessionID - * @returns */ continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handle HideoutTakeProduction - * @param pmcData - * @param body - * @param sessionID - * @returns */ takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Handle HideoutQuickTimeEvent + */ + handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - RecordShootingRangePoints + */ + improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts index 10fbc44..52e3290 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts @@ -7,10 +7,10 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -41,6 +41,6 @@ export declare class MatchCallbacks { getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; + getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts index 15597bf..de46b37 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts @@ -33,10 +33,14 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { getRoute(): string; search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData; getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData; - getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Handle /client/items/prices + * Called when clicking an item to list on flea + */ + getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; onUpdate(timeSinceLastRun: number): Promise; sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/context/ContextVariableType.d.ts b/TypeScript/10ScopesAndTypes/types/context/ContextVariableType.d.ts index fa5390f..49f3267 100644 --- a/TypeScript/10ScopesAndTypes/types/context/ContextVariableType.d.ts +++ b/TypeScript/10ScopesAndTypes/types/context/ContextVariableType.d.ts @@ -2,7 +2,7 @@ export declare enum ContextVariableType { /** Logged in users session id */ SESSION_ID = 0, /** Currently acive raid information */ - MATCH_INFO = 1, + RAID_CONFIGURATION = 1, /** Timestamp when client first connected */ CLIENT_START_TIMESTAMP = 2, /** When player is loading into map and loot is requested */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts index a80aaed..1d7eb9d 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts @@ -3,7 +3,6 @@ import { BotGenerator } from "../generators/BotGenerator"; import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; -import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; @@ -23,14 +22,13 @@ export declare class BotController { protected botDifficultyHelper: BotDifficultyHelper; protected botGenerationCacheService: BotGenerationCacheService; protected localisationService: LocalisationService; - protected weightedRandomHelper: WeightedRandomHelper; protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; static readonly pmcTypeLabel = "PMC"; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** * Return the number of bot loadout varieties to be generated * @param type bot Type we want the loadout gen count for diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index b23ccf7..3249ca8 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -1,4 +1,5 @@ import { ApplicationContext } from "../context/ApplicationContext"; +import { HideoutHelper } from "../helpers/HideoutHelper"; import { HttpServerHelper } from "../helpers/HttpServerHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { PreAkiModLoader } from "../loaders/PreAkiModLoader"; @@ -10,27 +11,44 @@ import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { LocalisationService } from "../services/LocalisationService"; +import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class GameController { protected logger: ILogger; protected databaseServer: DatabaseServer; + protected timeUtil: TimeUtil; protected preAkiModLoader: PreAkiModLoader; protected httpServerHelper: HttpServerHelper; + protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; + protected customLocationWaveService: CustomLocationWaveService; + protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max + */ + protected fixBrokenOfflineMapWaves(): void; + /** + * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions + */ + protected fixRoguesSpawningInstantlyOnLighthouse(): void; /** * Get a list of installed mods and save their details to the profile being used * @param fullProfile Profile to add mod details to diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts index 86f72e3..ed45616 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts @@ -2,6 +2,7 @@ import { HealthHelper } from "../helpers/HealthHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; @@ -36,6 +37,13 @@ export declare class HealthController { * @returns */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Consume food/water outside of a raid + * @param pmcData Player profile + * @param body request Object + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; /** * Occurs on post-raid healing page @@ -45,6 +53,13 @@ export declare class HealthController { * @returns */ healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; + /** + * applies skills from hideout workout. + * @param pmcData Player profile + * @param info Request data + * @param sessionID + */ + applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; /** * iterate over treatment request diff and find effects to remove from player limbs * @param sessionId diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts index 5b6507b..aa3ac58 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts @@ -7,7 +7,9 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData"; +import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData"; import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData"; @@ -16,6 +18,8 @@ import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTa import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData"; import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData"; +import { IQteData } from "../models/eft/hideout/IQteData"; +import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IHideoutConfig } from "../models/spt/config/IHideoutConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -52,8 +56,22 @@ export declare class HideoutController { protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil); - upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; - upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Start a hideout area upgrade + * @param pmcData Player profile + * @param request upgrade start request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Complete a hideout area upgrade + * @param pmcData Player profile + * @param request Completed upgrade request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; /** * Create item in hideout slot item array, remove item from player inventory * @param pmcData Profile data @@ -62,7 +80,14 @@ export declare class HideoutController { * @returns IItemEventRouterResponse object */ putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse; - takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Remove item from hideout area and place into player inventory + * @param pmcData Player profile + * @param request Take item out of area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeItemsFromAreaSlots(pmcData: IPmcData, request: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse; /** * Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot * @param sessionID Session id @@ -73,7 +98,21 @@ export declare class HideoutController { * @returns IItemEventRouterResponse response */ protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; - toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Toggle area on/off + * @param pmcData Player profile + * @param request Toggle area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Start production for an item from hideout area + * @param pmcData Player profile + * @param body Start prodution of single item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles event after clicking 'start' on the scav case hideout page @@ -87,20 +126,84 @@ export declare class HideoutController { * Add generated scav case rewards to player profile * @param pmcData player profile to add rewards to * @param rewards reward items to add to profile + * @param recipieId recipie id to save into Production dict */ - protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void; - continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; - takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; - protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void; + /** + * Start production of continuously created item + * @param pmcData Player profile + * @param request Continious production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + continuousProductionStart(pmcData: IPmcData, request: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take completed item out of hideout area and place into player inventory + * @param pmcData Player profile + * @param request Remove production from area request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Take recipie-type production out of hideout area and place into player inventory + * @param sessionID Session id + * @param recipe Completed recipie of item + * @param pmcData Player profile + * @param request Remove production from area request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Handles giving rewards stored in player profile to player after clicking 'get rewards' - * @param sessionID - * @param pmcData - * @param body - * @param output - * @returns + * @param sessionID Session id + * @param pmcData Player profile + * @param request Get rewards from scavcase craft request + * @param output Output object to update + * @returns IItemEventRouterResponse + */ + protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + /** + * Start area production for item + * @param pmcData Player profile + * @param request Start production request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Get quick time event list for hideout + * // TODO - implement this + * @param sessionId Session id + * @returns IQteData array + */ + getQteList(sessionId: string): IQteData[]; + /** + * Handle HideoutQuickTimeEvent on client/game/profile/items/moving + * Called after completing workout at gym + * @param sessionId Session id + * @param pmcData Profile to adjust + * @param request QTE result object + */ + handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse; + /** + * Record a high score from the shooting range into a player profiles overallcounters + * @param sessionId Session id + * @param pmcData Profile to update + * @param request shooting range score request + * @returns IItemEventRouterResponse + */ + recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutImproveArea + * @param sessionId Session id + * @param pmcData profile to improve area in + * @param request improve area request data + */ + improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse; + /** + * Function called every x seconds as part of onUpdate event */ - protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; - registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; update(): void; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index 54f31b5..af6e68d 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -31,13 +31,23 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer); + /** + * Process insurance items prior to being given to player in mail + */ processReturn(): void; + /** + * Add insurance to an item + * @param pmcData Player profile + * @param body Insurance request + * @param sessionID Session id + * @returns IItemEventRouterResponse object to send to client + */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; /** * Calculate insurance cost * @param info request object * @param sessionID session id - * @returns response object to send to client + * @returns IGetInsuranceCostResponseData object to send to client */ cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts index e1c08c0..129ede3 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts @@ -129,9 +129,14 @@ export declare class InventoryController { protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** - * Handles sorting of Inventory. + * Handle ApplyInventoryChanges + * Sorts supplied items. + * @param pmcData Player profile + * @param request sort request + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; + sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts index 2c78405..cb0c755 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts @@ -6,10 +6,9 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; +import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; -import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; -import { BotDifficulty } from "../models/enums/BotDifficulty"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig"; @@ -18,9 +17,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { BotGenerationCacheService } from "../services/BotGenerationCacheService"; import { BotLootCacheService } from "../services/BotLootCacheService"; -import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { MatchLocationService } from "../services/MatchLocationService"; -import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileSnapshotService } from "../services/ProfileSnapshotService"; export declare class MatchController { protected logger: ILogger; @@ -31,14 +28,12 @@ export declare class MatchController { protected botLootCacheService: BotLootCacheService; protected configServer: ConfigServer; protected profileSnapshotService: ProfileSnapshotService; - protected customLocationWaveService: CustomLocationWaveService; - protected openZoneService: OpenZoneService; protected botGenerationCacheService: BotGenerationCacheService; protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); + constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; createGroup(sessionID: string, info: ICreateGroupRequestData): any; @@ -46,12 +41,17 @@ export declare class MatchController { joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; getGroupStatus(info: IGetGroupStatusRequestData): any; - startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void; + /** + * Handle /client/raid/configuration + * @param request + * @param sessionID + */ + startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; /** * Convert a difficulty value from pre-raid screen to a bot difficulty - * @param botDifficulty dropdown difficulty + * @param botDifficulty dropdown difficulty value * @returns bot difficulty */ - protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: BotDifficulty): string; + protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string; endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts index 8c89a02..e76785a 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts @@ -1,6 +1,7 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { QuestHelper } from "../helpers/QuestHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IMiniProfile } from "../models/eft/launcher/IMiniProfile"; @@ -24,8 +25,9 @@ export declare class ProfileController { protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; protected traderHelper: TraderHelper; + protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts index 36a919f..fffcaa3 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts @@ -103,6 +103,11 @@ export declare class RagfairController { * @param profile full profile of player */ protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void; + /** + * Adjust ragfair offer stack count to match same value as traders assort stack count + * @param offer Flea offer to adjust + */ + protected setTraderOfferStackSize(offer: IRagfairOffer): void; protected isLinkedSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean; update(): void; @@ -115,6 +120,7 @@ export declare class RagfairController { addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer; getAllFleaPrices(): Record; + getStaticPrices(): Record; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index fee4d44..285be3e 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -236,16 +236,17 @@ export declare class RepeatableQuestController { generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward; debugLogRepeatableQuestIds(pmcData: IPmcData): void; probabilityObjectArray(configArrayInput: ProbabilityObject[]): ProbabilityObjectArray; - changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; + changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) - * @returns a list of rewardable items [[_tpl, itemTemplate],...] + * 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 a list of rewardable items [[_tpl, itemTemplate],...] */ protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [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 {*} tpl template id of item to check + * @param {string} tpl template id of item to check * @returns boolean: true if item is valid reward */ isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts index 5b937ca..6703a36 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts @@ -145,7 +145,7 @@ export declare class BotEquipmentModGenerator { * @param modToAdd template of mod to check * @param itemSlot slot the item will be placed in * @param modSlot slot the mod will fill - * @param parentTemplate tempalte of the mods parent item + * @param parentTemplate template of the mods parent item * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts index 938d61c..a68b82f 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts @@ -89,9 +89,10 @@ export declare class BotWeaponGenerator { /** * Checks if all required slots are occupied on a weapon and all it's mods * @param weaponItemArray Weapon + mods + * @param botRole role of bot weapon is for * @returns true if valid */ - protected isWeaponValid(weaponItemArray: Item[]): boolean; + protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean; /** * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer @@ -101,6 +102,13 @@ export declare class BotWeaponGenerator { * @param botRole The bot type we're getting generating extra mags for */ addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + /** + * Add Grendaes for UBGL to bots vest and secure container + * @param weaponMods Weapon array with mods + * @param generatedWeaponResult result of weapon generation + * @param inventory bot inventory to add grenades to + */ + protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add @@ -137,6 +145,13 @@ export declare class BotWeaponGenerator { * @param ammoTpl */ protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void; + /** + * Add desired ammo tpl as item to weaponmods array, placed as child to UBGL + * @param weaponMods + * @param ubglMod + * @param ubglAmmoTpl + */ + protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void; /** * Add cartridge item to weapon Item array, if it already exists, update * @param weaponMods Weapon items array to amend diff --git a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts index a80ae3c..a617048 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts @@ -49,7 +49,8 @@ export declare class LocationGenerator { * Add forced spawn point loot into loot parameter array * @param loot array to add forced loot to * @param forcedSpawnPoints forced loot to add + * @param name of map currently generating forced loot for */ - protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void; + protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void; protected createItem(tpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts index 338cd5c..35fceff 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts @@ -103,7 +103,34 @@ export declare class RagfairOfferGenerator { * @param traderID Trader to generate offers for */ generateFleaOffersForTrader(traderID: string): void; - protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get array of an item with its mods + condition properties (e.g durability) + * Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition + * @param userID id of owner of item + * @param itemWithMods Item and mods, get condition of first item (only first array item is used) + * @param itemDetails db details of first item + * @returns + */ + protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[]; + /** + * Get the relevant condition id if item tpl matches in ragfair.json/condition + * @param tpl Item to look for matching condition object + * @returns condition id + */ + protected getDynamicConditionIdForTpl(tpl: string): string; + /** + * Alter an items condition based on its item base type + * @param conditionSettingsId also the parentId of item being altered + * @param item Item to adjust condition details of + * @param itemDetails db item details of first item in array + */ + protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void; + /** + * Adjust an items durability/maxDurability value + * @param item item (weapon/armor) to adjust + * @param multiplier Value to multiple durability by + */ + protected randomiseDurabilityValues(item: Item, multiplier: number): void; /** * Add missing conditions to an item if needed * Durabiltiy for repairable items @@ -111,7 +138,7 @@ export declare class RagfairOfferGenerator { * @param item item to add conditions to * @returns Item with conditions added */ - protected addMissingCondition(item: Item): Item; + protected addMissingConditions(item: Item): Item; /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer diff --git a/TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts b/TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts new file mode 100644 index 0000000..75395be --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts @@ -0,0 +1,10 @@ +import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper"; +import { IInventoryMagGen } from "../IInventoryMagGen"; +import { InventoryMagGen } from "../InventoryMagGen"; +export declare class UbglExternalMagGen implements IInventoryMagGen { + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper); + getPriority(): number; + canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean; + process(inventoryMagGen: InventoryMagGen): void; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts index b087fa9..3750d09 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -2,6 +2,7 @@ import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentSlots } from "../models/enums/EquipmentSlots"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -48,12 +49,13 @@ export declare class BotWeaponGeneratorHelper { */ createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** - * Add a specific number of cartrdiges to a bots inventory (vest/pocket) + * Add a specific number of cartrdiges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets * @param cartridgeCount number of cartridges to add to vest/pockets * @param inventory bot inventory to add cartridges to + * @param equipmentSlotsToAddTo what equpiment slots should bullets be added into */ - addBulletsToVestAndPockets(ammoTpl: string, cartridgeCount: number, inventory: Inventory): void; + addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for diff --git a/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts index 07a5db1..61c3478 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/DurabilityLimitsHelper.d.ts @@ -23,4 +23,6 @@ export declare class DurabilityLimitsHelper { protected getMaxWeaponDeltaFromConfig(botRole: string): number; protected getMinArmorDeltaFromConfig(botRole: string): number; protected getMaxArmorDeltaFromConfig(botRole: string): number; + protected getMinArmorLimitPercentFromConfig(botRole: string): number; + protected getMinWeaponLimitPercentFromConfig(botRole: string): number; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts index 6b5eec2..3a9381b 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts @@ -1,7 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Effect } from "../models/eft/health/Effect"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; -import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { Effects, IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IHealthConfig } from "../models/spt/config/IHealthConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -30,23 +29,29 @@ export declare class HealthHelper { * @param addEffects Should effects be added or removed (default - add) */ saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; + /** + * Adjust hydration/energy/temprate and body part hp values in player profile + * @param pmcData Profile to update + * @param sessionId Session id + */ protected saveHealth(pmcData: IPmcData, sessionID: string): void; /** * Save effects to profile * Works by removing all effects and adding them back from profile - * Remoces empty 'Effects' objects if found + * Removes empty 'Effects' objects if found * @param pmcData Player profile - * @param sessionID Session id + * @param sessionId Session id + * @param bodyPartsWithEffects dict of body parts with effects that should be added to profile * @param addEffects Should effects be added back to profile - * @returns */ - protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean, deleteExistingEffects?: boolean): void; + protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void; /** * Add effect to body part in profile * @param pmcData Player profile * @param effectBodyPart body part to edit * @param effectType Effect to add to body part + * @param duration How long the effect has left in seconds (-1 by default, no duration). */ - protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: Effect): void; + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index 9d51fed..6d64435 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Common, HideoutArea, Production, Productive } from "../models/eft/common/tables/IBotBase"; +import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase"; import { Upd } from "../models/eft/common/tables/IItem"; import { StageBonus } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; @@ -36,6 +36,7 @@ export declare class HideoutHelper { static waterCollector: string; static bitcoin: string; static expeditionaryFuelTank: string; + static maxSkillPoint: number; protected hideoutConfig: IHideoutConfig; constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; @@ -118,6 +119,35 @@ export declare class HideoutHelper { protected hasManagementSkillSlots(pmcData: IPmcData): boolean; protected getHideoutManagementSkill(pmcData: IPmcData): Common; protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; + /** + * Get the crafting skill details from player profile + * @param pmcData Player profile + * @returns crafting skill, null if not found + */ + protected getCraftingSkill(pmcData: IPmcData): Common; + /** + * Adjust craft time based on crafting skill level found in player profile + * @param pmcData Player profile + * @param productionTime Time to complete hideout craft in seconds + * @returns Adjusted craft time in seconds + */ + protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number; isProduction(productive: Productive): productive is Production; getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Upgrade hideout wall from starting level to interactable level if enough time has passed + * @param pmcProfile Profile to upgrade wall in + */ + unlockHideoutWallInProfile(pmcProfile: IPmcData): void; + /** + * Hideout improvement is flagged as complete + * @param improvement hideout improvement object + * @returns true if complete + */ + protected hideoutImprovementIsComplete(improvement: IHideoutImprovement): boolean; + /** + * Iterate over hideout improvements not completed and check if they need to be adjusted + * @param pmcProfile Profile to adjust + */ + setHideoutImprovementsToCompleted(pmcProfile: IPmcData): void; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts index df2c4af..4b32ac0 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts @@ -44,6 +44,11 @@ export declare class InRaidHelper { * @returns Reset profile object */ updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData; + /** + * Take body part effects from client profile and apply to server profile + * @param saveProgressRequest post-raid request + * @param profileData player profile on server + */ protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; /** * Some maps have one-time-use keys (e.g. Labs diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts index 1ce49da..8c44dc6 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts @@ -1,6 +1,7 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; -import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData"; +import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; @@ -46,15 +47,41 @@ export declare class InventoryHelper { /** * BUG: Passing the same item multiple times with a count of 1 will cause multiples of that item to be added (e.g. x3 separate objects of tar cola with count of 1 = 9 tarcolas being added to inventory) * @param pmcData Profile to add items to - * @param body request data to add items + * @param request request data to add items * @param output response to send back to client * @param sessionID Session id - * @param callback + * @param callback Code to execute later (function) * @param foundInRaid Will results added to inventory be set as found in raid * @param addUpd Additional upd propertys for items being added to inventory * @returns IItemEventRouterResponse */ - addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + addItem(pmcData: IPmcData, request: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: { + (): void; + }, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; + /** + * Add ammo to ammo boxes + * @param itemToAdd Item to check is ammo box + * @param toDo + * @param output IItemEventRouterResponse object + * @param sessionID Session id + * @param pmcData Profile to add ammobox to + */ + protected hydrateAmmoBoxWithAmmo(pmcData: IPmcData, itemToAdd: IAddItemTempObject, toDo: string[][], sessionID: string, output: IItemEventRouterResponse): void; + /** + * + * @param assortItems Items to add to inventory + * @param requestItem Details of purchased item to add to inventory + * @param result Array split stacks are added to + */ + protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; + /** + * Remove item from player inventory + * @param pmcData Profile to remove item from + * @param itemId Items id to remove + * @param sessionID Session id + * @param output Existing IItemEventRouterResponse object to append data to, creates new one by default if not supplied + * @returns IItemEventRouterResponse + */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts index 6bd1444..3a2c9dc 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { Quest } from "../models/eft/common/tables/IBotBase"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; -import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; +import { IFailQuestRequestData } from "../models/eft/quests/IFailQuestRequestData"; import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -54,7 +55,7 @@ export declare class QuestHelper { doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean; /** * Get the quests found in both arrays (inner join) - * @param before Array of qeusts #1 + * @param before Array of quests #1 * @param after Array of quests #2 * @returns Reduction of cartesian product between two quest arrays */ @@ -90,12 +91,12 @@ export declare class QuestHelper { */ getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[]; /** - * Update player profile with quest status (e.g. Fail/Success) - * @param pmcData profile to add quest to - * @param newState state the new quest should be in when added - * @param acceptedQuest Details of quest being added + * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile + * @param pmcData Player profile + * @param newState State the new quest should be in when returned + * @param acceptedQuest Details of accepted quest from client */ - addQuestToPMCData(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): void; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; /** * TODO: what is going on here * @param acceptedQuestId Quest to add to profile @@ -147,16 +148,16 @@ export declare class QuestHelper { getQuestWithOnlyLevelRequirementStartCondition(quest: IQuest): IQuest; /** * Fail a quest in a player profile - * @param pmcData Profile - * @param failRequest fail quest request data + * @param pmcData Player profile + * @param failRequest Fail quest request data * @param sessionID Session id * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: any, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Get quest by id from database - * @param questId questid to look for - * @param pmcData player profile + * Get quest by id from database (repeatables are stored in profile, check there if questId not found) + * @param questId Id of quest to find + * @param pmcData Player profile * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; @@ -167,25 +168,36 @@ export declare class QuestHelper { */ getQuestLocaleIdFromDb(questMessageId: string): string; /** - * Alter a quests state + Add a record to tis status timers object + * Alter a quests state + Add a record to its status timers object * @param pmcData Profile to update - * @param newQuestState new state the qeust should be in - * @param questId id of the quest to alter the status of + * @param newQuestState New state the qeust should be in + * @param questId Id of the quest to alter the status of */ updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void; /** - * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks - Returns reward items player earned * @param pmcData Player profile - * @param body complete quest request - * @param state State of the quest now its complete - * @param sessionID Seession id - * @returns array of reward objects + * @param questId questId of quest to get rewards for + * @param state State of the quest to get rewards for + * @param sessionId Session id + * @param questResponse Response to send back to client + * @returns Array of reward objects */ - applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: QuestStatus, sessionID: string): Reward[]; + applyQuestReward(pmcData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): Reward[]; /** - * Get the intel center bonus a player has + * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile + * also update client response recipeUnlocked array with craft id + * @param pmcData Player profile + * @param craftUnlockReward Reward item from quest with craft unlock details + * @param questDetails Quest with craft unlock reward + * @param sessionID Session id + * @param response Response to send back to client + */ + protected findAndAddHideoutProductionIdToProfile(pmcData: IPmcData, craftUnlockReward: Reward, questDetails: IQuest, sessionID: string, response: IItemEventRouterResponse): void; + /** + * Get players intel center bonus from profile * @param pmcData player profile - * @returns bonus in percent + * @returns bonus as a percent */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** @@ -194,4 +206,10 @@ export declare class QuestHelper { * @returns 'FindItem' condition id */ getFindItemIdForQuestHandIn(itemTpl: string): string; + /** + * Add all quests to a profile with the provided statuses + * @param pmcProfile profile to update + * @param statuses statuses quests should have + */ + addAllQuestsToProfile(pmcProfile: IPmcData, statuses: QuestStatus[]): void; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts index 94ec382..0c7aa7b 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts @@ -27,10 +27,10 @@ export declare class TradeHelper { constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer); /** * Buy item from flea or trader - * @param pmcData + * @param pmcData Player profile * @param buyRequestData data from client - * @param sessionID - * @param foundInRaid + * @param sessionID Session id + * @param foundInRaid Should item be found in raid * @param upd optional item details used when buying from flea * @returns */ @@ -38,11 +38,11 @@ export declare class TradeHelper { /** * Sell item to trader * @param pmcData Profile to update - * @param body - * @param sessionID - * @returns + * @param sellRequest request data + * @param sessionID Session id + * @returns IItemEventRouterResponse */ - sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; + sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased * Show error on screen if player attepts to buy more than what the buy max allows diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index 62a3492..e69c593 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -76,7 +76,7 @@ export declare class TraderHelper { */ protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; /** - * Get the price of an item and all of its attached children + * Get the price of passed in item and all of its attached children (mods) * Take into account bonuses/adjsutments e.g. discounts * @param pmcData profile data * @param item item to calculate price of @@ -94,7 +94,14 @@ export declare class TraderHelper { * @returns price as number */ protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; + /** + * Get discount modifier for desired trader + * @param trader Trader to get discount for + * @param buyPriceCoefficient + * @param fenceInfo fence info, needed if getting fence modifier value + * @returns discount modifier value + */ + protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionID Session id diff --git a/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts b/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts index 212aaf3..38595f1 100644 --- a/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts +++ b/TypeScript/10ScopesAndTypes/types/loaders/PreAkiModLoader.d.ts @@ -23,6 +23,8 @@ export declare class PreAkiModLoader implements IModLoader { protected configServer: ConfigServer; protected static container: DependencyContainer; protected readonly basepath = "user/mods/"; + protected readonly modOrderPath = "user/mods/order.json"; + protected order: Record; protected imported: Record; protected akiConfig: ICoreConfig; constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer); diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts index b53f106..60cdf5b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts @@ -29,6 +29,8 @@ export interface Config { GlobalLootChanceModifier: number; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; + TradingSetting: number; + TradingSettings: ITradingSettings; LoadTimeSpeedProgress: number; BaseLoadTime: number; BaseUnloadTime: number; @@ -36,6 +38,7 @@ export interface Config { Customization: Customization; UncheckOnShot: boolean; BotsEnabled: boolean; + BufferZone: IBufferZone; ArmorMaterials: ArmorMaterials; LegsOverdamage: number; HandsOverdamage: number; @@ -55,7 +58,6 @@ export interface Config { StaminaRestoration: StaminaRestoration; StaminaDrain: StaminaDrain; RequirementReferences: RequirementReferences; - RepairKitSettings: RepairKitSettings; RestrictionsInRaid: RestrictionsInRaid[]; SkillMinEffectiveness: number; SkillFatiguePerPoint: number; @@ -83,6 +85,19 @@ export interface Config { Inertia: Inertia; Ballistic: Ballistic; } +export interface IBufferZone { + CustomerAccessTime: number; + CustomerCriticalTimeStart: number; + CustomerKickNotifTime: number; +} +export interface ITradingSettings { + BuyoutRestrictions: IBuyoutRestrictions; +} +export interface IBuyoutRestrictions { + MinDurability: number; + MinFoodDrinkResource: number; + MinMedsResource: number; +} export interface Content { ip: string; port: number; @@ -321,6 +336,8 @@ export interface Effects { Pain: Pain; PainKiller: PainKiller; SandingScreen: SandingScreen; + MildMusclePain: IMusclePainEffect; + SevereMusclePain: IMusclePainEffect; Stimulator: Stimulator; Tremor: Tremor; ChronicStaminaFatigue: ChronicStaminaFatigue; @@ -457,6 +474,12 @@ export interface PainKiller { export interface SandingScreen { Dummy: number; } +export interface IMusclePainEffect { + GymEffectivity: number; + OfflineDurationMax: number; + OfflineDurationMin: number; + TraumaChance: number; +} export interface Stimulator { BuffLoopTime: number; Buffs: Buffs; @@ -803,7 +826,7 @@ export interface SkillsSettings { HMG: any[]; Launcher: any[]; AttachedLauncher: any[]; - Melee: any[]; + Melee: IMeleeSkill; DMR: WeaponSkills; BearAssaultoperations: any[]; BearAuthority: any[]; @@ -847,10 +870,25 @@ export interface SkillsSettings { BotSound: any[]; TroubleShooting: TroubleShooting; } +export interface IMeleeSkill { + BuffSettings: IBuffSettings; +} export interface ArmorSkills { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IArmorCounters; + MoveSpeedPenaltyReductionHVestsReducePerLevel: number; + RicochetChanceHVestsCurrentDurabilityThreshold: number; + RicochetChanceHVestsEliteLevel: number; + RicochetChanceHVestsMaxDurabilityThreshold: number; + MeleeDamageLVestsReducePerLevel: number; + MoveSpeedPenaltyReductionLVestsReducePerLevel: number; WearAmountRepairLVestsReducePerLevel: number; WearChanceRepairLVestsReduceEliteLevel: number; } +export interface IArmorCounters { + armorDurability: ISkillCounter; +} export interface HideoutManagement { SkillPointsPerAreaUpgrade: number; SkillPointsPerCraft: number; @@ -907,6 +945,7 @@ export interface Endurance { MovementAction: number; SprintAction: number; GainPerFatigueStack: number; + QTELevelMultipliers: Record>; } export interface Strength { SprintActionMin: number; @@ -915,9 +954,14 @@ export interface Strength { MovementActionMax: number; PushUpMin: number; PushUpMax: number; + QTELevelMultipliers: IQTELevelMultiplier[]; FistfightAction: number; ThrowAction: number; } +export interface IQTELevelMultiplier { + Level: number; + Multiplier: number; +} export interface Vitality { DamageTakenAction: number; HealthNegativeEffect: number; @@ -950,22 +994,42 @@ export interface Search { FindAction: number; } export interface WeaponTreatment { + BuffMaxCount: number; + BuffSettings: IBuffSettings; + Counters: IWeaponTreatmentCounters; DurLossReducePerLevel: number; SkillPointsPerRepair: number; Filter: any[]; WearAmountRepairGunsReducePerLevel: number; WearChanceRepairGunsReduceEliteLevel: number; } +export interface IWeaponTreatmentCounters { + firearmsDurability: ISkillCounter; +} +export interface IBuffSettings { + CommonBuffChanceLevelBonus: number; + CommonBuffMinChanceValue: number; + CurrentDurabilityLossToRemoveBuff?: number; + MaxDurabilityLossToRemoveBuff?: number; + RareBuffChanceCoff: number; + ReceivedDurabilityMaxPercent: number; +} export interface MagDrills { RaidLoadedAmmoAction: number; RaidUnloadedAmmoAction: number; MagazineCheckAction: number; } export interface Perception { + DependentSkillRatios: ISkillRatio[]; OnlineAction: number; UniqueLoot: number; } +export interface ISkillRatio { + Ratio: number; + SkillId: string; +} export interface Intellect { + Counters: IIntellectCounters; ExamineAction: number; SkillProgress: number; RepairAction: number; @@ -973,16 +1037,52 @@ export interface Intellect { WearChanceReduceEliteLevel: number; RepairPointsCostReduction: number; } +export interface IIntellectCounters { + armorDurability: ISkillCounter; + firearmsDurability: ISkillCounter; + meleeWeaponDurability: ISkillCounter; +} +export interface ISkillCounter { + divisor: number; + points: number; +} export interface Attention { + DependentSkillRatios: ISkillRatio[]; ExamineWithInstruction: number; FindActionFalse: number; FindActionTrue: number; } export interface Charisma { + BonusSettings: IBonusSettings; + Counters: ICharismaSkillCounters; SkillProgressInt: number; SkillProgressAtn: number; SkillProgressPer: number; } +export interface ICharismaSkillCounters { + insuranceCost: ISkillCounter; + repairCost: ISkillCounter; + repeatableQuestCompleteCount: ISkillCounter; + restoredHealthCost: ISkillCounter; + scavCaseCost: ISkillCounter; +} +export interface IBonusSettings { + EliteBonusSettings: IEliteBonusSettings; + LevelBonusSettings: ILevelBonusSettings; +} +export interface IEliteBonusSettings { + FenceStandingLossDiscount: number; + RepeatableQuestExtraCount: number; + ScavCaseDiscount: number; +} +export interface ILevelBonusSettings { + HealthRestoreDiscount: number; + HealthRestoreTraderDiscount: number; + InsuranceDiscount: number; + InsuranceTraderDiscount: number; + PaidExitDiscount: number; + RepeatableQuestChangeDiscount: number; +} export interface Memory { AnySkillUp: number; SkillProgress: number; @@ -1145,11 +1245,30 @@ export interface xyz { export interface Ballistic { GlobalDamageDegradationCoefficient: number; } -export interface RepairKitSettings { +export interface RepairSettings { + ItemEnhancementSettings: IItemEnhancementSettings; + MinimumLevelToApplyBuff: number; + RepairStrategies: IRepairStrategies; armorClassDivisor: number; durabilityPointCostArmor: number; durabilityPointCostGuns: number; } +export interface IItemEnhancementSettings { + DamageReduction: IPriceModifier; + MalfunctionProtections: IPriceModifier; + WeaponSpread: IPriceModifier; +} +export interface IPriceModifier { + PriceModifier: number; +} +export interface IRepairStrategies { + Armor: IRepairStrategy; + Firearms: IRepairStrategy; +} +export interface IRepairStrategy { + BuffTypes: string[]; + Filter: string[]; +} export interface BotPreset { UseThis: boolean; Role: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts index 78ade9a..9b97d7e 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILocationBase.d.ts @@ -118,6 +118,7 @@ export interface BossLocationSpawn { TriggerName: string; Delay?: number; Supports?: BossSupport[]; + sptId?: string; } export interface BossSupport { BossEscortAmount: string; @@ -202,6 +203,7 @@ export interface Wave { slots_min: number; time_max: number; time_min: number; + sptId?: string; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts index 1c28ae0..432c4c8 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts @@ -21,6 +21,7 @@ export interface IBotBase { Hideout: Hideout; Quests: Quest[]; TradersInfo: Record; + UnlockedInfo: IUnlockedInfo; RagfairInfo: RagfairInfo; RepeatableQuests: IPmcDataRepeatableQuest[]; Bonuses: Bonus[]; @@ -31,6 +32,9 @@ export interface IBotBase { /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IUnlockedInfo { + unlockedProductionRecipe: string[]; +} export interface Info { EntryPoint: string; Nickname: string; @@ -265,12 +269,19 @@ export interface InsuredItem { export interface Hideout { Production: Record; Areas: HideoutArea[]; + Improvements: Record; +} +export interface IHideoutImprovement { + completed: boolean; + improveCompleteTimestamp: number; } export interface Productive { Products: Product[]; Progress?: number; inProgress?: boolean; StartTimestamp?: number; + SkipTime?: number; + ProductionTime?: number; } export interface Production extends Productive { RecipeId: string; @@ -327,10 +338,12 @@ export interface Quest { statusTimers?: Record; /** SPT specific property */ completedConditions?: string[]; + availableAfter?: number; } export interface TraderInfo { loyaltyLevel: number; salesSum: number; + disabled: boolean; standing: number; nextResupply: number; unlocked: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IItem.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IItem.d.ts index 2dd2c03..d7095c1 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IItem.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IItem.d.ts @@ -7,6 +7,7 @@ export interface Item { upd?: Upd; } export interface Upd { + Buff?: Buff; OriginalStackObjectsCount?: number; Togglable?: Togglable; Map?: Map; @@ -31,6 +32,12 @@ export interface Upd { SideEffect?: SideEffect; RepairKit?: RepairKit; } +export interface Buff { + rarity: string; + buffType: string; + value: number; + thresholdDurability?: number; +} export interface Togglable { On: boolean; } @@ -98,7 +105,8 @@ export interface Location { y: number; r: string | number; isSearched?: boolean; - rotation?: string; + /** SPT property? */ + rotation?: string | boolean; } export interface SideEffect { Value: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts index fbcd81a..66ebbe8 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -19,6 +19,8 @@ export interface TemplateSide { } export interface ProfileTraderTemplate { initialLoyaltyLevel: number; + setQuestsAvailableForStart?: boolean; + setQuestsAvailableForFinish?: boolean; initialStanding: number; initialSalesSum: number; jaegerUnlocked: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts index d538126..5c939e1 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts @@ -2,7 +2,7 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { - QuestName: string; + QuestName?: string; _id: string; canShowNotificationsInGame: boolean; conditions: Conditions; @@ -15,6 +15,7 @@ export interface IQuest { image: string; type: string; isKey: boolean; + questStatus: any; restartable: boolean; instantComplete: boolean; secretQuest: boolean; @@ -22,7 +23,7 @@ export interface IQuest { successMessageText: string; templateId: string; rewards: Rewards; - status: string; + status: string | number; KeyQuest: boolean; changeQuestMessageText: string; side: string; @@ -43,12 +44,15 @@ export interface AvailableForProps { id: string; index: number; parentId: string; + isEncoded: boolean; dynamicLocale: boolean; value?: number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; status?: QuestStatus[]; + availableAfter?: number; + dispersion?: number; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts index 0fa7e18..b59a277 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts @@ -29,8 +29,11 @@ export interface Props { IsUnsaleable?: boolean; IsUnbuyable?: boolean; IsUngivable?: boolean; + IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsSpecialSlotOnly?: boolean; QuestItem?: boolean; + QuestStashMaxCount?: number; LootExperience?: number; ExamineExperience?: number; HideEntrails?: boolean; @@ -161,6 +164,7 @@ export interface Props { weaponErgonomicPenalty?: number; BluntThroughput?: number; ArmorMaterial?: string; + ArmorType?: string; weapClass?: string; weapUseType?: string; ammoCaliber?: string; @@ -365,6 +369,8 @@ export interface Props { CanBeHiddenDuringThrow?: boolean; MinTimeToContactExplode?: number; ExplosionEffectType?: string; + LinkedWeapon?: string; + UseAmmoWithoutShell?: boolean; } export interface IHealthEffect { type: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITrader.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITrader.d.ts index 246a5b8..1fcfbaa 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITrader.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITrader.d.ts @@ -9,6 +9,7 @@ export interface ITrader { export interface ITraderBase { refreshTraderRagfairOffers: boolean; _id: string; + availableInRaid: boolean; avatar: string; balance_dol: number; balance_eur: number; @@ -20,6 +21,8 @@ export interface ITraderBase { discount_end: number; gridHeight: number; insurance: Insurance; + items_buy: IItemBuyData; + items_buy_prohibited: IItemBuyData; location: string; loyaltyLevels: LoyaltyLevel[]; medic: boolean; @@ -31,6 +34,10 @@ export interface ITraderBase { surname: string; unlockedByDefault: boolean; } +export interface IItemBuyData { + category: string[]; + id_list: string[]; +} export interface Insurance { availability: boolean; excluded_category: string[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/IGetItemPricesResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGetItemPricesResponse.d.ts new file mode 100644 index 0000000..ab6e818 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/game/IGetItemPricesResponse.d.ts @@ -0,0 +1,5 @@ +export interface IGetItemPricesResponse { + supplyNextTime: number; + prices: Record; + currencyCourses: Record; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts index 7eb3ffc..62d95a8 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts @@ -1,5 +1,7 @@ export declare enum Effect { FRACTURE = "Fracture", LIGHT_BLEEDING = "LightBleeding", - HEAVY_BLEEDING = "HeavyBleeding" + HEAVY_BLEEDING = "HeavyBleeding", + MILD_MUSCLE_PAIN = "MildMusclePain", + SEVERE_MUSCLE_PAIN = "SevereMusclePain" } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/health/IWorkoutData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/health/IWorkoutData.d.ts new file mode 100644 index 0000000..ba629d2 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/health/IWorkoutData.d.ts @@ -0,0 +1,4 @@ +export interface IWorkoutData extends Record { + skills: any; + effects: any; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts new file mode 100644 index 0000000..5dda485 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHandleQTEEventRequestData.d.ts @@ -0,0 +1,8 @@ +export interface IHandleQTEEventRequestData { + Action: string; + /** true if QTE was successful, otherwise false */ + results: boolean[]; + /** Id of the QTE object used from db/hideout/qte.json */ + id: string; + timestamp: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts index d9fd2bf..fa5ca20 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutArea.d.ts @@ -3,23 +3,55 @@ export interface IHideoutArea { type: number; enabled: boolean; needsFuel: boolean; + requirements: IAreaRequirement[]; takeFromSlotLocked: boolean; craftGivesExp: boolean; + displayLevel: boolean; + enableAreaRequirements: boolean; stages: Record; } +export interface IAreaRequirement { + areaType: number; + requiredlevel: number; + type: string; +} export interface Stage { - requirements: Requirement[]; + autoUpgrade: boolean; bonuses: StageBonus[]; - slots: number; constructionTime: number; description: string; + displayInterface: boolean; + improvements: IStageImprovement[]; + requirements: IStageRequirement[]; + slots: number; } -export interface Requirement { +export interface IStageImprovement { + id: string; + bonuses: IStageImprovementBonus[]; + improvementTime: number; + requirements: IStageImprovementRequirement[]; +} +export interface IStageImprovementBonus { + passive: boolean; + production: boolean; + type: string; + value: number; + visible: boolean; +} +export interface IStageImprovementRequirement { + count: number; + isEncoded: boolean; + isFunctional: boolean; + templateId: string; + type: string; +} +export interface IStageRequirement { areaType?: number; requiredLevel?: number; type: string; templateId?: string; count?: number; + isEncoded: false; isFunctional?: boolean; traderId?: string; loyaltyLevel?: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts new file mode 100644 index 0000000..7e927bf --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts @@ -0,0 +1,13 @@ +export interface IHideoutImproveAreaRequestData { + Action: "HideoutImproveArea"; + /** Hideout area id from areas.json */ + id: string; + areaType: number; + items: HideoutItem[]; + timestamp: number; +} +export interface HideoutItem { + /** Hideout inventory id that was used by improvement action */ + id: string; + count: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts index 9295fb1..2367e08 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts @@ -3,8 +3,10 @@ export interface IHideoutProduction { areaType: number; requirements: Requirement[]; productionTime: number; - boosters?: any; endProduct: string; + isEncoded: boolean; + locked: boolean; + needFuelForAllProductionTime: boolean; continuous: boolean; count: number; productionLimitCount: number; @@ -12,6 +14,7 @@ export interface IHideoutProduction { export interface Requirement { templateId?: string; count?: number; + isEncoded?: boolean; isFunctional?: boolean; type: string; areaType?: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts new file mode 100644 index 0000000..f842b84 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts @@ -0,0 +1,38 @@ +export interface IQteData { + Id: string; + Type: string; + Area: string; + AreaLevel: number; + QuickTimeEvents: IQuickTimeEvent[]; + Requirements: IQteRequirement[]; + Results: Record; +} +export interface IQuickTimeEvent { + Type: string; + Position: number; + StartDelay: number; + EndDelay: number; + Speed: number; + SuccessRange: string; + Key: string; +} +export interface IQteRequirement { + type: string; +} +export interface IQteResult { + Energy: number; + Hydration: number; + RewardsRange: IQteEffect[]; +} +export interface IQteEffect { + Type: string; + SkillId: string; + levelMultipliers: ISkillLevelMultiplier[]; + Time: number; + Weight: number; + Result: string; +} +export interface ISkillLevelMultiplier { + level: number; + multiplier: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IRecordShootingRangePoints.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IRecordShootingRangePoints.d.ts new file mode 100644 index 0000000..5bfd2fd --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IRecordShootingRangePoints.d.ts @@ -0,0 +1,4 @@ +export interface IRecordShootingRangePoints { + Action: "RecordShootingRangePoints"; + points: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemTempObject.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemTempObject.d.ts new file mode 100644 index 0000000..62d4b64 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IAddItemTempObject.d.ts @@ -0,0 +1,7 @@ +import { Item, Location } from "../common/tables/IItem"; +export interface IAddItemTempObject { + itemRef: Item; + count: number; + isPreset: boolean; + location?: Location; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 6b18df3..0f6bd81 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,3 +1,4 @@ +import { QuestStatus } from "../../../models/enums/QuestStatus"; import { Skills } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; @@ -22,9 +23,21 @@ export interface ProfileChange { builds: BuildChange[]; items: ItemChanges; production: Record; + /** Hideout area improvement id */ + improvements: Record; skills: Skills; traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; + recipeUnlocked: Record; + questsStatus: QuestStatusChange[]; +} +export interface QuestStatusChange { + qid: string; + startTime: number; + status: QuestStatus; + statusTimers: Record; + completedConditions: string[]; + availableAfter: number; } export interface BuildChange { id: string; @@ -45,6 +58,10 @@ export interface Production { RecipeId: string; Products: Product[]; } +export interface Improvement { + completed: boolean; + improveCompleteTimestamp: number; +} export interface Product { _id: string; _tpl?: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts new file mode 100644 index 0000000..cbcc2f6 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts @@ -0,0 +1,30 @@ +export interface IGetRaidConfigurationRequestData { + timeVariant: string; + raidMode: string; + metabolismDisabled: boolean; + playersSpawnPlace: string; + timeAndWeatherSettings: TimeAndWeatherSettings; + botSettings: BotSettings; + wavesSettings: WavesSettings; + location: string; +} +export interface TimeAndWeatherSettings { + isRandomTime: boolean; + isRandomWeather: boolean; + cloudinessType: string; + rainType: string; + windType: string; + fogType: string; + timeFlowType: string; + hourOfDay: number; +} +export interface BotSettings { + isScavWars: boolean; + botAmount: string; +} +export interface WavesSettings { + botAmount: string; + botDifficulty: string; + isBosses: boolean; + isTaggedAndCursed: boolean; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts deleted file mode 100644 index 1983728..0000000 --- a/TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { BotAmount } from "../../enums/BotAmount"; -import { BotDifficulty } from "../../enums/BotDifficulty"; -export interface IStartOfflineRaidRequestData { - locationName: string; - /** Current time, not in-game time */ - startTime: number; - /** CURR = am, past = pm */ - dateTime: "CURR" | "PAST"; - gameSettings: GameSettings; -} -export interface GameSettings { - timeAndWeatherSettings: TimeAndWeatherSettings; - botsSettings: BotsSettings; - wavesSettings: WavesSettings; -} -export interface TimeAndWeatherSettings { - isRandomTime: boolean; - isRandomWeather: boolean; -} -export interface BotsSettings { - isEnabled: boolean; - isScavWars: boolean; - botAmount: BotAmount; -} -export interface WavesSettings { - botDifficulty: BotDifficulty; - isBosses: boolean; - isTaggedAndCursed: boolean; - wavesBotAmount: BotAmount; -} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/quests/IFailQuestRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/quests/IFailQuestRequestData.d.ts new file mode 100644 index 0000000..5881d91 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/quests/IFailQuestRequestData.d.ts @@ -0,0 +1,5 @@ +export interface IFailQuestRequestData { + Action: "QuestComplete"; + qid: string; + removeExcessItems: boolean; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/trade/IProcessSellTradeRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/trade/IProcessSellTradeRequestData.d.ts index f1d555f..dee0cd5 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/trade/IProcessSellTradeRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/trade/IProcessSellTradeRequestData.d.ts @@ -3,6 +3,7 @@ export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestDa Action: "sell_to_trader"; type: string; tid: string; + price: number; items: Item[]; } export interface Item { diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts index 7d11510..c6e880a 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts @@ -1,11 +1,13 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", + UBGL = "55818b014bdc2ddc698b456b", ARMOR = "5448e54d4bdc2dcc718b4568", ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", HEADWEAR = "5a341c4086f77401f2541505", FACECOVER = "5a341c4686f77469e155819e", VEST = "5448e5284bdc2dcb718b4567", BACKPACK = "5448e53e4bdc2d60728b4567", + COMPOUND = "566162e44bdc2d3f298b4573", VISORS = "5448e5724bdc2ddf718b4568", FOOD = "5448e8d04bdc2ddf718b4569", GAS_BLOCK = "56ea9461d2720b67698b456f", @@ -29,6 +31,7 @@ export declare enum BaseClasses { MUZZLE = "5448fe394bdc2d0d028b456c", SIGHTS = "5448fe7a4bdc2d6f028b456b", MEDS = "543be5664bdc2dd4348b4569", + MAP = "567849dd4bdc2d150f8b456e", MONEY = "543be5dd4bdc2deb348b4569", NIGHTVISION = "5a2c3a9486f774688b05e574", KEY = "543be5e94bdc2df1348b4568", diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/ELocationName.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/ELocationName.d.ts index 7ae7caa..c52ae87 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/ELocationName.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/ELocationName.d.ts @@ -8,5 +8,6 @@ export declare enum ELocationName { LIGHTHOUSE = "Lighthouse", LABORATORY = "laboratory", RESERVE = "RezervBase", + STREETS = "TarkovStreets", ANY = "any" } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts index b44a20a..c8313d9 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/HideoutAreas.d.ts @@ -21,5 +21,7 @@ export declare enum HideoutAreas { SOLAR_POWER = 18, BOOZE_GENERATOR = 19, BITCOIN_FARM = 20, - CHRISTMAS_TREE = 21 + CHRISTMAS_TREE = 21, + EMERGENCY_WALL = 22, + GYM = 23 } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/HideoutEventActions.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/HideoutEventActions.d.ts index e441477..aa04131 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/HideoutEventActions.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/HideoutEventActions.d.ts @@ -7,5 +7,7 @@ export declare enum HideoutEventActions { HIDEOUT_SINGLE_PRODUCTION_START = "HideoutSingleProductionStart", HIDEOUT_SCAV_CASE_PRODUCTION_START = "HideoutScavCaseProductionStart", HIDEOUT_CONTINUOUS_PRODUCTION_START = "HideoutContinuousProductionStart", - HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction" + HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction", + HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints", + HIDEOUT_IMPROVE_AREA = "HideoutImproveArea" } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts index 0e65453..94061f8 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts @@ -15,5 +15,6 @@ export declare enum ItemEventActions { CREATE_MAP_MARKER = "CreateMapMarker", DELETE_MAP_MARKER = "DeleteMapMarker", EDIT_MAP_MARKER = "EditMapMarker", - OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer" + OPEN_RANDOM_LOOT_CONTAINER = "OpenRandomLootContainer", + HIDEOUT_QTE_EVENT = "HideoutQuickTimeEvent" } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts index 16f7e39..ff8c5f4 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts @@ -4,5 +4,6 @@ export declare enum QuestRewardType { TRADER_STANDING = "TraderStanding", TRADER_UNLOCK = "TraderUnlock", ITEM = "Item", - ASSORTMENT_UNLOCK = "AssortmentUnlock" + ASSORTMENT_UNLOCK = "AssortmentUnlock", + PRODUCTIONS_SCHEME = "ProductionScheme" } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts index ba65933..e706c05 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts @@ -7,5 +7,6 @@ export declare enum QuestStatus { Fail = 5, FailRestartable = 6, MarkedAsFailed = 7, - Expired = 8 + Expired = 8, + AvailableAfter = 9 } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts index 163cd71..ffea725 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts @@ -6,5 +6,6 @@ export declare enum Traders { PEACEKEEPER = "5935c25fb3acc3127c3d8cd9", MECHANIC = "5a7c2eca46aef81a7ca2145d", RAGMAN = "5ac3b934156ae10c4430e83c", - JAEGER = "5c0647fdd443bc2504c2d371" + JAEGER = "5c0647fdd443bc2504c2d371", + LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57" } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/bots/GenerateWeaponResult.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/bots/GenerateWeaponResult.d.ts index f099752..56fa481 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/bots/GenerateWeaponResult.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -3,7 +3,8 @@ import { Item } from "../../eft/common/tables/IItem"; import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"; export declare class GenerateWeaponResult { weapon: Item[]; - chosenAmmo: string; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; weaponMods: Mods; weaponTemplate: ITemplateItem; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IMatchCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IMatchCallbacks.d.ts deleted file mode 100644 index fcbf173..0000000 --- a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/IMatchCallbacks.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IStartOfflineRaidRequestData } from "../../eft/match/IStartOffineRaidRequestData"; -import { IEndOfflineRaidRequestData } from "../../eft/match/IEndOfflineRaidRequestData"; -import { INullResponseData } from "../../eft/httpResponse/INullResponseData"; -import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; -import { IPmcData } from "../../eft/common/IPmcData"; -export interface IMatchCallbacks { - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; - exitToMenu(url: string, info: any, sessionID: string): INullResponseData; - startGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - stopGroupSearch(url: string, info: any, sessionID: string): INullResponseData; - sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; - getProfile(url: string, info: any, sessionID: string): IGetBodyResponseData; - serverAvailable(url: string, info: any, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; - joinMatch(url: string, info: any, sessionID: string): IGetBodyResponseData; - getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; - getGroupStatus(url: string, info: any, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; - deleteGroup(url: string, info: any, sessionID: string): INullResponseData; - startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; - endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; -} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts index 53df991..627b603 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IAirdropConfig.d.ts @@ -6,6 +6,8 @@ export interface IAirdropConfig extends IBaseConfig { planeMinFlyHeight: number; planeMaxFlyHeight: number; planeVolume: number; + planeSpeed: number; + crateFallSpeed: number; airdropMinStartTimeSeconds: number; airdropMaxStartTimeSeconds: number; loot: AirdropLoot; @@ -17,6 +19,7 @@ export interface AirdropChancePercent { shoreline: number; interchange: number; reserve: number; + tarkovStreets: number; } export interface AirdropLoot { presetCount: MinMax; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index 4b1a621..895a30e 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -84,6 +84,7 @@ export interface ModLimits { } export interface RandomisationDetails { levelRange: MinMax; + generation?: Record; randomisedWeaponModSlots?: string[]; randomisedArmorSlots?: string[]; /** Equipment chances */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotDurability.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotDurability.d.ts index 38a47cc..a4ff53c 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotDurability.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotDurability.d.ts @@ -14,19 +14,9 @@ export interface IBotDurability { } /** Durability values to be used when a more specific bot type cant be found */ export interface DefaultDurability { - armor: DefaultArmor; + armor: ArmorDurability; weapon: WeaponDurability; } -export interface DefaultArmor { - maxDelta: number; - minDelta: number; -} -export interface WeaponDurability { - lowestMax: number; - highestMax: number; - maxDelta: number; - minDelta: number; -} export interface PmcDurability { armor: PmcDurabilityArmor; weapon: WeaponDurability; @@ -44,4 +34,12 @@ export interface BotDurability { export interface ArmorDurability { maxDelta: number; minDelta: number; + minLimitPercent: number; +} +export interface WeaponDurability { + lowestMax: number; + highestMax: number; + maxDelta: number; + minDelta: number; + minLimitPercent: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts index f232052..5e878ff 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts @@ -8,4 +8,5 @@ export interface IHideoutConfig extends IBaseConfig { airFilterUnitFlowRate: number; /** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */ gpuBoostRate: number; + hideoutWallAppearTimeSeconds: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts index a012fae..f808ad8 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts @@ -2,11 +2,16 @@ import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBas import { IBaseConfig } from "./IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "aki-location"; + fixEmptyBotWaves: boolean; + fixRoguesTakingAllSpawnsOnLighthouse: boolean; + lighthouseRogueSpawnTimeSeconds: number; looseLootMultiplier: LootMultiplier; staticLootMultiplier: LootMultiplier; customWaves: CustomWaves; /** Open zones to add to map */ openZones: Record; + /** Key = map id, value = item tpls that should only have one forced loot spawn position */ + forcedLootSingleSpawnById: Record; } export interface CustomWaves { boss: Record; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts index 23e6838..3850bed 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRepairConfig.d.ts @@ -1,7 +1,27 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface IRepairConfig extends IBaseConfig { kind: "aki-repair"; priceMultiplier: number; applyRandomizeDurabilityLoss: boolean; weaponSkillRepairGain: number; + armorKitSkillPointGainPerRepairPointMultiplier: number; + repairKit: RepairKit; +} +export interface RepairKit { + armorChancePercent: number; + weaponChancePercent: number; + armor: BonusSettings; + weapon: BonusSettings; +} +export interface BonusSettings { + rarityWeight: Record; + bonusTypeWeight: Record; + common: Record; + rare: Record; +} +export interface BonusValues { + valuesMinMax: MinMax; + /** What dura is buff active between (min max of current max) */ + activeDurabilityPercentMinMax: MinMax; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ISeasonalEventConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ISeasonalEventConfig.d.ts index e410925..cedf9a9 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -5,6 +5,7 @@ export interface ISeasonalEventConfig extends IBaseConfig { /** event / botType / equipSlot / itemid */ eventGear: Record>>>; events: ISeasonalEvent[]; + gifterSettings: GifterSetting[]; } export interface ISeasonalEvent { name: string; @@ -13,3 +14,8 @@ export interface ISeasonalEvent { endDay: number; endMonth: number; } +export interface GifterSetting { + map: string; + zones: string; + spawnChance: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index b1ec484..56c7d35 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -15,15 +15,21 @@ export interface UpdateTime { seconds: number; } export interface FenceConfig { + discountOptions: DiscountOptions; partialRefreshTimeSeconds: number; partialRefreshChangePercent: number; assortSize: number; maxPresetsPercent: number; + itemPriceMult: number; presetPriceMult: number; armorMaxDurabilityPercentMinMax: MinMax; presetMaxDurabilityPercentMinMax: MinMax; - itemPriceMult: number; - regenerateAssortsOnRefresh: boolean; itemTypeLimits: Record; + regenerateAssortsOnRefresh: boolean; blacklist: string[]; } +export interface DiscountOptions { + assortSize: number; + itemPriceMult: number; + presetPriceMult: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts index 9978459..ad8f729 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/server/IDatabaseTables.d.ts @@ -1,3 +1,4 @@ +import { IQteData } from "../../../models/eft/hideout/IQteData"; import { IGlobals } from "../../eft/common/IGlobals"; import { IBotBase } from "../../eft/common/tables/IBotBase"; import { IBotCore } from "../../eft/common/tables/IBotCore"; @@ -30,6 +31,7 @@ export interface IDatabaseTables { production: IHideoutProduction[]; scavcase: IHideoutScavCase[]; settings: IHideoutSettingsBase; + qte: IQteData[]; }; locales?: ILocaleBase; locations?: ILocations; @@ -38,7 +40,7 @@ export interface IDatabaseTables { templates?: { character: string[]; items: Record; - quests: IQuest[]; + quests: Record; repeatableQuests: IRepeatableQuestDatabase; /** DEPRECATED - Items file found in the client, massivly out of date compared to templates.items, try not to use this, remove ASAP*/ clientItems: Record; diff --git a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts index 7a2387b..aa7d902 100644 --- a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts @@ -1,11 +1,32 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IPmcData } from "../models/eft/common/IPmcData"; +import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { JsonUtil } from "../utils/JsonUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class EventOutputHolder { protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; - constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected timeUtil: TimeUtil; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper, timeUtil: TimeUtil); protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; + /** + * Reset the response object to a default state + * Occurs prior to event being handled by server + * @param sessionID Players id + */ resetOutput(sessionID: string): void; + /** + * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true + * @param pmcData Player profile + * @returns dictionary of hideout improvements + */ + protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; + /** + * Return all productions from player profile, adjust completed productions' inprogress property to be false + * @param pmcData Player profile + * @returns dictionary of hideout productions + */ + protected getProductionsFromProfileAndFlagComplete(pmcData: IPmcData): Record; } diff --git a/TypeScript/10ScopesAndTypes/types/routers/item_events/InventoryItemEventRouter.d.ts b/TypeScript/10ScopesAndTypes/types/routers/item_events/InventoryItemEventRouter.d.ts index 953d322..d6a6ae5 100644 --- a/TypeScript/10ScopesAndTypes/types/routers/item_events/InventoryItemEventRouter.d.ts +++ b/TypeScript/10ScopesAndTypes/types/routers/item_events/InventoryItemEventRouter.d.ts @@ -1,10 +1,12 @@ +import { HideoutCallbacks } from "../../callbacks/HideoutCallbacks"; import { InventoryCallbacks } from "../../callbacks/InventoryCallbacks"; import { HandledRoute, ItemEventRouterDefinition } from "../../di/Router"; import { IPmcData } from "../../models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "../../models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryItemEventRouter extends ItemEventRouterDefinition { protected inventoryCallbacks: InventoryCallbacks; - constructor(inventoryCallbacks: InventoryCallbacks); + protected hideoutCallbacks: HideoutCallbacks; + constructor(inventoryCallbacks: InventoryCallbacks, hideoutCallbacks: HideoutCallbacks); getHandledRoutes(): HandledRoute[]; handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts index 4dca514..402befc 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/SaveServer.d.ts @@ -14,17 +14,71 @@ export declare class SaveServer { protected logger: ILogger; protected profileFilepath: string; protected profiles: {}; - protected onSave: {}; + protected onBeforeSaveCallbacks: {}; protected saveMd5: {}; constructor(vfs: VFS, saveLoadRouters: SaveLoadRouter[], jsonUtil: JsonUtil, hashUtil: HashUtil, localisationService: LocalisationService, logger: ILogger); + /** + * Add callback to occur prior to saving profile changes + * @param id Id for save callback + * @param callback Callback to execute prior to running SaveServer.saveProfile() + */ + addBeforeSaveCallback(id: string, callback: (profile: Partial) => Partial): void; + /** + * Remove a callback from being executed prior to saving profile in SaveServer.saveProfile() + * @param id Id of callback to remove + */ + removeBeforeSaveCallback(id: string): void; + /** + * Load all profiles in /user/profiles folder into memory (this.profiles) + */ load(): void; + /** + * Save changes for each profile from memory into user/profiles json + */ save(): void; + /** + * Get a player profile from memory + * @param sessionId Session id + * @returns IAkiProfile + */ getProfile(sessionId: string): IAkiProfile; + /** + * Get all profiles from memory + * @returns Dictionary of IAkiProfile + */ getProfiles(): Record; + /** + * Delete a profile by id + * @param sessionID Id of profile to remove + * @returns true when deleted, false when profile not found + */ deleteProfileById(sessionID: string): boolean; + /** + * Create a new profile in memory with empty pmc/scav objects + * @param profileInfo Basic profile data + */ createProfile(profileInfo: Info): void; + /** + * Add full profile in memory by key (info.id) + * @param profileDetails Profile to save + */ addProfile(profileDetails: IAkiProfile): void; + /** + * Look up profile json in user/profiles by id and store in memory + * Execute saveLoadRouters callbacks after being loaded into memory + * @param sessionID Id of profile to store in memory + */ loadProfile(sessionID: string): void; + /** + * Save changes from in-memory profile to user/profiles json + * Execute onBeforeSaveCallbacks callbacks prior to being saved to json + * @param sessionID profile id (user/profiles/id.json) + */ saveProfile(sessionID: string): void; + /** + * Remove a physical profile json from user/profiles + * @param sessionID Profile id to remove + * @returns true if file no longer exists + */ removeProfile(sessionID: string): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/servers/http/AkiHttpListener.d.ts b/TypeScript/10ScopesAndTypes/types/servers/http/AkiHttpListener.d.ts index acf92aa..e4d7110 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/http/AkiHttpListener.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/http/AkiHttpListener.d.ts @@ -24,5 +24,6 @@ export declare class AkiHttpListener implements IHttpListener { sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; protected getBodyInfo(body: Buffer): string; + sendJson(resp: ServerResponse, output: any, sessionID: string): void; sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; } diff --git a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts index ef3b504..db41a8c 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts @@ -1,5 +1,6 @@ import { BotHelper } from "../helpers/BotHelper"; -import { EquipmentChances, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; +import { MinMax } from "../models/common/MinMax"; +import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -24,6 +25,12 @@ export declare class BotEquipmentFilterService { * @param baseValues Values to update */ protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void; + /** + * Iterate over the Generation changes and alter data in baseValues.Generation + * @param generationChanges Changes to apply + * @param baseBotGeneration dictionary to update + */ + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts index cb20500..4e3cab2 100644 --- a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; -import { FenceLevel } from "../models/eft/common/IGlobals"; +import { FenceLevel, Preset } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; @@ -34,10 +34,12 @@ export declare class FenceService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected fenceAssort: ITraderAssort; + protected fenceDiscountAssort: ITraderAssort; protected traderConfig: ITraderConfig; protected nextMiniRefreshTimestamp: number; constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer); - protected setFenceAssort(fenceAssort: ITraderAssort): void; + protected setFenceAssort(assort: ITraderAssort): void; + protected setFenceDiscountAssort(assort: ITraderAssort): void; /** * Get assorts player can purchase * Adjust prices based on fence level of player @@ -46,12 +48,27 @@ export declare class FenceService { */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; /** - * Adjust assorts price by a modifier - * @param item - * @param assort - * @param modifier + * Adjust all items contained inside an assort by a multiplier + * @param assort Assort that contains items with prices to adjust + * @param itemMultipler multipler to use on items + * @param presetMultiplier preset multipler to use on presets */ - protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; + protected adjustAssortItemPrices(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void; + /** + * Merge two trader assort files together + * @param firstAssort assort 1# + * @param secondAssort assort #2 + * @returns merged assort + */ + protected mergeAssorts(firstAssort: ITraderAssort, secondAssort: ITraderAssort): ITraderAssort; + /** + * Adjust assorts price by a modifier + * @param item assort item details + * @param assort assort to be modified + * @param modifier value to multiply item price by + * @param presetModifier value to multiply preset price by + */ + protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -80,7 +97,7 @@ export declare class FenceService { /** * Choose an item (not mod) at random and remove from assorts */ - protected removeRandomItemFromAssorts(): void; + protected removeRandomItemFromAssorts(assort: ITraderAssort): void; /** * Get an integer rounded count of items to replace based on percentrage from traderConfig value * @param totalItemCount total item count @@ -102,11 +119,23 @@ export declare class FenceService { */ protected createBaseTraderAssortItem(): ITraderAssort; /** - * Hydrate result parameter object with generated assorts + * Hydrate assorts parameter object with generated assorts * @param assortCount Number of assorts to generate - * @param assorts object to add assorts to + * @param assorts object to add created assorts to */ - protected createAssorts(assortCount: number, assorts: ITraderAssort): void; + protected createAssorts(assortCount: number, assorts: ITraderAssort, loyaltyLevel: number): void; + protected addItemAssorts(assortCount: number, fenceAssortIds: string[], assorts: ITraderAssort, fenceAssort: ITraderAssort, itemTypeCounts: Record, loyaltyLevel: number): void; + /** + * Add preset weapons to fence presets + * @param assortCount how many assorts to add to assorts + * @param defaultWeaponPresets + * @param assorts object to add presets to + * @param loyaltyLevel + */ + protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record, assorts: ITraderAssort, loyaltyLevel: number): void; /** * Randomise items' upd properties e.g. med packs/weapons/armor * @param itemDetails Item being randomised diff --git a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts index 26f1952..ac131ea 100644 --- a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts @@ -25,12 +25,12 @@ export declare class PaymentService { constructor(logger: ILogger, 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 - * @param {Object} pmcData - * @param {Object} body + * @param {IPmcData} pmcData Player profile + * @param {IProcessBuyTradeRequestData} request * @param {string} sessionID * @returns Object */ - payMoney(pmcData: IPmcData, body: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; + payMoney(pmcData: IPmcData, request: IProcessBuyTradeRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Receive money back after selling * @param {IPmcData} pmcData @@ -62,7 +62,15 @@ export declare class PaymentService { * Post-raid healing would often take money out of the players pockets/secure container * @param a First money stack item * @param b Second money stack item + * @param inventoryItems players inventory items * @returns sort order */ - protected prioritiseStashSort(a: Item, b: Item): number; + protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number; + /** + * Recursivly check items parents to see if it is inside the players inventory, not stash + * @param itemId item id to check + * @param inventoryItems player inventory + * @returns true if its in inventory + */ + protected isInInventory(itemId: string, inventoryItems: Item[]): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts index 86a6af8..2ed5a16 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts @@ -7,6 +7,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { HideoutAreas } from "../models/enums/HideoutAreas"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { TimeUtil } from "../utils/TimeUtil"; import { Watermark } from "../utils/Watermark"; import { LocalisationService } from "./LocalisationService"; export declare class ProfileFixerService { @@ -14,8 +15,9 @@ export declare class ProfileFixerService { protected watermark: Watermark; protected hideoutHelper: HideoutHelper; protected localisationService: LocalisationService; + protected timeUtil: TimeUtil; protected databaseServer: DatabaseServer; - constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, databaseServer: DatabaseServer); + constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -32,6 +34,8 @@ export declare class ProfileFixerService { * @param pmcProfile profile to remove old counters from */ removeDanglingConditionCounters(pmcProfile: IPmcData): void; + addLighthouseKeeperIfMissing(pmcProfile: IPmcData): void; + protected addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void; protected removeDanglingBackendCounters(pmcProfile: IPmcData): void; protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; @@ -45,6 +49,11 @@ export declare class ProfileFixerService { protected updateProfileQuestDataValues(pmcProfile: IPmcData): void; protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void; + /** + * Some profiles have hideout maxed and therefore no improvements + * @param pmcProfile Profile to add improvement data to + */ + protected addMissingWallImprovements(pmcProfile: IPmcData): void; /** * A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed * @param pmcProfile Profile to find and remove slots from @@ -85,4 +94,14 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(pmcProfile: IPmcData): void; + /** + * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 + * @param pmcProfile profile to update + */ + addMissingUpgradesPropertyToHideout(pmcProfile: IPmcData): void; + /** + * Iterate over associated profile template and check all hideout areas exist, add if not + * @param fullProfile Profile to update + */ + addMissingHideoutAreasToProfile(fullProfile: IAkiProfile): void; } diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts index cf0459c..50d349d 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts @@ -65,6 +65,7 @@ export declare class RagfairPriceService implements OnLoad { * @returns Dictionary of item tpls and rouble cost */ getAllFleaPrices(): Record; + getAllStaticPrices(): Record; /** * Get the percentage difference between two values * @param a numerical value a diff --git a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts index d3f1b35..81253a2 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts @@ -1,27 +1,33 @@ +import { ItemHelper } from "../helpers/ItemHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { RepairHelper } from "../helpers/RepairHelper"; import { TraderHelper } from "../helpers/TraderHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; -import { IRepairConfig } from "../models/spt/config/IRepairConfig"; +import { BonusSettings, IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; + protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected paymentService: PaymentService; protected repairHelper: RepairHelper; protected configServer: ConfigServer; repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -65,9 +71,22 @@ export declare class RepairService { * @param repairKitInInventory Repair kit to update */ protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: Item): void; + /** + * Chance to apply buff to an item (Armor/weapon) if repaired by armor kit + * @param repairDetails repair details of item + */ + addBuffToItem(repairDetails: RepairDetails): void; + /** + * Add buff to item + * @param itemConfig weapon/armor config + * @param repairDetails Details for item to repair + */ + protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; } export declare class RepairDetails { repairCost?: number; repairedItem: Item; repairedItemIsArmor: boolean; + repairAmount: number; + repairedByKit: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts b/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts index ac765ff..d280332 100644 --- a/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts @@ -59,6 +59,10 @@ export declare class SeasonalEventService { * @param eventName Name of the event to enable. e.g. Christmas */ protected updateGlobalEvents(globalConfig: Config, eventName: string): void; + /** + * Add lootble items from backpack into patrol.ITEMS_TO_DROP difficulty property + */ + protected addLootItemsToGifterDropItemsList(): void; /** * Read in data from seasonalEvents.json and add found equipment items to bots * @param eventName Name of the event to read equipment in from config @@ -69,4 +73,8 @@ export declare class SeasonalEventService { * Set Khorovod(dancing tree) chance to 100% on all maps that support it */ protected enableDancingTree(): void; + /** + * Add santa to maps + */ + protected addGifterBotToMaps(): void; } diff --git a/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts index aa556e3..fc0b05d 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/RandomUtil.d.ts @@ -110,6 +110,7 @@ export declare class RandomUtil { getIntEx(max: number): number; getFloat(min: number, max: number): number; getBool(): boolean; + getPercentOfValue(percent: number, number: number, toFixed?: number): number; /** * Check if number passes a check out of 100 * @param chancePercent value check needs to be above diff --git a/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts b/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts index e5eaf02..0dee5bd 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/VFS.d.ts @@ -32,7 +32,7 @@ export declare class VFS { createDirAsync(filepath: string): Promise; copyDir(filepath: string, target: string, fileExtensions?: string | string[]): void; copyDirAsync(filepath: string, target: string, fileExtensions: string | string[]): Promise; - readFile(filepath: string): any; + readFile(...args: Parameters): any; readFileAsync(filepath: string): Promise; writeFile(filepath: any, data?: string, append?: boolean, atomic?: boolean): void; writeFileAsync(filepath: any, data?: string, append?: boolean, atomic?: boolean): Promise; diff --git a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts index a80aaed..1d7eb9d 100644 --- a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts @@ -3,7 +3,6 @@ import { BotGenerator } from "../generators/BotGenerator"; import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper"; import { BotHelper } from "../helpers/BotHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; -import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotCore } from "../models/eft/common/tables/IBotCore"; @@ -23,14 +22,13 @@ export declare class BotController { protected botDifficultyHelper: BotDifficultyHelper; protected botGenerationCacheService: BotGenerationCacheService; protected localisationService: LocalisationService; - protected weightedRandomHelper: WeightedRandomHelper; protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected applicationContext: ApplicationContext; protected jsonUtil: JsonUtil; protected botConfig: IBotConfig; static readonly pmcTypeLabel = "PMC"; - constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil); /** * Return the number of bot loadout varieties to be generated * @param type bot Type we want the loadout gen count for diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index a153072..0fb7f16 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -11,10 +11,13 @@ import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig"; +import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { LocalisationService } from "../services/LocalisationService"; +import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileFixerService } from "../services/ProfileFixerService"; import { SeasonalEventService } from "../services/SeasonalEventService"; import { TimeUtil } from "../utils/TimeUtil"; @@ -28,13 +31,29 @@ export declare class GameController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; + protected customLocationWaveService: CustomLocationWaveService; + protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + /** + * When player logs in, iterate over all active effects and reduce timer + * @param pmcProfile + */ + protected updateProfileHealthValues(pmcProfile: IPmcData): void; + /** + * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max + */ + protected fixBrokenOfflineMapWaves(): void; + /** + * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions + */ + protected fixRoguesSpawningInstantlyOnLighthouse(): void; /** * Get a list of installed mods and save their details to the profile being used * @param fullProfile Profile to add mod details to diff --git a/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts b/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts index 5e6d8ff..7c149cc 100644 --- a/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts @@ -2,25 +2,27 @@ import { HealthHelper } from "../helpers/HealthHelper"; import { InventoryHelper } from "../helpers/InventoryHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; +import { IWorkoutData } from "../models/eft/health/IWorkoutData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { LocalisationService } from "../services/LocalisationService"; import { PaymentService } from "../services/PaymentService"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class HealthController { protected logger: ILogger; + protected jsonUtil: JsonUtil; protected eventOutputHolder: EventOutputHolder; protected itemHelper: ItemHelper; protected paymentService: PaymentService; protected inventoryHelper: InventoryHelper; protected localisationService: LocalisationService; protected healthHelper: HealthHelper; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper); + constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper); /** * stores in-raid player health * @param pmcData Player profile @@ -37,6 +39,13 @@ export declare class HealthController { * @returns */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Consume food/water outside of a raid + * @param pmcData Player profile + * @param body request Object + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; /** * Occurs on post-raid healing page @@ -54,10 +63,11 @@ export declare class HealthController { */ applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; /** - * iterate over treatment request diff and find effects to remove from player limbs + * Iterate over treatment request diff and find effects to remove from player limbs * @param sessionId * @param profile Profile to update * @param treatmentRequest client request + * @param output response to send to client */ - protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData): void; + protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void; } diff --git a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts index aeb5469..2a05a2c 100644 --- a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts @@ -27,6 +27,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; +import { FenceService } from "../services/FenceService"; import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { HashUtil } from "../utils/HashUtil"; @@ -53,9 +54,10 @@ export declare class HideoutController { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; + protected fenceService: FenceService; protected static nameBackendCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); /** * Start a hideout area upgrade * @param pmcData Player profile @@ -122,6 +124,14 @@ export declare class HideoutController { * @returns item event router response */ scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Adjust scav case time based on fence standing + * + * @param pmcData Player profile + * @param productionTime Time to complete scav case in seconds + * @returns Adjusted scav case time in seconds + */ + protected getScavCaseTime(pmcData: IPmcData, productionTime: number): number; /** * Add generated scav case rewards to player profile * @param pmcData player profile to add rewards to @@ -159,11 +169,11 @@ export declare class HideoutController { * Handles giving rewards stored in player profile to player after clicking 'get rewards' * @param sessionID Session id * @param pmcData Player profile - * @param body Remove production from scavcase area request + * @param request Get rewards from scavcase craft request * @param output Output object to update * @returns IItemEventRouterResponse */ - protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; + protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Start area production for item * @param pmcData Player profile diff --git a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts index e732dfd..cb0c755 100644 --- a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts @@ -17,9 +17,7 @@ import { ConfigServer } from "../servers/ConfigServer"; import { SaveServer } from "../servers/SaveServer"; import { BotGenerationCacheService } from "../services/BotGenerationCacheService"; import { BotLootCacheService } from "../services/BotLootCacheService"; -import { CustomLocationWaveService } from "../services/CustomLocationWaveService"; import { MatchLocationService } from "../services/MatchLocationService"; -import { OpenZoneService } from "../services/OpenZoneService"; import { ProfileSnapshotService } from "../services/ProfileSnapshotService"; export declare class MatchController { protected logger: ILogger; @@ -30,14 +28,12 @@ export declare class MatchController { protected botLootCacheService: BotLootCacheService; protected configServer: ConfigServer; protected profileSnapshotService: ProfileSnapshotService; - protected customLocationWaveService: CustomLocationWaveService; - protected openZoneService: OpenZoneService; protected botGenerationCacheService: BotGenerationCacheService; protected applicationContext: ApplicationContext; protected matchConfig: IMatchConfig; protected inraidConfig: IInRaidConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); + constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; createGroup(sessionID: string, info: ICreateGroupRequestData): any; diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index 2e443b9..285be3e 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -236,7 +236,7 @@ export declare class RepeatableQuestController { generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward; debugLogRepeatableQuestIds(pmcData: IPmcData): void; probabilityObjectArray(configArrayInput: ProbabilityObject[]): ProbabilityObjectArray; - changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; + changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; /** * 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 diff --git a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts index 5b937ca..6703a36 100644 --- a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts @@ -145,7 +145,7 @@ export declare class BotEquipmentModGenerator { * @param modToAdd template of mod to check * @param itemSlot slot the item will be placed in * @param modSlot slot the mod will fill - * @param parentTemplate tempalte of the mods parent item + * @param parentTemplate template of the mods parent item * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean; diff --git a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts index 71a2c5e..a68b82f 100644 --- a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts @@ -102,6 +102,13 @@ export declare class BotWeaponGenerator { * @param botRole The bot type we're getting generating extra mags for */ addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void; + /** + * Add Grendaes for UBGL to bots vest and secure container + * @param weaponMods Weapon array with mods + * @param generatedWeaponResult result of weapon generation + * @param inventory bot inventory to add grenades to + */ + protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add @@ -138,6 +145,13 @@ export declare class BotWeaponGenerator { * @param ammoTpl */ protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void; + /** + * Add desired ammo tpl as item to weaponmods array, placed as child to UBGL + * @param weaponMods + * @param ubglMod + * @param ubglAmmoTpl + */ + protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void; /** * Add cartridge item to weapon Item array, if it already exists, update * @param weaponMods Weapon items array to amend diff --git a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts index b9f2a83..10918e3 100644 --- a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts @@ -3,6 +3,7 @@ import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; import { ItemFilterService } from "../services/ItemFilterService"; +import { SeasonalEventService } from "../services/SeasonalEventService"; /** * Handle the generation of dynamic PMC loot in pockets and backpacks * and the removal of blacklisted items @@ -12,10 +13,19 @@ export declare class PMCLootGenerator { protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemFilterService: ItemFilterService; + protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService); + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); + /** + * Create an array of loot items a PMC can have in their pockets + * @returns string array of tpls + */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their backpack + * @returns string array of tpls + */ generatePMCBackpackLootPool(): string[]; } diff --git a/TypeScript/1LogToConsole/types/generators/RagfairAssortGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RagfairAssortGenerator.d.ts index db4811d..630e863 100644 --- a/TypeScript/1LogToConsole/types/generators/RagfairAssortGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RagfairAssortGenerator.d.ts @@ -4,6 +4,7 @@ import { Item } from "../models/eft/common/tables/IItem"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; export declare class RagfairAssortGenerator { @@ -11,10 +12,11 @@ export declare class RagfairAssortGenerator { protected hashUtil: HashUtil; protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; + protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected generatedAssortItems: Item[]; protected ragfairConfig: IRagfairConfig; - constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); + constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Get an array of unique items that can be sold on the flea * @returns array of unique items diff --git a/TypeScript/1LogToConsole/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts b/TypeScript/1LogToConsole/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts new file mode 100644 index 0000000..75395be --- /dev/null +++ b/TypeScript/1LogToConsole/types/generators/weapongen/implementations/UbglExternalMagGen.d.ts @@ -0,0 +1,10 @@ +import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper"; +import { IInventoryMagGen } from "../IInventoryMagGen"; +import { InventoryMagGen } from "../InventoryMagGen"; +export declare class UbglExternalMagGen implements IInventoryMagGen { + protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper; + constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper); + getPriority(): number; + canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean; + process(inventoryMagGen: InventoryMagGen): void; +} diff --git a/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts index de8b5bf..13512b2 100644 --- a/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts @@ -17,15 +17,16 @@ export declare class AssortHelper { * @param pmcProfile player profile * @param traderId traders id * @param assort assort items from a trader + * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile * @param traderId traders id * @param assort traders assorts - * @returns traders assorts minus locked loyality assorts + * @returns traders assorts minus locked loyalty assorts */ stripLockedLoyaltyAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort; /** diff --git a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts index a58ebdb..df2c269 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts @@ -20,7 +20,7 @@ export declare class BotDifficultyHelper { getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; /** * Get difficulty settings for desired bot type, if not found use assault bot types - * @param type bot type to retreive difficulty of + * @param type bot type to retrieve difficulty of * @param difficulty difficulty to get settings for (easy/normal etc) * @returns Difficulty object */ diff --git a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts index d9ce968..c7dd606 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts @@ -23,7 +23,7 @@ export declare class BotGeneratorHelper { * Adds properties to an item * e.g. Repairable / HasHinge / Foldable / MaxDurability * @param itemTemplate Item extra properties are being generated for - * @param botRole Used by weapons to randomise the durability values. Null for non-equipped items + * @param botRole Used by weapons to randomize the durability values. Null for non-equipped items * @returns Item Upd object with extra properties */ generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): { @@ -53,10 +53,10 @@ export declare class BotGeneratorHelper { protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; /** * Can item be added to another item without conflict - * @param items Items to check compatiblilities with + * @param items Items to check compatibilities with * @param tplToCheck Tpl of the item to check for incompatibilities * @param equipmentSlot Slot the item will be placed into - * @returns false if no incompatibilties, also has incompatibility reason + * @returns false if no incompatibilities, also has incompatibility reason */ isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): { incompatible: boolean; diff --git a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts index 9a43b8e..3b49501 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts @@ -23,11 +23,11 @@ export declare class BotHelper { */ getBotTemplate(role: string): IBotType; /** - * Randomise the chance the PMC will attack their own side + * Randomize the chance the PMC will attack their own side * Look up value in bot.json/chanceSameSideIsHostilePercent * @param difficultySettings pmc difficulty settings */ - randomisePmcHostility(difficultySettings: Difficulty): void; + randomizePmcHostility(difficultySettings: Difficulty): void; /** * Is the passed in bot role a PMC (usec/bear/pmc) * @param botRole bot role to check @@ -63,26 +63,26 @@ export declare class BotHelper { rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean; botRoleIsPmc(botRole: string): boolean; /** - * Get randomisation settings for bot from config/bot.json + * Get randomization settings for bot from config/bot.json * @param botLevel level of bot * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomisationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails; /** * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec * @returns pmc role */ - getRandomisedPmcRole(): string; + getRandomizedPmcRole(): string; /** - * Get the corrisponding side when sptBear or sptUsec is passed in + * Get the corresponding side when sptBear or sptUsec is passed in * @param botRole role to get side for * @returns side (usec/bear) */ getPmcSideByRole(botRole: string): string; /** - * Get a randomised PMC side based on bot config value 'isUsec' + * Get a randomized PMC side based on bot config value 'isUsec' * @returns pmc side as string */ - protected getRandomisedPmcSide(): string; + protected getRandomizedPmcSide(): string; } diff --git a/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts index b087fa9..717d124 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -2,6 +2,7 @@ import { MinMax } from "../models/common/MinMax"; import { Inventory } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; +import { EquipmentSlots } from "../models/enums/EquipmentSlots"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -21,18 +22,18 @@ export declare class BotWeaponGeneratorHelper { protected containerHelper: ContainerHelper; constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper); /** - * Get a randomised number of bullets for a specific magazine + * Get a randomized number of bullets for a specific magazine * @param magCounts min and max count of magazines * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number; /** - * Get a randomised count of magazines + * Get a randomized count of magazines * @param magCounts min and max value returned value can be between - * @returns numberical value of magazine count + * @returns numerical value of magazine count */ - getRandomisedMagazineCount(magCounts: MinMax): number; + getRandomizedMagazineCount(magCounts: MinMax): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -48,12 +49,13 @@ export declare class BotWeaponGeneratorHelper { */ createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; /** - * Add a specific number of cartrdiges to a bots inventory (vest/pocket) + * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets * @param cartridgeCount number of cartridges to add to vest/pockets * @param inventory bot inventory to add cartridges to + * @param equipmentSlotsToAddTo what equipment slots should bullets be added into */ - addBulletsToVestAndPockets(ammoTpl: string, cartridgeCount: number, inventory: Inventory): void; + addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for @@ -61,7 +63,7 @@ export declare class BotWeaponGeneratorHelper { */ getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string; /** - * Adds an item with all its childern into specified equipmentSlots, wherever it fits. + * Adds an item with all its children into specified equipmentSlots, wherever it fits. * @param equipmentSlots * @param parentId * @param parentTpl diff --git a/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts index 61c3478..7122376 100644 --- a/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/DurabilityLimitsHelper.d.ts @@ -9,10 +9,10 @@ export declare class DurabilityLimitsHelper { protected configServer: ConfigServer; protected botConfig: IBotConfig; constructor(randomUtil: RandomUtil, botHelper: BotHelper, configServer: ConfigServer); - getRandomisedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; - getRandomisedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; - getRandomisedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedMaxWeaponDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedMaxArmorDurability(itemTemplate: ITemplateItem, botRole: string): number; + getRandomizedWeaponDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; + getRandomizedArmorDurability(itemTemplate: ITemplateItem, botRole: string, maxDurability: number): number; protected generateMaxWeaponDurability(botRole: string): number; protected generateMaxPmcArmorDurability(itemMaxDurability: number): number; protected getLowestMaxWeaponFromConfig(botRole: string): number; diff --git a/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts index d9b6434..7560f2a 100644 --- a/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts @@ -1,7 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Effect } from "../models/eft/health/Effect"; import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData"; -import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; +import { Effects, IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IHealthConfig } from "../models/spt/config/IHealthConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -25,22 +24,27 @@ export declare class HealthHelper { /** * Update player profile with changes from request object * @param pmcData Player profile - * @param info Request object + * @param request Heal request * @param sessionID Session id * @param addEffects Should effects be added or removed (default - add) */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; + saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; + /** + * Adjust hydration/energy/temprate and body part hp values in player profile + * @param pmcData Profile to update + * @param sessionId Session id + */ protected saveHealth(pmcData: IPmcData, sessionID: string): void; /** * Save effects to profile * Works by removing all effects and adding them back from profile * Removes empty 'Effects' objects if found * @param pmcData Player profile - * @param sessionID Session id + * @param sessionId Session id + * @param bodyPartsWithEffects dict of body parts with effects that should be added to profile * @param addEffects Should effects be added back to profile - * @returns */ - protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean, deleteExistingEffects?: boolean): void; + protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void; /** * Add effect to body part in profile * @param pmcData Player profile @@ -48,6 +52,6 @@ export declare class HealthHelper { * @param effectType Effect to add to body part * @param duration How long the effect has left in seconds (-1 by default, no duration). */ - protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: Effect, duration?: number): void; + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string, duration?: number): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 7e86f92..3ef27c1 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { Common, HideoutArea, Production, Productive } from "../models/eft/common/tables/IBotBase"; +import { Common, HideoutArea, IHideoutImprovement, Production, Productive } from "../models/eft/common/tables/IBotBase"; import { Upd } from "../models/eft/common/tables/IItem"; import { StageBonus } from "../models/eft/hideout/IHideoutArea"; import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData"; +import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -82,6 +83,33 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; + /** + * Update a productions progress value based on the amount of time that has passed + * @param pmcData Player profile + * @param prodId Production id being crafted + * @param recipe Recipe data being crafted + * @param hideoutProperties + */ + protected updateProductionProgress(pmcData: IPmcData, prodId: string, recipe: IHideoutProduction, hideoutProperties: { + btcFarmCGs?: number; + isGeneratorOn: any; + waterCollectorHasFilter?: boolean; + }): void; + /** + * Set productions sptProductionComplete to true if progress value matches craft time + * @param pmcData Player profile + * @param prodId Production id + * @param recipe Recipe being crafted + */ + protected flagCompleteProductionAsReadyToInformClient(pmcData: IPmcData, prodId: string): void; + /** + * Check if a productions progress value matches its corrisponding recipes production time value + * @param pmcData Player profile + * @param prodId Production id + * @param recipe Recipe being crafted + * @returns progress matches productionTime from recipe + */ + protected doesProgressMatchProductionTime(pmcData: IPmcData, prodId: string): boolean; /** * Update progress timer for scav case * @param pmcData Profile to update @@ -139,6 +167,12 @@ export declare class HideoutHelper { * @param pmcProfile Profile to upgrade wall in */ unlockHideoutWallInProfile(pmcProfile: IPmcData): void; + /** + * Hideout improvement is flagged as complete + * @param improvement hideout improvement object + * @returns true if complete + */ + protected hideoutImprovementIsComplete(improvement: IHideoutImprovement): boolean; /** * Iterate over hideout improvements not completed and check if they need to be adjusted * @param pmcProfile Profile to adjust diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index dacc7be..6a53f9f 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -1,8 +1,9 @@ import { IPmcData } from "../models/eft/common/IPmcData"; +import { Quest } from "../models/eft/common/tables/IBotBase"; import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData"; -import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData"; +import { IFailQuestRequestData } from "../models/eft/quests/IFailQuestRequestData"; import { QuestStatus } from "../models/enums/QuestStatus"; import { IQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; @@ -54,7 +55,7 @@ export declare class QuestHelper { doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean; /** * Get the quests found in both arrays (inner join) - * @param before Array of qeusts #1 + * @param before Array of quests #1 * @param after Array of quests #2 * @returns Reduction of cartesian product between two quest arrays */ @@ -63,11 +64,10 @@ export declare class QuestHelper { * Increase skill points of a skill on player profile * @param sessionID Session id * @param pmcData Player profile - * @param output output object to send back to client * @param skillName Name of skill to increase skill points of * @param progressAmount Amount of skill points to add to skill */ - rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void; + rewardSkillPoints(sessionID: string, pmcData: IPmcData, skillName: string, progressAmount: number): void; /** * Get quest name by quest id * @param questId id to get @@ -90,12 +90,12 @@ export declare class QuestHelper { */ getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[]; /** - * Update player profile with quest status (e.g. Fail/Success) - * @param pmcData profile to add quest to - * @param newState state the new quest should be in when added - * @param acceptedQuest Details of quest being added + * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile + * @param pmcData Player profile + * @param newState State the new quest should be in when returned + * @param acceptedQuest Details of accepted quest from client */ - addQuestToPMCData(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): void; + getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest; /** * TODO: what is going on here * @param acceptedQuestId Quest to add to profile @@ -147,16 +147,16 @@ export declare class QuestHelper { getQuestWithOnlyLevelRequirementStartCondition(quest: IQuest): IQuest; /** * Fail a quest in a player profile - * @param pmcData Profile - * @param failRequest fail quest request data + * @param pmcData Player profile + * @param failRequest Fail quest request data * @param sessionID Session id * @returns Item event router response */ - failQuest(pmcData: IPmcData, failRequest: any, sessionID: string): IItemEventRouterResponse; + failQuest(pmcData: IPmcData, failRequest: IFailQuestRequestData, sessionID: string): IItemEventRouterResponse; /** - * Get quest by id from database - * @param questId questid to look for - * @param pmcData player profile + * Get quest by id from database (repeatables are stored in profile, check there if questId not found) + * @param questId Id of quest to find + * @param pmcData Player profile * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; @@ -167,25 +167,36 @@ export declare class QuestHelper { */ getQuestLocaleIdFromDb(questMessageId: string): string; /** - * Alter a quests state + Add a record to tis status timers object + * Alter a quests state + Add a record to its status timers object * @param pmcData Profile to update - * @param newQuestState new state the qeust should be in - * @param questId id of the quest to alter the status of + * @param newQuestState New state the qeust should be in + * @param questId Id of the quest to alter the status of */ updateQuestState(pmcData: IPmcData, newQuestState: QuestStatus, questId: string): void; /** - * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks - Returns reward items player earned * @param pmcData Player profile - * @param body complete quest request - * @param state State of the quest now its complete - * @param sessionID Seession id - * @returns array of reward objects + * @param questId questId of quest to get rewards for + * @param state State of the quest to get rewards for + * @param sessionId Session id + * @param questResponse Response to send back to client + * @returns Array of reward objects */ - applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: QuestStatus, sessionID: string): Reward[]; + applyQuestReward(pmcData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): Reward[]; /** - * Get the intel center bonus a player has + * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile + * also update client response recipeUnlocked array with craft id + * @param pmcData Player profile + * @param craftUnlockReward Reward item from quest with craft unlock details + * @param questDetails Quest with craft unlock reward + * @param sessionID Session id + * @param response Response to send back to client + */ + protected findAndAddHideoutProductionIdToProfile(pmcData: IPmcData, craftUnlockReward: Reward, questDetails: IQuest, sessionID: string, response: IItemEventRouterResponse): void; + /** + * Get players intel center bonus from profile * @param pmcData player profile - * @returns bonus in percent + * @returns bonus as a percent */ protected getIntelCenterRewardBonus(pmcData: IPmcData): number; /** @@ -195,7 +206,7 @@ export declare class QuestHelper { */ getFindItemIdForQuestHandIn(itemTpl: string): string; /** - * Add All quests to a profile with the provided statuses + * Add all quests to a profile with the provided statuses * @param pmcProfile profile to update * @param statuses statuses quests should have */ diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts index 60809b5..bf7aeb6 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts @@ -30,7 +30,7 @@ export declare class RagfairSellHelper { * Determine if the offer being listed will be sold * @param sellChancePercent chance item will sell * @param itemSellCount count of items to sell - * @returns Array of purchases of item(s) lsited + * @returns Array of purchases of item(s) listed */ rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[]; } diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairSortHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairSortHelper.d.ts index 4669ce6..6a06528 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairSortHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairSortHelper.d.ts @@ -7,7 +7,7 @@ export declare class RagfairSortHelper { protected localeService: LocaleService; constructor(databaseServer: DatabaseServer, localeService: LocaleService); /** - * Sort a list of ragfair offers by something (id/rating/offer name/price/expirty time) + * Sort a list of ragfair offers by something (id/rating/offer name/price/expiry time) * @param offers Offers to sort * @param type How to sort it * @param direction Ascending/descending diff --git a/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts index 9983d4d..0a184e2 100644 --- a/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts @@ -24,7 +24,7 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; isWeaponTemplate(tpl: string): boolean; } diff --git a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts index 0c7aa7b..6811dd1 100644 --- a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts @@ -45,7 +45,7 @@ export declare class TradeHelper { sellItem(pmcData: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment the assorts buy count by number of items purchased - * Show error on screen if player attepts to buy more than what the buy max allows + * 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 */ diff --git a/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts index c3915c6..a0294a1 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts @@ -35,6 +35,8 @@ export declare class TraderAssortHelper { protected fenceService: FenceService; protected configServer: ConfigServer; protected traderConfig: ITraderConfig; + protected mergedQuestAssorts: Record>; + protected createdMergedQuestAssorts: boolean; constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderPurchasePersisterService: TraderPurchasePersisterService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer); /** * Get a traders assorts @@ -45,6 +47,10 @@ export declare class TraderAssortHelper { * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + /** + * Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed + */ + protected hydrateMergedQuestAssorts(): void; /** * Reset a traders assorts and move nextResupply value to future * Flag trader as needing a flea offer reset to be picked up by flea update() function @@ -61,7 +67,7 @@ export declare class TraderAssortHelper { * Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config * @param traderAssort Assorts to multiple price of */ - protected multiplyItemPricesByConfigMultipler(traderAssort: ITraderAssort): void; + protected multiplyItemPricesByConfigMultiplier(traderAssort: ITraderAssort): void; /** * Get an array of pristine trader items prior to any alteration by player (as they were on server start) * @param traderId trader id diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index e69c593..c95f4d8 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -41,11 +41,11 @@ export declare class TraderHelper { resetTrader(sessionID: string, traderID: string): void; /** * Alter a traders unlocked status - * @param traderID Trader to alter + * @param traderId Trader to alter * @param status New status to use - * @param sessionID Session id + * @param sessionId Session id */ - setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; + setTraderUnlockedState(traderId: string, status: boolean, sessionId: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -77,7 +77,7 @@ export declare class TraderHelper { protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; /** * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjsutments e.g. discounts + * Take into account bonuses/adjustments e.g. discounts * @param pmcData profile data * @param item item to calculate price of * @param buyPriceCoefficient @@ -104,11 +104,11 @@ export declare class TraderHelper { protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold - * @param sessionID Session id - * @param traderId traders id + * @param sessionId Session id + * @param traderId Traders id * @param standingToAdd Standing value to add to trader */ - addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + addStandingToTrader(sessionId: string, traderId: string, standingToAdd: number): void; /** * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process diff --git a/TypeScript/1LogToConsole/types/loaders/PostAkiModLoader.d.ts b/TypeScript/1LogToConsole/types/loaders/PostAkiModLoader.d.ts index edc6e5d..3361627 100644 --- a/TypeScript/1LogToConsole/types/loaders/PostAkiModLoader.d.ts +++ b/TypeScript/1LogToConsole/types/loaders/PostAkiModLoader.d.ts @@ -1,7 +1,6 @@ import { DependencyContainer } from "tsyringe"; import { HandbookController } from "../controllers/HandbookController"; import { IModLoader } from "../models/spt/mod/IModLoader"; -import { ModCompilerService } from "../services/ModCompilerService"; import { VFS } from "../utils/VFS"; import { BundleLoader } from "./BundleLoader"; import { PreAkiModLoader } from "./PreAkiModLoader"; @@ -9,9 +8,8 @@ export declare class PostAkiModLoader implements IModLoader { protected bundleLoader: BundleLoader; protected handbookController: HandbookController; protected vfs: VFS; - protected modCompilerService: ModCompilerService; protected preAkiModLoader: PreAkiModLoader; - constructor(bundleLoader: BundleLoader, handbookController: HandbookController, vfs: VFS, modCompilerService: ModCompilerService, preAkiModLoader: PreAkiModLoader); + constructor(bundleLoader: BundleLoader, handbookController: HandbookController, vfs: VFS, preAkiModLoader: PreAkiModLoader); getBundles(local: boolean): string; getBundle(key: string, local: boolean): void; getModPath(mod: string): string; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts index 60cdf5b..b5ed401 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts @@ -31,6 +31,7 @@ export interface Config { TimeBeforeDeployLocal: number; TradingSetting: number; TradingSettings: ITradingSettings; + ItemsCommonSettings: IItemsCommonSettings; LoadTimeSpeedProgress: number; BaseLoadTime: number; BaseUnloadTime: number; @@ -84,12 +85,16 @@ export interface Config { TestValue: number; Inertia: Inertia; Ballistic: Ballistic; + RepairSettings: RepairSettings; } export interface IBufferZone { CustomerAccessTime: number; CustomerCriticalTimeStart: number; CustomerKickNotifTime: number; } +export interface IItemsCommonSettings { + ItemRemoveAfterInterruptionTime: number; +} export interface ITradingSettings { BuyoutRestrictions: IBuyoutRestrictions; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts index c991b2d..f904d6b 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts @@ -104,7 +104,10 @@ export interface BodyPartsHealth { } export interface BodyPartHealth { Health: CurrentMax; - Effects?: Record; + Effects?: Record; +} +export interface BodyPartEffectProperties { + Time: number; } export interface CurrentMax { Current: number; @@ -124,7 +127,6 @@ export interface FastPanel { export interface Skills { Common: Common[]; Mastering: Mastering[]; - Bonuses?: any[]; Points: number; } export interface Common { @@ -277,9 +279,16 @@ export interface IHideoutImprovement { } export interface Productive { Products: Product[]; + /** Seconds passed of production */ Progress?: number; + /** Is production being crafted right now */ inProgress?: boolean; StartTimestamp?: number; + SkipTime?: number; + /** Seconds needed to fully craft */ + ProductionTime?: number; + /** False = client needs to be informed of production on client ui, true = client informed of completed production */ + sptClientInformedOfCompletion?: boolean; } export interface Production extends Productive { RecipeId: string; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IItem.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IItem.d.ts index 0a6d6fc..ce00ae9 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IItem.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IItem.d.ts @@ -7,6 +7,7 @@ export interface Item { upd?: Upd; } export interface Upd { + Buff?: Buff; OriginalStackObjectsCount?: number; Togglable?: Togglable; Map?: Map; @@ -16,6 +17,7 @@ export interface Upd { StackObjectsCount?: number; UnlimitedCount?: boolean; Repairable?: Repairable; + RecodableComponent?: RecodableComponent; FireMode?: FireMode; SpawnedInSession?: boolean; Light?: Light; @@ -31,6 +33,12 @@ export interface Upd { SideEffect?: SideEffect; RepairKit?: RepairKit; } +export interface Buff { + rarity: string; + buffType: string; + value: number; + thresholdDurability?: number; +} export interface Togglable { On: boolean; } @@ -52,6 +60,9 @@ export interface Repairable { Durability: number; MaxDurability: number; } +export interface RecodableComponent { + IsEncoded: boolean; +} export interface MedKit { HpResource: number; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts index cc77367..5c939e1 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts @@ -2,7 +2,7 @@ import { QuestRewardType } from "../../../enums/QuestRewardType"; import { QuestStatus } from "../../../enums/QuestStatus"; import { Item } from "./IItem"; export interface IQuest { - QuestName: string; + QuestName?: string; _id: string; canShowNotificationsInGame: boolean; conditions: Conditions; @@ -23,7 +23,7 @@ export interface IQuest { successMessageText: string; templateId: string; rewards: Rewards; - status: string; + status: string | number; KeyQuest: boolean; changeQuestMessageText: string; side: string; @@ -51,6 +51,8 @@ export interface AvailableForProps { visibilityConditions?: VisibilityCondition[]; target?: string | string[]; status?: QuestStatus[]; + availableAfter?: number; + dispersion?: number; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; doNotResetIfCounterCompleted?: boolean; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts index b59a277..cbad0a6 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts @@ -159,7 +159,7 @@ export interface Props { RigLayoutName?: string; MaxDurability?: number; armorZone?: string[]; - armorClass?: any; + armorClass?: string | number; mousePenalty?: number; weaponErgonomicPenalty?: number; BluntThroughput?: number; diff --git a/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 99d4bfe..dbf6330 100644 --- a/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,4 +1,5 @@ -import { Skills } from "../common/tables/IBotBase"; +import { QuestStatus } from "../../../models/enums/QuestStatus"; +import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase"; import { Item, Upd } from "../common/tables/IItem"; import { IQuest } from "../common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests"; @@ -21,12 +22,23 @@ export interface ProfileChange { ragFairOffers: IRagfairOffer[]; builds: BuildChange[]; items: ItemChanges; - production: Record; + production: Record; /** Hideout area improvement id */ improvements: Record; skills: Skills; - traderRelations: Record; + health: Health; + traderRelations: Record; repeatableQuests?: IPmcDataRepeatableQuest[]; + recipeUnlocked: Record; + questsStatus: QuestStatusChange[]; +} +export interface QuestStatusChange { + qid: string; + startTime: number; + status: QuestStatus; + statusTimers: Record; + completedConditions: string[]; + availableAfter: number; } export interface BuildChange { id: string; @@ -39,14 +51,6 @@ export interface ItemChanges { change: Product[]; del: Product[]; } -export interface Production { - Progress: number; - StartTimestamp: number; - ProductionTime: number; - inProgress: boolean; - RecipeId: string; - Products: Product[]; -} export interface Improvement { completed: boolean; improveCompleteTimestamp: number; @@ -65,10 +69,3 @@ export interface ItemChangeLocation { r: number; isSearched?: boolean; } -export interface TraderRelations { - salesSum?: number; - standing?: number; - loyalty?: number; - unlocked?: boolean; - disabled?: boolean; -} diff --git a/TypeScript/1LogToConsole/types/models/eft/match/IJoinMatchResult.d.ts b/TypeScript/1LogToConsole/types/models/eft/match/IJoinMatchResult.d.ts index df695f4..81c9055 100644 --- a/TypeScript/1LogToConsole/types/models/eft/match/IJoinMatchResult.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/match/IJoinMatchResult.d.ts @@ -6,6 +6,8 @@ export interface IJoinMatchResult { port: number; version: string; location: string; - gamemode: string; + raidMode: string; + mode: string; shortid: string; + additional_info: any[]; } diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts index cb7368c..1228c2e 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -6,7 +6,13 @@ export interface ProfileData { profileid: string; profileToken: string; status: string; - sid: string; ip: string; port: number; + sid: string; + version?: string; + location?: string; + raidMode?: string; + mode?: string; + shortId?: string; + additional_info?: any[]; } diff --git a/TypeScript/1LogToConsole/types/models/eft/quests/IFailQuestRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/quests/IFailQuestRequestData.d.ts new file mode 100644 index 0000000..5881d91 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/quests/IFailQuestRequestData.d.ts @@ -0,0 +1,5 @@ +export interface IFailQuestRequestData { + Action: "QuestComplete"; + qid: string; + removeExcessItems: boolean; +} diff --git a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts index 1081661..c6e880a 100644 --- a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts @@ -1,5 +1,6 @@ export declare enum BaseClasses { WEAPON = "5422acb9af1c889c16000029", + UBGL = "55818b014bdc2ddc698b456b", ARMOR = "5448e54d4bdc2dcc718b4568", ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b", HEADWEAR = "5a341c4086f77401f2541505", diff --git a/TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts b/TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts index 16f7e39..ff8c5f4 100644 --- a/TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts @@ -4,5 +4,6 @@ export declare enum QuestRewardType { TRADER_STANDING = "TraderStanding", TRADER_UNLOCK = "TraderUnlock", ITEM = "Item", - ASSORTMENT_UNLOCK = "AssortmentUnlock" + ASSORTMENT_UNLOCK = "AssortmentUnlock", + PRODUCTIONS_SCHEME = "ProductionScheme" } diff --git a/TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts b/TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts index ba65933..e706c05 100644 --- a/TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts @@ -7,5 +7,6 @@ export declare enum QuestStatus { Fail = 5, FailRestartable = 6, MarkedAsFailed = 7, - Expired = 8 + Expired = 8, + AvailableAfter = 9 } diff --git a/TypeScript/1LogToConsole/types/models/spt/bots/GenerateWeaponResult.d.ts b/TypeScript/1LogToConsole/types/models/spt/bots/GenerateWeaponResult.d.ts index f099752..56fa481 100644 --- a/TypeScript/1LogToConsole/types/models/spt/bots/GenerateWeaponResult.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -3,7 +3,8 @@ import { Item } from "../../eft/common/tables/IItem"; import { ITemplateItem } from "../../eft/common/tables/ITemplateItem"; export declare class GenerateWeaponResult { weapon: Item[]; - chosenAmmo: string; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; weaponMods: Mods; weaponTemplate: ITemplateItem; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts index 5e878ff..0785f1e 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts @@ -3,10 +3,5 @@ export interface IHideoutConfig extends IBaseConfig { kind: "aki-hideout"; runIntervalSeconds: number; hoursForSkillCrafting: number; - generatorSpeedWithoutFuel: number; - generatorFuelFlowRate: number; - airFilterUnitFlowRate: number; - /** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */ - gpuBoostRate: number; hideoutWallAppearTimeSeconds: number; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts index b27e753..fd498bc 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts @@ -5,5 +5,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnChancePercent: Record; blacklistedEquipment: string[]; slotIdsWithChanceOfNotReturning: string[]; + returnTimeOverrideSeconds: number; runIntervalSeconds: number; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts index dfd8c50..f808ad8 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts @@ -2,6 +2,9 @@ import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBas import { IBaseConfig } from "./IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "aki-location"; + fixEmptyBotWaves: boolean; + fixRoguesTakingAllSpawnsOnLighthouse: boolean; + lighthouseRogueSpawnTimeSeconds: number; looseLootMultiplier: LootMultiplier; staticLootMultiplier: LootMultiplier; customWaves: CustomWaves; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts index 6786417..5ea20f8 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts @@ -16,7 +16,7 @@ export interface Sell { } export interface Chance { base: number; - overprices: number; + overpriced: number; underpriced: number; } export interface Time { @@ -43,6 +43,7 @@ export interface Dynamic { rating: MinMax; currencies: Record; showAsSingleStack: string[]; + removeSeasonalItemsWhenNotInEvent: boolean; blacklist: Blacklist; } export declare class Barter { diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts index 8f6945c..b6db332 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IRepairConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface IRepairConfig extends IBaseConfig { kind: "aki-repair"; @@ -5,4 +6,20 @@ export interface IRepairConfig extends IBaseConfig { applyRandomizeDurabilityLoss: boolean; weaponSkillRepairGain: number; armorKitSkillPointGainPerRepairPointMultiplier: number; + repairKit: RepairKit; +} +export interface RepairKit { + armor: BonusSettings; + weapon: BonusSettings; +} +export interface BonusSettings { + rarityWeight: Record; + bonusTypeWeight: Record; + common: Record; + rare: Record; +} +export interface BonusValues { + valuesMinMax: MinMax; + /** What dura is buff active between (min max of current max) */ + activeDurabilityPercentMinMax: MinMax; } diff --git a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts index 7a2387b..7695953 100644 --- a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts @@ -1,11 +1,37 @@ -import { JsonUtil } from "../utils/JsonUtil"; import { ProfileHelper } from "../helpers/ProfileHelper"; +import { IPmcData } from "../models/eft/common/IPmcData"; +import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; +import { JsonUtil } from "../utils/JsonUtil"; +import { TimeUtil } from "../utils/TimeUtil"; export declare class EventOutputHolder { protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; - constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper); + protected timeUtil: TimeUtil; + constructor(jsonUtil: JsonUtil, profileHelper: ProfileHelper, timeUtil: TimeUtil); protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; + /** + * Reset the response object to a default state + * Occurs prior to event being handled by server + * @param sessionID Players id + */ resetOutput(sessionID: string): void; + /** + * Update output object with most recent values from player profile + * @param sessionId Session id + */ + updateOutputProperties(sessionId: string): void; + /** + * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true + * @param pmcData Player profile + * @returns dictionary of hideout improvements + */ + protected getImprovementsFromProfileAndFlagComplete(pmcData: IPmcData): Record; + /** + * Return all productions from player profile, adjust completed productions' sptClientInformedOfCompletion property to true + * @param pmcData Player profile + * @returns dictionary of hideout productions + */ + protected getProductionsFromProfileAndFlagComplete(pmcData: IPmcData): Record; } diff --git a/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts b/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts index a9338ab..9c7f70e 100644 --- a/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts +++ b/TypeScript/1LogToConsole/types/routers/ItemEventRouter.d.ts @@ -12,5 +12,11 @@ export declare class ItemEventRouter { protected localisationService: LocalisationService; protected eventOutputHolder: EventOutputHolder; constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder); + /** + * + * @param info Event request + * @param sessionID Session id + * @returns Item response + */ handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts b/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts index e4d7110..f702e2c 100644 --- a/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts +++ b/TypeScript/1LogToConsole/types/servers/http/AkiHttpListener.d.ts @@ -13,12 +13,13 @@ export declare class AkiHttpListener implements IHttpListener { protected httpRouter: HttpRouter; protected serializers: Serializer[]; protected logger: ILogger; + protected requestsLogger: ILogger; protected jsonUtil: JsonUtil; protected httpResponse: HttpResponseUtil; protected localisationService: LocalisationService; protected httpBufferHandler: HttpBufferHandler; constructor(httpRouter: HttpRouter, // TODO: delay required - serializers: Serializer[], logger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); + serializers: Serializer[], logger: ILogger, requestsLogger: ILogger, jsonUtil: JsonUtil, httpResponse: HttpResponseUtil, localisationService: LocalisationService, httpBufferHandler: HttpBufferHandler); canHandle(_: string, req: IncomingMessage): boolean; handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): void; sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; diff --git a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts index db41a8c..089cfb5 100644 --- a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts @@ -58,14 +58,14 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retreive clothing weighting adjustments from bot.json config + * Retrieve clothing weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bots clothing */ protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** - * Retreive item weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config * @param botRole Bot type to get adjustments for * @param playerLevel level of player * @returns Weighting adjustments for bot items @@ -73,7 +73,7 @@ export declare class BotEquipmentFilterService { protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment blacklist * @returns Filtered bot file @@ -81,10 +81,10 @@ export declare class BotEquipmentFilterService { protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; /** * Filter bot cartridges based on blacklist and whitelist from config/bot.json - * Prioritises whitelist first, if one is found blacklist is ignored + * Prioritizes whitelist first, if one is found blacklist is ignored * @param baseBotNode bot .json file to update * @param blacklist equipment on this list should be excluded from the bot - * @param whitelist equipment on this list should be used exclusivly + * @param whitelist equipment on this list should be used exclusively * @returns Filtered bot file */ protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; diff --git a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts index 9328b54..f3eda64 100644 --- a/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/InsuranceService.d.ts @@ -1,3 +1,4 @@ +import { ITraderBase } from "@spt-aki/models/eft/common/tables/ITrader"; import { DialogueHelper } from "../helpers/DialogueHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; import { SecureContainerHelper } from "../helpers/SecureContainerHelper"; @@ -49,6 +50,13 @@ export declare class InsuranceService { * @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; + /** + * Get a timestamp of what insurance items should be sent to player based on the type of trader used to insure + * @param pmcData Player profile + * @param trader Trader used to insure items + * @returns Timestamp to return items to player in seconds + */ + protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number; /** * Store lost gear post-raid inside profile * @param pmcData player profile to store gear in diff --git a/TypeScript/1LogToConsole/types/services/PlayerService.d.ts b/TypeScript/1LogToConsole/types/services/PlayerService.d.ts index 2f364d5..1195b93 100644 --- a/TypeScript/1LogToConsole/types/services/PlayerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PlayerService.d.ts @@ -1,5 +1,4 @@ import { IPmcData } from "../models/eft/common/IPmcData"; -import { IPlayerIncrementSkillLevelRequestData } from "../models/eft/player/IPlayerIncrementSkillLevelRequestData"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "./LocalisationService"; @@ -11,11 +10,10 @@ export declare class PlayerService { /** * increases the profile skill and updates any output * @param {Object} pmcData - * @param {Object} output * @param {String} skillName * @param {Number} amount */ - incrementSkillLevel(pmcData: IPmcData, output: IPlayerIncrementSkillLevelRequestData, skillName: string, amount: number): void; + incrementSkillLevel(pmcData: IPmcData, skillName: string, amount: number): void; /** * @param {Object} pmcData * @returns number diff --git a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts index 5130dc0..2ed5a16 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts @@ -35,6 +35,7 @@ export declare class ProfileFixerService { */ removeDanglingConditionCounters(pmcProfile: IPmcData): void; addLighthouseKeeperIfMissing(pmcProfile: IPmcData): void; + protected addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void; protected removeDanglingBackendCounters(pmcProfile: IPmcData): void; protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; @@ -48,6 +49,11 @@ export declare class ProfileFixerService { protected updateProfileQuestDataValues(pmcProfile: IPmcData): void; protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void; + /** + * Some profiles have hideout maxed and therefore no improvements + * @param pmcProfile Profile to add improvement data to + */ + protected addMissingWallImprovements(pmcProfile: IPmcData): void; /** * A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed * @param pmcProfile Profile to find and remove slots from diff --git a/TypeScript/1LogToConsole/types/services/RepairService.d.ts b/TypeScript/1LogToConsole/types/services/RepairService.d.ts index c2d9088..a3c6c7a 100644 --- a/TypeScript/1LogToConsole/types/services/RepairService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RepairService.d.ts @@ -2,28 +2,32 @@ import { ItemHelper } from "../helpers/ItemHelper"; import { QuestHelper } from "../helpers/QuestHelper"; import { RepairHelper } from "../helpers/RepairHelper"; import { TraderHelper } from "../helpers/TraderHelper"; +import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; import { Item } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "../models/eft/repair/IRepairActionDataRequest"; import { RepairItem } from "../models/eft/repair/ITraderRepairActionDataRequest"; -import { IRepairConfig } from "../models/spt/config/IRepairConfig"; +import { BonusSettings, IRepairConfig } from "../models/spt/config/IRepairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { RandomUtil } from "../utils/RandomUtil"; import { PaymentService } from "./PaymentService"; export declare class RepairService { protected logger: ILogger; protected databaseServer: DatabaseServer; protected questHelper: QuestHelper; + protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected traderHelper: TraderHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected paymentService: PaymentService; protected repairHelper: RepairHelper; protected configServer: ConfigServer; - repairConfig: IRepairConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); + protected repairConfig: IRepairConfig; + constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, traderHelper: TraderHelper, weightedRandomHelper: WeightedRandomHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); /** * Use trader to repair an items durability * @param sessionID Session id @@ -48,9 +52,8 @@ export declare class RepairService { * @param sessionId Session id * @param repairDetails details of item repaired, cost/item * @param pmcData Profile to add points to - * @param output IItemEventRouterResponse */ - addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData, output: IItemEventRouterResponse): void; + addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; /** * * @param sessionId Session id @@ -61,12 +64,60 @@ export declare class RepairService { * @returns Details of repair, item/price */ repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: RepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; + /** + * Calculate value repairkit points need to be divided by to get the durability points to be added to an item + * @param itemToRepairDetails Item to repair details + * @param isArmor Is the item being repaired armor + * @param pmcData Player profile + * @returns Number to divide kit points by + */ + protected getKitDivisor(itemToRepairDetails: ITemplateItem, isArmor: boolean, pmcData: IPmcData): number; + /** + * Get the bonus multiplier for a skill from a player profile + * @param skillBonusName Name of bonus to get multipler of + * @param pmcData Player profile to look in for skill + * @returns Multiplier value + */ + protected getBonusMultiplierValue(skillBonusName: string, pmcData: IPmcData): number; /** * Update repair kits Resource object if it doesn't exist * @param repairKitDetails Repair kit details from db * @param repairKitInInventory Repair kit to update */ protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: Item): void; + /** + * Chance to apply buff to an item (Armor/weapon) if repaired by armor kit + * @param repairDetails Repair details of item + * @param pmcData Player profile + */ + addBuffToItem(repairDetails: RepairDetails, pmcData: IPmcData): void; + /** + * Add buff to item + * @param itemConfig weapon/armor config + * @param repairDetails Details for item to repair + */ + protected addBuff(itemConfig: BonusSettings, repairDetails: RepairDetails): void; + /** + * Check if item should be buffed by checking the item type and relevant player skill level + * @param repairDetails Item that was repaired + * @param itemTpl tpl of item to be buffed + * @param pmcData Player profile + * @returns True if item should have buff applied + */ + protected shouldBuffItem(repairDetails: RepairDetails, pmcData: IPmcData): boolean; + /** + * Based on item, what underlying skill does this item use for buff settings + * @param itemTemplate Item to check for skill + * @returns Skill name + */ + protected getItemSkillType(itemTemplate: ITemplateItem): string; + /** + * Ensure multiplier is between 1 and 0.01 + * @param receiveDurabilityMaxPercent Max durabiltiy percent + * @param receiveDurabilityPercent current durability percent + * @returns durability multipler value + */ + protected getDurabilityMultiplier(receiveDurabilityMaxPercent: number, receiveDurabilityPercent: number): number; } export declare class RepairDetails { repairCost?: number; diff --git a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts index d280332..907f63c 100644 --- a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts +++ b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts @@ -16,17 +16,46 @@ export declare class SeasonalEventService { constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer); protected get events(): Record; protected get christmasEventItems(): string[]; + protected get halloweenEventItems(): string[]; /** * Get an array of christmas items found in bots inventories as loot * @returns array */ getChristmasEventItems(): string[]; - itemIsChristmasRelated(itemId: string): boolean; + /** + * Get an array of halloween items found in bots inventories as loot + * @returns array + */ + getHalloweenEventItems(): string[]; + itemIsChristmasRelated(itemTpl: string): boolean; + itemIsHalloweenRelated(itemTpl: string): boolean; + /** + * Check if item id exists in christmas or halloween event arrays + * @param itemTpl item tpl to check for + * @returns + */ + itemIsSeasonalRelated(itemTpl: string): boolean; + /** + * Get an array of items that appear during a seasonal event + * returns multiple seasonal event items if they are both active + * @returns array of tpl strings + */ + getSeasonalEventItems(): string[]; + /** + * Is a seasonal event currently active + * @returns true if event is active + */ + seasonalEventEnabled(): boolean; /** * is christmas event active * @returns true if active */ christmasEventEnabled(): boolean; + /** + * is christmas event active + * @returns true if active + */ + halloweenEventEnabled(): boolean; /** * Is detection of seasonal events enabled (halloween / christmas) * @returns true if seasonal events should be checked for diff --git a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts index 2591142..7fbe76b 100644 --- a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts @@ -20,7 +20,7 @@ export declare class JsonUtil { * @param jsonString json string to turn into object * @returns object */ - deserialize(jsonString: string): any; + deserialize(jsonString: string, filename?: string): any; deserializeWithCacheCheck(jsonString: string, filePath: string): string; clone(data: T): T; } diff --git a/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts b/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts index aa556e3..fc0b05d 100644 --- a/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/RandomUtil.d.ts @@ -110,6 +110,7 @@ export declare class RandomUtil { getIntEx(max: number): number; getFloat(min: number, max: number): number; getBool(): boolean; + getPercentOfValue(percent: number, number: number, toFixed?: number): number; /** * Check if number passes a check out of 100 * @param chancePercent value check needs to be above diff --git a/TypeScript/1LogToConsole/types/utils/Logger.d.ts b/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts similarity index 70% rename from TypeScript/1LogToConsole/types/utils/Logger.d.ts rename to TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts index 1088701..1ae1100 100644 --- a/TypeScript/1LogToConsole/types/utils/Logger.d.ts +++ b/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts @@ -1,19 +1,17 @@ /// import fs from "fs"; import winston from "winston"; -import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest"; -import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor"; -import { LogTextColor } from "../models/spt/logging/LogTextColor"; -import { SptLogger } from "../models/spt/logging/SptLogger"; -import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue"; -import { ILogger } from "../models/spt/utils/ILogger"; -import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; -export declare class WinstonLogger implements ILogger { +import { Daum } from "../../models/eft/itemEvent/IItemEventRouterRequest"; +import { LogBackgroundColor } from "../../models/spt/logging/LogBackgroundColor"; +import { LogTextColor } from "../../models/spt/logging/LogTextColor"; +import { SptLogger } from "../../models/spt/logging/SptLogger"; +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { ILogger } from "../../models/spt/utils/ILogger"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +export declare abstract class AbstractWinstonLogger implements ILogger { protected asyncQueue: IAsyncQueue; protected uuidGenerator: IUUidGenerator; protected showDebugInConsole: boolean; - protected folderPath: string; - protected file: string; protected filePath: string; protected logLevels: { levels: { @@ -47,6 +45,13 @@ export declare class WinstonLogger implements ILogger { protected logger: winston.Logger & SptLogger; protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected abstract isLogToFile(): boolean; + protected abstract isLogToConsole(): boolean; + protected abstract isLogExceptions(): boolean; + protected abstract getFilePath(): string; + protected abstract getFileName(): string; + protected getLogMaxSize(): string; + protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; log(data: string | Error | Record, color: string, backgroundColor?: string): Promise; error(data: string | Record): Promise; diff --git a/TypeScript/1LogToConsole/types/utils/logging/WinstonMainLogger.d.ts b/TypeScript/1LogToConsole/types/utils/logging/WinstonMainLogger.d.ts new file mode 100644 index 0000000..3c67902 --- /dev/null +++ b/TypeScript/1LogToConsole/types/utils/logging/WinstonMainLogger.d.ts @@ -0,0 +1,13 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonMainLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; +} diff --git a/TypeScript/1LogToConsole/types/utils/logging/WinstonRequestLogger.d.ts b/TypeScript/1LogToConsole/types/utils/logging/WinstonRequestLogger.d.ts new file mode 100644 index 0000000..1475e43 --- /dev/null +++ b/TypeScript/1LogToConsole/types/utils/logging/WinstonRequestLogger.d.ts @@ -0,0 +1,14 @@ +import { IAsyncQueue } from "../../models/spt/utils/IAsyncQueue"; +import { IUUidGenerator } from "../../models/spt/utils/IUuidGenerator"; +import { AbstractWinstonLogger } from "./AbstractWinstonLogger"; +export declare class WinstonRequestLogger extends AbstractWinstonLogger { + protected asyncQueue: IAsyncQueue; + protected uuidGenerator: IUUidGenerator; + constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator); + protected isLogExceptions(): boolean; + protected isLogToFile(): boolean; + protected isLogToConsole(): boolean; + protected getFilePath(): string; + protected getFileName(): string; + protected getLogMaxSize(): string; +}