From dd43c2019065b2bbd0920acfcb73d6bf6cb74e29 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 6 Dec 2024 18:41:34 +0100 Subject: [PATCH 1/2] Add new types --- types/callbacks/DataCallbacks.d.ts | 2 - types/callbacks/MatchCallbacks.d.ts | 7 +- types/controllers/HideoutController.d.ts | 2 +- types/controllers/ProfileController.d.ts | 3 + types/controllers/WeatherController.d.ts | 5 - .../generators/BotEquipmentModGenerator.d.ts | 3 +- types/generators/RagfairOfferGenerator.d.ts | 4 +- types/generators/ScavCaseRewardGenerator.d.ts | 6 +- types/helpers/InRaidHelper.d.ts | 7 - types/helpers/InventoryHelper.d.ts | 2 +- types/helpers/ProfileHelper.d.ts | 13 ++ types/helpers/QuestHelper.d.ts | 24 ++- types/helpers/RagfairOfferHelper.d.ts | 27 ++- types/helpers/TraderAssortHelper.d.ts | 14 +- types/helpers/WeatherHelper.d.ts | 2 +- types/models/eft/common/tables/IBotBase.d.ts | 2 +- .../eft/common/tables/ICustomizationItem.d.ts | 1 + types/models/eft/health/IWorkoutData.d.ts | 1 - .../models/eft/hideout/IHideoutScavCase.d.ts | 18 -- types/models/eft/profile/ISptProfile.d.ts | 7 + types/models/enums/ItemTpl.d.ts | 88 ++++++++- types/models/enums/Weapons.d.ts | 3 + .../models/spt/callbacks/IDataCallbacks.d.ts | 23 --- types/models/spt/config/ICoreConfig.d.ts | 2 + types/models/spt/config/IHideoutConfig.d.ts | 21 ++- types/models/spt/config/ITraderConfig.d.ts | 2 +- types/models/spt/hideout/IHideout.d.ts | 2 - types/servers/HttpServer.d.ts | 4 +- types/services/CircleOfCultistService.d.ts | 93 +++++++--- types/services/DatabaseService.d.ts | 21 ++- types/services/LocaleService.d.ts | 2 +- types/services/LocationLifecycleService.d.ts | 8 + types/services/ProfileFixerService.d.ts | 25 ++- types/services/SeasonalEventService.d.ts | 12 ++ types/utils/App.d.ts | 4 +- types/utils/RandomUtil.d.ts | 174 ++++++++++++++---- 36 files changed, 460 insertions(+), 174 deletions(-) delete mode 100644 types/models/eft/hideout/IHideoutScavCase.d.ts delete mode 100644 types/models/spt/callbacks/IDataCallbacks.d.ts diff --git a/types/callbacks/DataCallbacks.d.ts b/types/callbacks/DataCallbacks.d.ts index d92be661..5b501e1e 100644 --- a/types/callbacks/DataCallbacks.d.ts +++ b/types/callbacks/DataCallbacks.d.ts @@ -8,7 +8,6 @@ import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IGetItemPricesResponse } from "@spt/models/eft/game/IGetItemPricesResponse"; import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutProductionData } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; @@ -63,7 +62,6 @@ export declare class DataCallbacks { getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/languages */ diff --git a/types/callbacks/MatchCallbacks.d.ts b/types/callbacks/MatchCallbacks.d.ts index 0ab9f022..f8342606 100644 --- a/types/callbacks/MatchCallbacks.d.ts +++ b/types/callbacks/MatchCallbacks.d.ts @@ -32,9 +32,12 @@ export declare class MatchCallbacks { updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; /** Handle client/match/group/exit_from_menu */ - exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; + exitFromMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; + /** Handle client/match/group/current */ groupCurrent(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle client/match/group/looking/start */ startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; + /** Handle client/match/group/looking/stop */ stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; /** Handle client/match/group/invite/send */ sendGroupInvite(url: string, info: IMatchGroupInviteSendRequest, sessionID: string): IGetBodyResponseData; @@ -48,7 +51,9 @@ export declare class MatchCallbacks { transferGroup(url: string, info: IMatchGroupTransferRequest, sessionId: string): IGetBodyResponseData; /** Handle client/match/group/invite/cancel-all */ cancelAllGroupInvite(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; + /** Handle client/putMetrics */ putMetrics(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData; + /** Handle client/analytics/event-disconnect */ eventDisconnect(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; /** Handle match/group/start_game */ diff --git a/types/controllers/HideoutController.d.ts b/types/controllers/HideoutController.d.ts index 4a925049..7bbd4833 100644 --- a/types/controllers/HideoutController.d.ts +++ b/types/controllers/HideoutController.d.ts @@ -67,7 +67,7 @@ export declare class HideoutController { protected circleOfCultistService: CircleOfCultistService; protected cloner: ICloner; /** Key used in TaskConditionCounters array */ - protected static nameTaskConditionCountersCrafting: string; + protected static nameTaskConditionCountersCraftingId: string; protected hideoutConfig: IHideoutConfig; constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, circleOfCultistService: CircleOfCultistService, cloner: ICloner); /** diff --git a/types/controllers/ProfileController.d.ts b/types/controllers/ProfileController.d.ts index 71fd9e6e..dd20b5d7 100644 --- a/types/controllers/ProfileController.d.ts +++ b/types/controllers/ProfileController.d.ts @@ -118,6 +118,9 @@ export declare class ProfileController { * Handle client/profile/status */ getProfileStatus(sessionId: string): IGetProfileStatusResponseData; + /** + * Handle client/profile/view + */ getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; /** * Handle client/profile/settings diff --git a/types/controllers/WeatherController.d.ts b/types/controllers/WeatherController.d.ts index 493cb8f9..7cf71a62 100644 --- a/types/controllers/WeatherController.d.ts +++ b/types/controllers/WeatherController.d.ts @@ -18,11 +18,6 @@ export declare class WeatherController { constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService, raidWeatherService: RaidWeatherService, weatherHelper: WeatherHelper); /** Handle client/weather */ generate(): IWeatherData; - /** - * Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK) - * @returns Date object - */ - getCurrentInRaidTime(): Date; /** Handle client/localGame/weather */ generateLocal(sesssionId: string): IGetLocalWeatherResponseData; } diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index 40c361f0..29aa5cd3 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -114,9 +114,10 @@ export declare class BotEquipmentModGenerator { /** * Sort mod slots into an ordering that maximises chance of a successful weapon generation * @param unsortedSlotKeys Array of mod slot strings to sort + * @param itemTplWithKeysToSort The Tpl of the item with mod keys being sorted * @returns Sorted array */ - protected sortModKeys(unsortedSlotKeys: string[]): string[]; + protected sortModKeys(unsortedSlotKeys: string[], itemTplWithKeysToSort: string): string[]; /** * Get a Slot property for an item (chamber/cartridge/slot) * @param modSlot e.g patron_in_weapon diff --git a/types/generators/RagfairOfferGenerator.d.ts b/types/generators/RagfairOfferGenerator.d.ts index 60d6c9d1..324df2e1 100644 --- a/types/generators/RagfairOfferGenerator.d.ts +++ b/types/generators/RagfairOfferGenerator.d.ts @@ -12,6 +12,7 @@ import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IOfferRequirement, IRagfairOffer, IRagfairOfferUser } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IArmorPlateBlacklistSettings, IBarterDetails, IDynamic, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ITplWithFleaPrice } from "@spt/models/spt/ragfair/ITplWithFleaPrice"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -47,6 +48,7 @@ export declare class RagfairOfferGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; + protected traderConfig: ITraderConfig; protected botConfig: IBotConfig; protected allowedFleaPriceItemsForBarter: { tpl: string; @@ -83,7 +85,7 @@ export declare class RagfairOfferGenerator { * @param isTrader Is the user creating the offer a trader * @returns IRagfairOfferUser */ - createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser; + protected createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser; /** * Calculate the offer price that's listed on the flea listing * @param offerRequirements barter requirements for offer diff --git a/types/generators/ScavCaseRewardGenerator.d.ts b/types/generators/ScavCaseRewardGenerator.d.ts index 28ec2b6d..715b84ea 100644 --- a/types/generators/ScavCaseRewardGenerator.d.ts +++ b/types/generators/ScavCaseRewardGenerator.d.ts @@ -2,7 +2,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; +import { IScavRecipe } from "@spt/models/eft/hideout/IHideoutProduction"; import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; import { IRewardCountAndPriceDetails, IScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -84,10 +84,10 @@ export declare class ScavCaseRewardGenerator { protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: IRewardCountAndPriceDetails): ITemplateItem[]; /** * Gathers the reward min and max count params for each reward quality level from config and scavcase.json into a single object - * @param scavCaseDetails scavcase.json values + * @param scavCaseDetails production.json/scavRecipes object * @returns ScavCaseRewardCountsAndPrices object */ - protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): IScavCaseRewardCountsAndPrices; + protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IScavRecipe): IScavCaseRewardCountsAndPrices; /** * Randomises the size of ammo and money stacks * @param itemToCalculate ammo or money item diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index eda416e2..c64077eb 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -65,13 +65,6 @@ export declare class InRaidHelper { * @param secureContainerSlotId Container slot id to find items for and remove FiR from */ removeFiRStatusFromItemsInContainer(sessionId: string, pmcData: IPmcData, secureContainerSlotId: string): void; - /** - * Deletes quest conditions from pickup tasks given a list of quest items being carried by a PMC. - * @param carriedQuestItems Items carried by PMC at death, usually gotten from "CarriedQuestItems" - * @param sessionId Current sessionId - * @param pmcProfile Pre-raid profile that is being handled with raid information - */ - removePickupQuestConditions(carriedQuestItems: string[], sessionId: string, pmcProfile: IPmcData): void; /** * Get an array of items from a profile that will be lost on death * @param pmcProfile Profile to get items from diff --git a/types/helpers/InventoryHelper.d.ts b/types/helpers/InventoryHelper.d.ts index c6bc6fe6..b082fa95 100644 --- a/types/helpers/InventoryHelper.d.ts +++ b/types/helpers/InventoryHelper.d.ts @@ -72,7 +72,7 @@ export declare class InventoryHelper { */ protected removeTraderRagfairRelatedUpdProperties(upd: IUpd): void; /** - * Can all probided items be added into player inventory + * Can all provided items be added into player inventory * @param sessionId Player id * @param itemsWithChildren array of items with children to try and fit * @returns True all items fit diff --git a/types/helpers/ProfileHelper.d.ts b/types/helpers/ProfileHelper.d.ts index e36a3497..c2871b44 100644 --- a/types/helpers/ProfileHelper.d.ts +++ b/types/helpers/ProfileHelper.d.ts @@ -1,6 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Common, ICounterKeyValue, IStats } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { BonusType } from "@spt/models/enums/BonusType"; @@ -202,4 +203,16 @@ export declare class ProfileHelper { * @param newPocketTpl New tpl to set profiles Pockets to */ replaceProfilePocketTpl(pmcProfile: IPmcData, newPocketTpl: string): void; + /** + * Return all quest items current in the supplied profile + * @param profile Profile to get quest items from + * @returns Array of item objects + */ + getQuestItemsInProfile(profile: IPmcData): IItem[]; + /** + * Return a favorites array in the format expected by the getOtherProfile call + * @param profile + * @returns An array of IItem objects representing the favorited data + */ + getOtherProfileFavorites(profile: IPmcData): IItem[]; } diff --git a/types/helpers/QuestHelper.d.ts b/types/helpers/QuestHelper.d.ts index ff0f72bc..414cc0a5 100644 --- a/types/helpers/QuestHelper.d.ts +++ b/types/helpers/QuestHelper.d.ts @@ -10,6 +10,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Common, IQuestStatus } from "@spt/models/eft/common/tables/IBotBase"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition, IQuestReward } from "@spt/models/eft/common/tables/IQuest"; +import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData"; import { ICompleteQuestRequestData } from "@spt/models/eft/quests/ICompleteQuestRequestData"; @@ -113,12 +114,12 @@ export declare class QuestHelper { */ protected generateArmorRewardChildSlots(originalRewardRootItem: IItem, questReward: IQuestReward): void; /** - * Gets a flat list of reward items for the given quest at a specific state (e.g. Fail/Success) + * Gets a flat list of reward items for the given quest at a specific state for the specified game version (e.g. Fail/Success) * @param quest quest to get rewards for * @param status Quest status that holds the items (Started, Success, Fail) * @returns array of items with the correct maxStack */ - getQuestRewardItems(quest: IQuest, status: QuestStatus): IItem[]; + getQuestRewardItems(quest: IQuest, status: QuestStatus, gameVersion: string): IItem[]; /** * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile * @param pmcData Player profile @@ -280,6 +281,13 @@ export declare class QuestHelper { * @param response Response to send back to client */ protected findAndAddHideoutProductionIdToProfile(pmcData: IPmcData, craftUnlockReward: IQuestReward, questDetails: IQuest, sessionID: string, response: IItemEventRouterResponse): void; + /** + * Find hideout craft for the specified quest reward + * @param craftUnlockReward Reward item from quest with craft unlock details + * @param questDetails Quest with craft unlock reward + * @returns Hideout craft + */ + getRewardProductionMatch(craftUnlockReward: IQuestReward, questDetails: IQuest): IHideoutProduction[]; /** * Get players money reward bonus from profile * @param pmcData player profile @@ -321,10 +329,18 @@ export declare class QuestHelper { * @returns array of IQuest */ getClientQuests(sessionID: string): IQuest[]; + /** + * Create a clone of the given quest array with the rewards updated to reflect the + * given game version + * @param quests List of quests to check + * @param gameVersion Game version of the profile + * @returns Array of IQuest objects with the rewards filtered correctly for the game version + */ + protected updateQuestsForGameEdition(quests: IQuest[], gameVersion: string): IQuest[]; /** * Return a list of quests that would fail when supplied quest is completed - * @param completedQuestId quest completed id - * @returns array of IQuest objects + * @param completedQuestId Quest completed id + * @returns Array of IQuest objects */ protected getQuestsFromProfileFailedByCompletingQuest(completedQuestId: string, pmcProfile: IPmcData): IQuest[]; /** diff --git a/types/helpers/RagfairOfferHelper.d.ts b/types/helpers/RagfairOfferHelper.d.ts index 66a146d1..9dd5be3d 100644 --- a/types/helpers/RagfairOfferHelper.d.ts +++ b/types/helpers/RagfairOfferHelper.d.ts @@ -67,6 +67,13 @@ export declare class RagfairOfferHelper { * @returns Offers the player should see */ getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcData: IPmcData): IRagfairOffer[]; + /** + * Disable offer if item is flagged by tiered flea config + * @param tieredFlea Tiered flea settings from ragfair config + * @param offer Ragfair offer to check + * @param tieredFleaLimitTypes Dict of item types with player level to be viewable + * @param playerLevel Level of player viewing offer + */ protected checkAndLockOfferFromPlayerTieredFlea(tieredFlea: ITieredFlea, offer: IRagfairOffer, tieredFleaLimitTypes: string[], playerLevel: number): void; /** * Get matching offers that require the desired item and filter out offers from non traders if player is below ragfair unlock level @@ -99,14 +106,14 @@ export declare class RagfairOfferHelper { */ traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** - * Has a traders offer ran out of stock to sell to player + * Has trader offer ran out of stock to sell to player * @param offer Offer to check stock of * @returns true if out of stock */ protected traderOutOfStock(offer: IRagfairOffer): boolean; /** * Check if trader offers' BuyRestrictionMax value has been reached - * @param offer offer to check restriction properties of + * @param offer Offer to check restriction properties of * @returns true if restriction reached, false if no restrictions/not reached */ protected traderBuyRestrictionReached(offer: IRagfairOffer): boolean; @@ -114,7 +121,7 @@ export declare class RagfairOfferHelper { * Get an array of flea offers that are inaccessible to player due to their inadequate loyalty level * @param offers Offers to check * @param pmcProfile Players profile with trader loyalty levels - * @returns array of offer ids player cannot see + * @returns Array of offer ids player cannot see */ protected getLoyaltyLockedOffers(offers: IRagfairOffer[], pmcProfile: IPmcData): string[]; /** @@ -126,7 +133,7 @@ export declare class RagfairOfferHelper { /** * Count up all rootitem StackObjectsCount properties of an array of items * @param itemsInInventoryToList items to sum up - * @returns Total count + * @returns Total stack count */ getTotalStackCountSize(itemsInInventoryToList: IItem[][]): number; /** @@ -164,16 +171,16 @@ export declare class RagfairOfferHelper { protected getLocalisedOfferSoldMessage(itemTpl: string, boughtAmount: number): string; /** * Check an offer passes the various search criteria the player requested - * @param searchRequest - * @param offer - * @param pmcData - * @returns True + * @param searchRequest Client search request + * @param offer Offer to check + * @param pmcData Player profile + * @returns True if offer passes criteria */ protected passesSearchFilterCriteria(searchRequest: ISearchRequestData, offer: IRagfairOffer, pmcData: IPmcData): boolean; /** * Check that the passed in offer item is functional * @param offerRootItem The root item of the offer - * @param offer The flea offer + * @param offer Flea offer to check * @returns True if the given item is functional */ isItemFunctional(offerRootItem: IItem, offer: IRagfairOffer): boolean; @@ -181,7 +188,7 @@ export declare class RagfairOfferHelper { * Should a ragfair offer be visible to the player * @param searchRequest Search request * @param itemsToAdd ? - * @param traderAssorts Trader assort items + * @param traderAssorts Trader assort items - used for filtering out locked trader items * @param offer The flea offer * @param pmcProfile Player profile * @returns True = should be shown to player diff --git a/types/helpers/TraderAssortHelper.d.ts b/types/helpers/TraderAssortHelper.d.ts index a50b5894..70946a2f 100644 --- a/types/helpers/TraderAssortHelper.d.ts +++ b/types/helpers/TraderAssortHelper.d.ts @@ -44,10 +44,10 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id - * @param flea Should assorts player hasn't unlocked be returned - default false + * @param showLockedAssorts Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ - getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; + getAssort(sessionId: string, traderId: string, showLockedAssorts?: boolean): ITraderAssort; /** * Given the blacklist provided, remove root items from assort * @param assortToFilter Trader assort to modify @@ -75,20 +75,10 @@ export declare class TraderAssortHelper { * @returns true they need refreshing */ traderAssortsHaveExpired(traderID: string): boolean; - /** - * 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 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 * @returns array of Items */ protected getPristineTraderAssorts(traderId: string): IItem[]; - /** - * Returns generated ragfair offers in a trader assort format - * @returns Trader assort object - */ - protected getRagfairDataAsTraderAssort(): ITraderAssort; } diff --git a/types/helpers/WeatherHelper.d.ts b/types/helpers/WeatherHelper.d.ts index 928017f8..c82f42b1 100644 --- a/types/helpers/WeatherHelper.d.ts +++ b/types/helpers/WeatherHelper.d.ts @@ -10,7 +10,7 @@ export declare class WeatherHelper { protected weatherConfig: IWeatherConfig; constructor(logger: ILogger, timeUtil: TimeUtil, configServer: ConfigServer); /** - * Get the current in-raid time + * Get the current in-raid time - does not include an accurate date, only time * @param currentDate (new Date()) * @returns Date object of current in-raid time */ diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 5becac2c..d3fd87e8 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -153,7 +153,7 @@ export interface IInventory { /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ hideoutAreaStashes: Record; fastPanel: Record; - favoriteItems: IItem[]; + favoriteItems: string[]; } export interface IBaseJsonSkills { Common: Record; diff --git a/types/models/eft/common/tables/ICustomizationItem.d.ts b/types/models/eft/common/tables/ICustomizationItem.d.ts index abf82d9d..721e1e9a 100644 --- a/types/models/eft/common/tables/ICustomizationItem.d.ts +++ b/types/models/eft/common/tables/ICustomizationItem.d.ts @@ -11,6 +11,7 @@ export interface IProps { Name: string; ShortName: string; Description: string; + Game: string[]; Side: string[]; BodyPart: string; AvailableAsDefault?: boolean; diff --git a/types/models/eft/health/IWorkoutData.d.ts b/types/models/eft/health/IWorkoutData.d.ts index d958b743..ee142061 100644 --- a/types/models/eft/health/IWorkoutData.d.ts +++ b/types/models/eft/health/IWorkoutData.d.ts @@ -1,6 +1,5 @@ export interface IWorkoutData extends Record { skills: IWorkoutSkills; - effects: IWorkoutEffects; } export interface IWorkoutSkills { Common: IWorkoutSkillCommon[]; diff --git a/types/models/eft/hideout/IHideoutScavCase.d.ts b/types/models/eft/hideout/IHideoutScavCase.d.ts deleted file mode 100644 index b420d2d6..00000000 --- a/types/models/eft/hideout/IHideoutScavCase.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { MinMax } from "@spt/models/common/MinMax"; -export interface IHideoutScavCase { - _id: string; - ProductionTime: number; - Requirements: IRequirement[]; - EndProducts: IEndProducts; -} -export interface IRequirement { - templateId: string; - count: number; - isFunctional: boolean; - type: string; -} -export interface IEndProducts { - Common: MinMax; - Rare: MinMax; - Superrare: MinMax; -} diff --git a/types/models/eft/profile/ISptProfile.d.ts b/types/models/eft/profile/ISptProfile.d.ts index 8290b1c4..aba539b4 100644 --- a/types/models/eft/profile/ISptProfile.d.ts +++ b/types/models/eft/profile/ISptProfile.d.ts @@ -169,6 +169,13 @@ export interface ISpt { freeRepeatableRefreshUsedCount?: Record; /** When was a profile migrated, value is timestamp */ migrations?: Record; + /** Cultist circle rewards received that are one time use, key (md5) is a combination of sacrificed + reward items */ + cultistRewards?: Map; +} +export interface IAcceptedCultistReward { + timestamp: number; + sacrificeItems: string[]; + rewardItems: string[]; } export interface IModDetails { name: string; diff --git a/types/models/enums/ItemTpl.d.ts b/types/models/enums/ItemTpl.d.ts index 46502ac4..2493578f 100644 --- a/types/models/enums/ItemTpl.d.ts +++ b/types/models/enums/ItemTpl.d.ts @@ -241,7 +241,7 @@ export declare enum ItemTpl { AMMO_23X75_SHRAP10 = "5e85a9a6eacf8c039e4e2ac1", AMMO_23X75_SHRAP25 = "5f647f31b6238e5dd066e196", AMMO_23X75_ZVEZDA = "5e85a9f4add9fe03027d9bf1", - AMMO_26X75_AC = "635267f063651329f75a4ee8", + AMMO_26X75_AG = "635267f063651329f75a4ee8", AMMO_26X75_FLARE = "62389bc9423ed1685422dc57", AMMO_26X75_GREEN = "62389aaba63f32501b1b444f", AMMO_26X75_RED = "62389ba9a63f32501b1b4451", @@ -562,6 +562,7 @@ export declare enum ItemTpl { ASSAULTRIFLE_SIG_MCX_300_BLACKOUT_ASSAULT_RIFLE = "5fbcc1d9016cce60e8341ab3", ASSAULTRIFLE_STEYR_AUG_A1_556X45_ASSAULT_RIFLE = "62e7c4fba689e8c9c50dfc38", ASSAULTRIFLE_STEYR_AUG_A3_556X45_ASSAULT_RIFLE = "63171672192e68c5460cebc5", + ASSAULTRIFLE_STEYR_AUG_A3_556X45_ASSAULT_RIFLE_BLACK = "6718817435e3cfd9550d2c27", ASSAULTSCOPE_ELCAN_SPECTERDR_1X4X_SCOPE = "57ac965c24597706be5f975c", ASSAULTSCOPE_ELCAN_SPECTERDR_1X4X_SCOPE_FDE = "57aca93d2459771f2c7e26db", ASSAULTSCOPE_ELCAN_SPECTER_OS4X_ASSAULT_SCOPE = "544a3f024bdc2d1d388b4568", @@ -660,6 +661,10 @@ export declare enum ItemTpl { BACKPACK_VKBO_ARMY_BAG = "5ab8ee7786f7742d8f33f0b9", BACKPACK_WARTECH_BERKUT_BB102_BACKPACK_ATACS_FG = "5ca20d5986f774331e7c9602", BARREL_9A91_9X39 = "645122f6d4928d46d30be3ff", + BARREL_AA12_12GA_330MM = "66ffac601f7492c901027bbb", + BARREL_AA12_12GA_342MM_THREADED = "670fd03dc424cf758f006946", + BARREL_AA12_12GA_417MM_THREADED = "670fd0a8d8d4eae4790c8187", + BARREL_AA12_12GA_457MM = "670fced86a7e274b1a0964e8", BARREL_AI_AXMC_338_LM_28_INCH = "628121434fa03b6b6c35dc6a", BARREL_AR10_762X51_18_INCH = "5a34f7f1c4a2826c6e06d75d", BARREL_AR10_762X51_22_INCH = "5a34fae7c4a2826c6e06d760", @@ -1569,7 +1574,7 @@ export declare enum ItemTpl { FLASHHIDER_AK74_SRVV_MBR_JET_545X39_MUZZLE_BRAKE = "5cc9a96cd7f00c011c04e04a", FLASHHIDER_AK74_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_MULTICALIBER_MUZZLE_BRAKE = "5f633f791b231926f2329f13", FLASHHIDER_AKML_SYSTEM_762X39_FLASH_HIDER = "5a0d716f1526d8000d26b1e2", - FLASHHIDER_AKM_762X39_MUZZLE_BRAKECOMPENSATOR_6P1_014 = "59d64fc686f774171b243fe2", + FLASHHIDER_AKM_762X39_MUZZLE_BRAKECOMPENSATOR = "59d64fc686f774171b243fe2", FLASHHIDER_AKM_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_762X39_MUZZLE_BRAKE = "5f633f68f5750b524b45f112", FLASHHIDER_AKS74U_545X39_MUZZLE_BRAKE = "57dc324a24597759501edc20", FLASHHIDER_AK_HEXAGON_REACTOR_545X39_MUZZLE_BRAKE = "615d8f5dd92c473c770212ef", @@ -1759,6 +1764,7 @@ export declare enum ItemTpl { FOREGRIP_STARK_SE5_EXPRESS_FORWARD = "5b057b4f5acfc4771e1bd3e9", FOREGRIP_STARK_SE5_EXPRESS_FORWARD_FOREGRIP_FDE = "655df24fdf80b12750626d0a", FOREGRIP_STEYR_AUG_VERTICAL = "634e61b0767cb15c4601a877", + FOREGRIP_STEYR_AUG_VERTICAL_FOREGRIP_BLACK = "671883292e2eeb98d406f3b8", FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL = "5c791e872e2216001219c40a", FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL_FOREGRIP_FDE = "655dccfdbdcc6b5df71382b6", FOREGRIP_TACTICAL_DYNAMICS_SKELETONIZED = "5f6340d3ca442212f4047eb2", @@ -1833,7 +1839,7 @@ export declare enum ItemTpl { HANDGUARD_AKS74U_ALFA_ARMS_GOLIAF = "5d15ce51d7ad1a1eff619092", HANDGUARD_AKS74U_ALFA_ARMS_GOLIAF_MLOK = "647db1eca8d3399c380d195c", HANDGUARD_AKS74U_CAA_XRSU47SU_TACTICAL = "5a957c3fa2750c00137fa5f7", - HANDGUARD_AKS74U_WOODEN_HANDGUARD_6P26_SB6 = "57dc32dc245977596d4ef3d3", + HANDGUARD_AKS74U_WOODEN = "57dc32dc245977596d4ef3d3", HANDGUARD_AKS74U_ZENIT_B11 = "57ffa9f4245977728561e844", HANDGUARD_AK_100SERIES_POLYMER = "5cbda392ae92155f3c17c39f", HANDGUARD_AK_545_DESIGN_AGGRESSOR = "5cf4e3f3d7f00c06595bc7f0", @@ -1926,6 +1932,8 @@ export declare enum ItemTpl { HANDGUARD_HK_G36_2VENT = "62386b2adf47d66e835094b2", HANDGUARD_HK_G36_4VENT = "62386b7153757417e93a4e9f", HANDGUARD_HK_G36_6VENT = "6231654c71b5bc3baa1078e5", + HANDGUARD_HK_G36_KAC_QUAD_RAIL = "67069d66af4890b09f0006ec", + HANDGUARD_HK_G36_SLIM_LINE_HKEY = "67069d8dad91f3a63c0bc2b4", HANDGUARD_HK_MP5K_POLYMER = "5d2f259b48f0355a844acd74", HANDGUARD_HK_MP5SD_POLYMER = "5926f34786f77469195bfe92", HANDGUARD_HK_MP5_BT_TL99_ALUMINUM = "5a9548c9159bd400133e97b3", @@ -1985,7 +1993,7 @@ export declare enum ItemTpl { HANDGUARD_SOK12_CUSTOM_GUNS_TYPE340 = "6086b5731246154cad35d6c7", HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_LONG_TOP_ALUMINUM = "5827272a24597748c74bdeea", HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_SHORT_TOP_ALUMINUM = "58272b392459774b4c7b3ccd", - HANDGUARD_SOK12_POLYMER_HANDGUARD_SB71 = "576169e62459773c69055191", + HANDGUARD_SOK12_POLYMER = "576169e62459773c69055191", HANDGUARD_SR2M_POLYMER_HANDGUARD_BLACK = "637ba19df7ca6372bf2613d7", HANDGUARD_SR2M_POLYMER_HANDGUARD_PLUM = "62e15547db1a5c41971c1b5e", HANDGUARD_SR3M_POLYMER_HANDGUARD_BLACK = "65144f546ddb773afa0e35e1", @@ -2123,6 +2131,7 @@ export declare enum ItemTpl { INFO_DIARY = "590c645c86f77412b01304d9", INFO_DOCUMENTS_WITH_DECRYPTED_DATA = "660bc341c38b837877075e4c", INFO_ENCRYPTED_FLASH_DRIVE = "660bbc47c38b837877075e47", + INFO_FLASH_DRIVE_WITH_SPECIAL_SOFTWARE = "6707d13e4e617ec94f0e5631", INFO_INTELLIGENCE_FOLDER = "5c12613b86f7743bbe2c3f76", INFO_MILITARY_FLASH_DRIVE = "62a0a16d0b9d3c46de5b6e97", INFO_SAS_DRIVE = "590c37d286f77443be3d7827", @@ -2134,6 +2143,8 @@ export declare enum ItemTpl { INFO_SSD_DRIVE = "590c392f86f77444754deb29", INFO_TECH_MANUAL = "590c639286f774151567fa95", INFO_TERRAGROUP_BLUE_FOLDERS_MATERIALS = "6389c8c5dbfd5e4b95197e6b", + INFO_TGVI24_LETHAL_VACCINE = "6707d0804e617ec94f0e562f", + INFO_TGVI24_TRUE_VACCINE = "6707d0bdaab679420007e01a", INFO_TOPOGRAPHIC_SURVEY_MAPS = "62a0a124de7ac81993580542", INFO_VIDEO_CASSETTE_WITH_THE_CYBORG_KILLER_MOVIE = "62a09e974f842e1bd12da3f0", INVENTORY_DEFAULT = "55d7217a4bdc2d86028b456d", @@ -2260,6 +2271,7 @@ export declare enum ItemTpl { KEYCARD_TERRAGROUP_LABS_KEYCARD_RED = "5c1d0efb86f7744baf2e7b7b", KEYCARD_TERRAGROUP_LABS_KEYCARD_VIOLET = "5c1e495a86f7743109743dfb", KEYCARD_TERRAGROUP_LABS_KEYCARD_YELLOW = "5c1d0d6d86f7744bb2683e1f", + KEYCARD_TERRAGROUP_LABS_RESIDENTIAL_UNIT = "6711039f9e648049e50b3307", KEYCARD_TERRAGROUP_STORAGE_ROOM = "66acd6702b17692df20144c0", KEYCARD_WITH_A_BLUE_MARKING = "5efde6b4f5448336730dbd61", KEY_ABANDONED_FACTORY_MARKED = "63a3a93f8a56922e82001f5d", @@ -2467,6 +2479,7 @@ export declare enum ItemTpl { KNIFE_CULTIST = "5fc64ea372b0dd78d51159dc", KNIFE_ER_FULCRUM_BAYONET = "54491bb74bdc2d09088b4567", KNIFE_FREEMAN_CROWBAR = "5c07df7f0db834001b73588a", + KNIFE_INFECTIOUS_STRIKE = "670ad7f1ad195290cd00da7a", KNIFE_KIBA_ARMS_TACTICAL_TOMAHAWK = "57cd379a24597778e7682ecf", KNIFE_MILLER_BROS_BLADES_M2_TACTICAL_SWORD = "5bffdd7e0db834001b734a1a", KNIFE_MPL50_ENTRENCHING_TOOL = "5bead2e00db834001c062938", @@ -2543,6 +2556,8 @@ export declare enum ItemTpl { MAGAZINE_127X55_RSH12_CYL_5RND = "633ec6ee025b096d320a3b15", MAGAZINE_12G_255_CYL_5RND = "60dc519adf4c47305f6d410d", MAGAZINE_12G_590A1X8_8RND = "5e87080c81c4ed43e83cefda", + MAGAZINE_12G_AA12_20RND = "6709133fa532466d5403fb7c", + MAGAZINE_12G_AA12_8RND = "66ffaab91f7492c901027bb8", MAGAZINE_12G_M3X11_11RND = "625ff3046d721f05d93bf2ee", MAGAZINE_12G_M3X13_13RND = "625ff31daaaa8c1130599f64", MAGAZINE_12G_M3X5_5RND = "625ff2ccb8c587128c1a01dd", @@ -2570,8 +2585,8 @@ export declare enum ItemTpl { MAGAZINE_30X29_AGS30_99RND = "5d52d479a4b936793d58c76b", MAGAZINE_366TKM_6610_20RND = "587df583245977373c4f1129", MAGAZINE_366TKM_6L10_30RND = "5a01c29586f77474660c694c", + MAGAZINE_366TKM_6P2SB11_40RND = "59e5f5a486f7746c530b3ce2", MAGAZINE_366TKM_6P2_BAK_40RND = "5b1fb3e15acfc4001637f068", - MAGAZINE_366TKM_6P2_SB11_40RND = "59e5f5a486f7746c530b3ce2", MAGAZINE_366TKM_AK103_30RND = "5ac66bea5acfc43b321d4aec", MAGAZINE_366TKM_AK30_30RND = "59fafc5086f7740dbe19f6c3", MAGAZINE_366TKM_AK30_FDE_30RND = "59fafc9386f774067d462453", @@ -2597,8 +2612,10 @@ export declare enum ItemTpl { MAGAZINE_45ACP_MECGAR_11RND = "5ef3448ab37dfd6af863525c", MAGAZINE_45ACP_UMP_45_25RND = "5fc3e466187fea44d52eda90", MAGAZINE_45ACP_USP45T_12RND = "6193d3149fb0c665d5490e32", + MAGAZINE_45ACP_USP45T_999RND = "671d8b8c0959c721a50ca838", MAGAZINE_45ACP_USP45_12RND = "6193d338de3cdf1d2614a6fc", MAGAZINE_45ACP_WILSON_7RND = "5f3e77b26cda304dcc634057", + MAGAZINE_45ACP_WILSON_999RND = "671d8b38b769f0d88c0950f8", MAGAZINE_46X30_MP7_20RND = "5ba264f6d4351e0034777d52", MAGAZINE_46X30_MP7_30RND = "5ba2657ed4351e0035628ff2", MAGAZINE_46X30_MP7_40RND = "5ba26586d4351e44f824b340", @@ -2644,6 +2661,7 @@ export declare enum ItemTpl { MAGAZINE_762X25TT_PPSH_35RND = "5ea034eb5aad6446a939737b", MAGAZINE_762X25TT_PPSH_71RND = "5ea034f65aad6446a939737e", MAGAZINE_762X25TT_TT105_8RND = "571a29dc2459771fb2755a6a", + MAGAZINE_762X25TT_TT105_999RND = "671d85439ae8365d69117ba6", MAGAZINE_762X39_BUBEN_100RND = "6513f0a194c72326990a3868", MAGAZINE_762X51_417_762_10RND = "617130016c780c1e710c9a24", MAGAZINE_762X51_417_762_20RND = "617131a4568c120fdd29482d", @@ -2692,6 +2710,7 @@ export declare enum ItemTpl { MAGAZINE_86X70_MK18_10RND = "5fc23426900b1d5091531e15", MAGAZINE_9X18PM_APS_20RND = "5a17fb03fcdbcbcae668728f", MAGAZINE_9X18PM_PM_8RND = "5448c12b4bdc2d02308b456f", + MAGAZINE_9X18PM_PM_999RND = "670e8eab8c1bb0e5a7075acf", MAGAZINE_9X18PM_PM_DRUM_84RND = "55d485be4bdc2d962f8b456f", MAGAZINE_9X18PM_PP91_20RND = "57d14e1724597714010c3f4b", MAGAZINE_9X18PM_PP91_30RND = "57d1519e24597714373db79d", @@ -2700,11 +2719,13 @@ export declare enum ItemTpl { MAGAZINE_9X19_BIG_STICK_33RND = "5a7ad2e851dfba0016153692", MAGAZINE_9X19_CR_CYL_6RND = "624c3074dbbd335e8e6becf3", MAGAZINE_9X19_G19X_19RND = "63076701a987397c0816d21b", + MAGAZINE_9X19_G19X_999RND = "671d8ac8a3e45c1f59082799", MAGAZINE_9X19_GL9_21RND = "5a718da68dc32e000d46d264", MAGAZINE_9X19_GLOCK_9X19_17RND = "5a718b548dc32e000d46d262", MAGAZINE_9X19_G_SGMT_50RND = "5a718f958dc32e00094b97e7", MAGAZINE_9X19_M9A3_17RND = "5cadc2e0ae9215051e1c21e7", MAGAZINE_9X19_MP443_18RND = "576a5ed62459771e9c2096cb", + MAGAZINE_9X19_MP443_999RND = "671d8617a3e45c1f5908278c", MAGAZINE_9X19_MP5_20RND = "5d2f213448f0355009199284", MAGAZINE_9X19_MP5_30RND = "5926c3b286f774640d189b6b", MAGAZINE_9X19_MP9_15RND = "5de8e8dafd6b4e6e2276dc32", @@ -2777,16 +2798,17 @@ export declare enum ItemTpl { MONEY_EUROS = "569668774bdc2da2298b4568", MONEY_GP_COIN = "5d235b4d86f7742e017bc88a", MONEY_ROUBLES = "5449016a4bdc2d6f028b456f", - MOUNT_AIMPOINT_LRP_MOUNT_FOR_COMPM4_SIGHTS = "5c7d55f52e221644f31bff6a", + MOUNT_AIMPOINT_COMPM4PRO_LRP = "5c7d55f52e221644f31bff6a", + MOUNT_AIMPOINT_COMPM4PRO_QRP2 = "616584766ef05c2ce828ef57", MOUNT_AIMPOINT_MICRO_H2_STANDARD = "616554fe50224f204c1da2aa", MOUNT_AIMPOINT_MICRO_SPACER_HIGH = "58d39b0386f77443380bf13c", MOUNT_AIMPOINT_MICRO_STANDARD = "58d39d3d86f77445bb794ae7", - MOUNT_AIMPOINT_QRP2_MOUNT_FOR_COMPM4PRO_SIGHTS = "616584766ef05c2ce828ef57", MOUNT_AIMPOINT_STANDARD_SPACER = "5c7d560b2e22160bc12c6139", MOUNT_AI_AX50_34MM_SCOPE = "62811f461d5df4475f46a332", MOUNT_AI_AXMC_ADAPTER_KIT_MEDIUM_LENGTH_RAIL = "628120dd308cb521f87a8fa1", MOUNT_AI_AXMC_ADAPTER_KIT_SHORT_LENGTH_RAIL = "628120d309427b40ab14e76d", MOUNT_AI_AXMC_AT_X_TOP_RAIL = "628120c21d5df4475f46a337", + MOUNT_AI_AXMC_KEYSLOT_HARRIS_BIPOD = "671126a210d67adb5b08e925", MOUNT_AKS74U_ZENIT_B18 = "57ffb0062459777a045af529", MOUNT_AK_ZENIT_B12 = "57ffaea724597779f52b3a4d", MOUNT_ALEXANDER_ARMS_10_INCH_RAIL = "5b30bc285acfc47a8608615d", @@ -2801,6 +2823,8 @@ export declare enum ItemTpl { MOUNT_BURRIS_FASTFIRE_WEAVER_BASE = "577d128124597739d65d0e56", MOUNT_CNC_GUNS_KEYMOD_2_INCH_RAIL = "623c2f652febb22c2777d8d7", MOUNT_CNC_GUNS_KEYMOD_4_INCH_RAIL = "623c2f4242aee3103f1c44b7", + MOUNT_CORVUS_DEFENSIO_KEYMOD_18_INCH_RAIL_SECTION = "67111094d1758189fc0bd223", + MOUNT_CORVUS_DEFENSIO_KEYMOD_68_INCH_RAIL_SECTION = "6711109e723c2733410161eb", MOUNT_CUSTOM_GUNS_HANDGUARD_RAIL = "6086b5392535c57a13424d70", MOUNT_DANIEL_DEFENSE_25MM_ACCESSORY_RING = "6267c6396b642f77f56f5c1c", MOUNT_DELTAPOINT_CROSS_SLOT_MOUNT_BASE = "58d2664f86f7747fec5834f6", @@ -2812,8 +2836,21 @@ export declare enum ItemTpl { MOUNT_FN_P90_UPPER_RECEIVER_TOP_RAIL = "5cc7015ae4a949001152b4c6", MOUNT_FN_SCAR_BOTTOM_RAIL = "61816df1d3a39d50044c139e", MOUNT_FN_SCAR_KINETIC_MREX_65_MLOK_RAIL = "619666f4af1f5202c57a952d", + MOUNT_FN_SCAR_KINETIC_MREX_65_MLOK_RAIL_FDE = "66ffc6ceb7ff397142017c3a", + MOUNT_FN_SCAR_PMM_MLOK_LOWER_RAIL = "66ffc72082d36dec82030c1f", + MOUNT_FN_SCAR_PMM_MLOK_LOWER_RAIL_FDE = "66ffc903fe9b382596065304", + MOUNT_FN_SCAR_PMM_MLOK_SIDE_RAILS = "66ffe6c36f11538c7d0581e3", + MOUNT_FN_SCAR_PMM_MLOK_SIDE_RAILS_FDE = "66ffe7bab8da88805e07a03e", + MOUNT_FN_SCAR_PMM_MRE_XL_RAIL_EXTENSION = "66ffe2fbab3336cc0106382b", + MOUNT_FN_SCAR_PMM_MRE_XL_RAIL_EXTENSION_FDE = "66ffe5edfe9b38259606530d", + MOUNT_FN_SCAR_PMM_RAIL_ELIMINATION_PANELS = "66ffe66a20771d839f0fb4a9", + MOUNT_FN_SCAR_PMM_RAIL_ELIMINATION_PANELS_FDE = "66ffe6916f11538c7d0581e1", MOUNT_FN_SCAR_PWS_SRX_RAIL_EXTENSION = "61965d9058ef8c428c287e0d", - MOUNT_FN_SCAR_SIDE_RAIL = "61816dfa6ef05c2ce828f1ad", + MOUNT_FN_SCAR_SIDE_RAILS = "61816dfa6ef05c2ce828f1ad", + MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD = "66ffe811f5d758d71101e89a", + MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_EXTENDER = "66ffea456be19fd81e0ef742", + MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_EXTENDER_PATRIOT_BROWN = "66ffeab4ab3336cc01063833", + MOUNT_FN_SCAR_VLTOR_CASVSCAR_HANDGUARD_PATRIOT_BROWN = "66ffea06132225f0fe061394", MOUNT_GBRS_AIMPOINT_HYDRA_MOUNT_KIT_BLACK = "65392f611406374f82152ba5", MOUNT_GBRS_AIMPOINT_HYDRA_MOUNT_KIT_FDE = "653931da5db71d30ab1d6296", MOUNT_GEISSELE_SUPER_PRECISION_30MM_RING_SCOPE = "618b9643526131765025ab35", @@ -2835,6 +2872,7 @@ export declare enum ItemTpl { MOUNT_HK_G36_SIDE_HANDGUARD_RAIL = "62444cd3674028188b052799", MOUNT_HK_G36_SIGHT = "622b3c081b89c677a33bcda6", MOUNT_HK_G36_STANAG_MAGWELL = "622f039199f4ea1a4d6c9a17", + MOUNT_HK_HKEY_3_INCH_RAIL = "67069d3bb29a2cd338033390", MOUNT_HK_MP5SD_BT_TRIRAIL_RING = "59c63b4486f7747afb151c1c", MOUNT_HK_MP5_BT_TRIRAIL_RECEIVER = "5a966ec8a2750c00171b3f36", MOUNT_HK_MP5_MFI_HK_UNIVERSAL_LOW_PROFILE_SCOPE = "5926dad986f7741f82604363", @@ -2856,6 +2894,7 @@ export declare enum ItemTpl { MOUNT_KRISS_VECTOR_SIDE_RAIL = "5fce0f9b55375d18a253eff2", MOUNT_LARUE_LT101_QD_TACTICAL_PICATINNY_RISER = "5c064c400db834001d23f468", MOUNT_LEAPERS_UTG_25MM_RING_SCOPE = "5dff77c759400025ea5150cf", + MOUNT_LEAPERS_UTG_UNIVERSAL_SHOTGUN_BARREL = "6710cea62bb09af72f0e6bf8", MOUNT_LOBAEV_ARMS_30MM_SCOPE = "57c69dd424597774c03b7bbc", MOUNT_M14_AMEGA_MINI_SCOUT_MOUNT_SYSTEM = "5addbfd15acfc40015621bde", MOUNT_M14_ARMS_18_SCOPE = "5addbfe15acfc4001a5fc58b", @@ -2877,6 +2916,7 @@ export declare enum ItemTpl { MOUNT_MAGPUL_MLOK_093_INCH_RAIL = "669a6a4a525be1d2d004b8eb", MOUNT_MAGPUL_MLOK_25_INCH_RAIL = "5b7be47f5acfc400170e2dd2", MOUNT_MAGPUL_MLOK_41_INCH_RAIL = "5b7be4895acfc400170e2dd5", + MOUNT_MAGPUL_MLOK_BIPOD = "671126b049e181972e0681fa", MOUNT_MAGPUL_MLOK_CANTILEVER = "6269220d70b6c02e665f2635", MOUNT_MAGPUL_MLOK_OFFSET_LIGHT = "6269545d0e57f218e4548ca2", MOUNT_MOSIN_RIFLE_AIM_SPORTS_MNG_RAIL = "5bc5a372d4351e44f824d17f", @@ -2899,6 +2939,7 @@ export declare enum ItemTpl { MOUNT_NIGHTFORCE_MAGMOUNT_34MM_RING_SCOPE_MOUNT_WITH_RUGGEDIZED_ACCESSORY_PLATFORM = "5aa66c72e5b5b00016327c93", MOUNT_NOROTOS_TITANIUM_ADVANCED_TACTICAL = "5a16b8a9fcdbcb00165aa6ca", MOUNT_NPZ_1P781_DOVETAIL = "618a75c9a3884f56c957ca1b", + MOUNT_ODIN_WORKS_KPOD_KEYMOD_BIPOD_ADAPTER = "67112695fe5c8bf33f02476d", MOUNT_OPSCORE_PICATINNY_RAIL_ADAPTER = "5a398b75c4a282000a51a266", MOUNT_OPSCORE_SINGLE_CLAMP_RAIL_ADAPTER = "5a398ab9c4a282000c5a9842", MOUNT_OPSKS_DOVETAIL = "587e08ee245977446b4410cf", @@ -2943,8 +2984,14 @@ export declare enum ItemTpl { MOUNT_SR2M_SHORT_SIDE_RAIL = "62ed189fb3608410ef5a2bfc", MOUNT_SR2M_SIDE_RAIL = "62ed1921b3608410ef5a2c04", MOUNT_SR2M_ZENIT_B17 = "62e281349ecd3f493f6df954", + MOUNT_SR3MP_DOVETAIL_SIDE_RAIL_BLACK = "67069c8cee8138ed2f05ad34", + MOUNT_SR3MP_DOVETAIL_SIDE_RAIL_PLUM = "67069cbbb29a2cd33803338c", + MOUNT_SR3MP_SIDE_RAILS_BLACK = "67069cf1af4890b09f0006e8", + MOUNT_SR3MP_SIDE_RAILS_PLUM = "67069d02ad91f3a63c0bc2b0", + MOUNT_STEYR_AUG_A3_CORVUS_DEFENSIO_RECEIVER_RAIL_MOI_30_SLOTS = "67110dd41ad01bb88705347b", MOUNT_STEYR_AUG_A3_M1_HIGH_SIGHT = "62e7c8f91cd3fde4d503d690", MOUNT_STEYR_AUG_A3_M1_LOW_SIGHT = "62ebba1fb658e07ef9082b5a", + MOUNT_STEYR_AUG_CORVUS_DEFENSIO_KEYMOD_FORWARD_ACCESSORY_RAIL = "6711107e1ad01bb88705347e", MOUNT_STRIKE_INDUSTRIES_KEYMOD_4_INCH_RAIL = "5a9d6d00a2750c5c985b5305", MOUNT_STRIKE_INDUSTRIES_KEYMOD_6_INCH_RAIL = "5a9d6d13a2750c00164f6b03", MOUNT_STRIKE_INDUSTRIES_TRAX_BRIDGE_RAIL = "5a9d6d21a2750c00137fa649", @@ -2985,6 +3032,8 @@ export declare enum ItemTpl { MOUNT_ZENIT_KR2_OLD_GEN = "646f6322f43d0c5d62063715", MULTITOOLS_LEATHERMAN_MULTITOOL = "544fb5454bdc2df8738b456a", MUZZLECOMBO_9A91_HANDGUARD_RETAINER = "64527a263d52156624001fd7", + MUZZLECOMBO_AA12_12GA_CHOKE = "670fd1cc95c92bfc8e0bea39", + MUZZLECOMBO_AA12_THREAD_PROTECTOR = "670fd0eed8d4eae4790c818a", MUZZLECOMBO_AI_AXMC_THREAD_PROTECTION_CAP = "628120621d5df4475f46a335", MUZZLECOMBO_AKM_762X39_KIBA_ARMS_308_MUZZLE_DEVICE_ADAPTER = "615d8e9867085e45ef1409c6", MUZZLECOMBO_AK_762X39_TAKTIKA_TULA_MUZZLE_ADAPTER = "5a0abb6e1526d8000a025282", @@ -3256,6 +3305,7 @@ export declare enum ItemTpl { QUEST_HDD_WET_JOB = "5a29276886f77435ed1b117c", QUEST_HOUSING_JOURNAL = "638e0057ab150a5f56238960", QUEST_IDEA_CARGO_MANIFESTS = "5ae9a1b886f77404c8537c62", + QUEST_INFECTED_BLOOD_SAMPLE = "6707cc67cc1667e49e0f7232", QUEST_INFORMANT_JOURNAL = "63989ced706b793c7d60cfef", QUEST_JOURNAL = "64f07f7726cfa02c506f8ac0", QUEST_KEY_TO_THE_CLOSED_PREMISES_OF_THE_HEALTH_RESORT = "5a0448bc86f774736f14efa8", @@ -3317,18 +3367,23 @@ export declare enum ItemTpl { QUEST_SKIER_AND_PEACEKEEPER_CORRESPONDENCE = "6614238e0d240a5f5d0f679d", QUEST_SLIDERKEY_SECURE_FLASH_DRIVE = "590c62a386f77412b0130255", QUEST_STOLEN_MILITARY_DOCUMENTS = "61a00bcb177fb945751bbe6a", + QUEST_STOLEN_WEAPON_CASE = "671a406a6d315b526708f103", QUEST_SURGERY_KIT_MARKED_WITH_A_BLUE_SYMBOL = "5efdafc1e70b5e33f86de058", QUEST_SYRINGE_WITH_A_CHEMICAL = "593a87af86f774122f54a951", QUEST_T90M_COMMANDER_CONTROL_PANEL = "609267a2bb3f46069c3e6c7d", QUEST_TARKOV_CITY_SOUVENIR_KEY = "66687bc89111279d600b5062", + QUEST_TGVI24_SAMPLE = "6707cd70aab679420007e018", QUEST_TOUGHBOOK_CARGO = "5a29284f86f77463ef3db363", QUEST_TOUGHBOOK_SEASIDE_VACATION = "619252352be33f26043400a7", + QUEST_TRUE_VACCINE_RECIPE = "6707d1f9571b50abc703b651", QUEST_UAV_SAS_DISK_1 = "5a294d7c86f7740651337cf9", QUEST_UAV_SAS_DISK_2 = "5a294d8486f774068638cd93", QUEST_UNHEARD_LAPTOP = "661421c7c1f2f548c50ee649", QUEST_UNHEARD_LAPTOP_2 = "661423200d240a5f5d0f679b", QUEST_UNHEARD_PHONE = "6614217b6d9d5abcad0ff098", QUEST_UNHEARD_PHONE_2 = "6614230055afee107f05e998", + QUEST_VACCINE_SAMPLE_IV = "6707cf827d279daad80fa95f", + QUEST_VO_SIGNED_DIARY = "6707cef3571b50abc703b64f", QUEST_WATCH_BRONZE = "5937fd0086f7742bf33fc198", QUEST_WATCH_GOLD = "590de92486f77423d9312a33", QUEST_WATCH_SILVER = "5937fc6786f7742cab753590", @@ -3497,10 +3552,11 @@ export declare enum ItemTpl { RECEIVER_SA58_EXTREME_DUTY_DUST_COVER = "5b099bb25acfc400186331e8", RECEIVER_SKS_DUST_COVER = "634f05ca517ccc8a960fc748", RECEIVER_SKS_LEAPERS_UTG_PRO_MTU017_RECEIVER_COVER_MOUNT = "6415c694da439c6a97048b56", - RECEIVER_SOK12_DUST_COVER_SB02 = "57616c112459773cce774d66", + RECEIVER_SOK12_DUST_COVER = "57616c112459773cce774d66", RECEIVER_SR25_762X51_UPPER = "5df8e4080b92095fd441e594", RECEIVER_SR2M_DUST_COVER = "62e27a7865f0b1592a49e17b", RECEIVER_STEYR_AUG_A3_556X45 = "62e7c72df68e7a0676050c77", + RECEIVER_STEYR_AUG_A3_VLTOR_556X45 = "67110d8d388bded67304ceb4", RECEIVER_STM9_9X19_UPPER = "602e63fb6335467b0c5ac94d", RECEIVER_SVDS_CUSTOM_CUT_DUST_COVER = "5dfce88fe9dc277128008b2e", RECEIVER_SVDS_DUST_COVER = "5c471bd12e221602b4129c3a", @@ -3534,6 +3590,8 @@ export declare enum ItemTpl { SHOTGUN_MP18_762X54R_SINGLESHOT_RIFLE = "61f7c9e189e6fb1a5e3ea78d", SHOTGUN_MP431C_12GA_DOUBLEBARREL = "5580223e4bdc2d1c128b457f", SHOTGUN_MP43_12GA_SAWEDOFF_DOUBLEBARREL = "64748cb8de82c85eaf0a273a", + SHOTGUN_MPS_AUTO_ASSAULT12_GEN_1_12GA_AUTOMATIC = "66ffa9b66e19cc902401c5e8", + SHOTGUN_MPS_AUTO_ASSAULT12_GEN_2_12GA_AUTOMATIC = "67124dcfa3541f2a1f0e788b", SHOTGUN_REMINGTON_MODEL_870_12GA_PUMPACTION = "5a7828548dc32e5a9c28b516", SHOTGUN_SAIGA12K_VER10_12GA_SEMIAUTOMATIC = "576165642459773c7a400233", SHOTGUN_TOZ106_20GA_BOLTACTION = "5a38e6bac4a2826c6e06d79b", @@ -3684,6 +3742,9 @@ export declare enum ItemTpl { STIM_XTG12_ANTIDOTE_INJECTOR = "5fca138c2a7b221b2852a5c6", STIM_ZAGUSTIN_HEMOSTATIC_DRUG_INJECTOR = "5c0e533786f7747fa23f4d47", STOCK_9A91_TOPFOLDING = "6451167ad4928d46d30be3fd", + STOCK_AA12_STOCK_ASSEMBLY = "66ffac9e316b08f6840a73e6", + STOCK_AA12_STOCK_ASSEMBLY_FDE = "670fd23798663bc4b10e911a", + STOCK_AA12_STOCK_ASSEMBLY_TERRAGROUP = "6719023b612cc94b9008e78c", STOCK_AI_AXMC_AX_BUTT = "62811f828193841aca4a45c3", STOCK_AI_AXMC_GTAC_ARTYPE_PISTOL_GRIP_ADAPTER = "62811e335631d45211793c95", STOCK_AI_AXMC_PISTOL_GRIP = "62811e2510e26c1f344e6554", @@ -3782,17 +3843,26 @@ export declare enum ItemTpl { STOCK_FN_SCAR_CHEEK_REST_FDE = "61825d24d3a39d50044c13af", STOCK_FN_SCAR_FOLDING_POLYMER = "61816734d8e3106d9806c1f3", STOCK_FN_SCAR_FOLDING_POLYMER_STOCK_FDE = "61825d06d92c473c770215de", + STOCK_FN_SCAR_JMAC_CUSTOMS_RSASCAR_1913_ADAPTER = "66ffc246a81a4f85e70d4d06", STOCK_FN_SCAR_RETRACTABLE_POLYMER = "618167528004cc50514c34f9", STOCK_FN_SCAR_RETRACTABLE_POLYMER_STOCK_FDE = "61825d136ef05c2ce828f1cc", STOCK_FN_SCAR_RUBBER_BUTTPAD = "618167616ef05c2ce828f1a8", + STOCK_FN_SCAR_VLTOR_RESCAR_STOCK_ADAPTER = "66ffbfb1a73a7bce3d0b45a8", + STOCK_FN_SCAR_VLTOR_RESCAR_STOCK_ADAPTER_PATRIOT_BROWN = "66ffc20ba73a7bce3d0b45ab", + STOCK_FN_SCAR_VLTOR_VSS11_POLYMER = "66ffc2bd132225f0fe0611d8", + STOCK_FN_SCAR_VLTOR_VSS11_POLYMER_STOCK_PATRIOT_BROWN = "66ffc2ecfe9b3825960652f7", STOCK_GLOCK_FAB_DEFENSE_GLR17 = "5d1c702ad7ad1a632267f429", STOCK_HK417_ADJUSTABLE_BUTT = "617155ee50224f204c1da3cd", STOCK_HK417_E2_BUTT = "617154aa1cb55961fa0fdb3b", STOCK_HK_ADJUSTABLE_BUTTSTOCK_CHEEK_REST = "61715e7e67085e45ef140b33", STOCK_HK_ENHANCED_TUBE_BUFFER_TUBE = "5bb20e58d4351e00320205d7", STOCK_HK_G28_BUFFER_TUBE = "617153016c780c1e710c9a2f", + STOCK_HK_G36_IDZ_ADJUSTABLE = "67110d06723c2733410161e8", + STOCK_HK_G36_IDZ_CONCAVE_BUTTPAD = "67110d6fa71d1f123d021cd3", + STOCK_HK_G36_IDZ_CONVEX_BUTTPAD = "67110d5ed1758189fc0bd221", STOCK_HK_G36_KV_ADJUSTABLE = "622f14e899892a7f9e08f6c5", STOCK_HK_G36_POLYMER = "622f140da5958f63c67f1735", + STOCK_HK_G36_TOMMY_BUILT_AR_STOCK_ADAPTER = "6706a159c67236b2f703bb95", STOCK_HK_MP5K_END_CAP = "5d2f25bc48f03502573e5d85", STOCK_HK_MP5_A2 = "5926d3c686f77410de68ebc8", STOCK_HK_MP5_A3_OLD_MODEL = "5926d40686f7740f152b6b7e", diff --git a/types/models/enums/Weapons.d.ts b/types/models/enums/Weapons.d.ts index ff0ca8eb..d88d7426 100644 --- a/types/models/enums/Weapons.d.ts +++ b/types/models/enums/Weapons.d.ts @@ -27,6 +27,7 @@ export declare enum Weapons { ASSAULTRIFLE_556X45_AK_102 = "5ac66d015acfc400180ae6e4", ASSAULTRIFLE_556X45_AUG_A1 = "62e7c4fba689e8c9c50dfc38", ASSAULTRIFLE_556X45_AUG_A3 = "63171672192e68c5460cebc5", + ASSAULTRIFLE_556X45_AUG_A3_BLACK = "6718817435e3cfd9550d2c27", ASSAULTRIFLE_556X45_G36 = "623063e994fc3f7b302a9696", ASSAULTRIFLE_556X45_HK_416A5 = "5bb2475ed4351e00853264e3", ASSAULTRIFLE_556X45_M4A1 = "5447a9cd4bdc2dbd208b4567", @@ -110,6 +111,8 @@ export declare enum Weapons { REVOLVER_9X19_CR_200DS = "624c2e8614da335f1e034d8c", REVOLVER_9X33R_CR_50DS = "61a4c8884f95bc3b2c5dc96f", SHOTGUN_12G_590A1 = "5e870397991fd70db46995c8", + SHOTGUN_12G_AA_12_GEN_1 = "66ffa9b66e19cc902401c5e8", + SHOTGUN_12G_AA_12_GEN_2 = "67124dcfa3541f2a1f0e788b", SHOTGUN_12G_M3_SUPER_90 = "6259b864ebedf17603599e88", SHOTGUN_12G_M870 = "5a7828548dc32e5a9c28b516", SHOTGUN_12G_MP_133 = "54491c4f4bdc2db1078b4568", diff --git a/types/models/spt/callbacks/IDataCallbacks.d.ts b/types/models/spt/callbacks/IDataCallbacks.d.ts deleted file mode 100644 index cd0adabf..00000000 --- a/types/models/spt/callbacks/IDataCallbacks.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; -import { IGlobals } from "@spt/models/eft/common/IGlobals"; -import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; -import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; -import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; -import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; -export interface IDataCallbacks { - getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string; - getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; - getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string; -} diff --git a/types/models/spt/config/ICoreConfig.d.ts b/types/models/spt/config/ICoreConfig.d.ts index d35cc7d9..aedba0cb 100644 --- a/types/models/spt/config/ICoreConfig.d.ts +++ b/types/models/spt/config/ICoreConfig.d.ts @@ -57,6 +57,8 @@ export interface IGameFixes { fixShotgunDispersion: boolean; /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; + /** Remove invalid traders from profile - trader data can be leftover when player removes trader mod */ + removeInvalidTradersFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; } diff --git a/types/models/spt/config/IHideoutConfig.d.ts b/types/models/spt/config/IHideoutConfig.d.ts index 52577772..a2483a9e 100644 --- a/types/models/spt/config/IHideoutConfig.d.ts +++ b/types/models/spt/config/IHideoutConfig.d.ts @@ -18,11 +18,21 @@ export interface ICultistCircleSettings { maxRewardItemCount: number; maxAttemptsToPickRewardsWithinBudget: number; rewardPriceMultiplerMinMax: MinMax; + /** The odds that meeting the highest threshold gives you a bonus to crafting time */ + bonusAmountMultiplier: number; + bonusChanceMultiplier: number; + /** What is considered a "high-value" item */ + highValueThresholdRub: number; + /** Hideout/task reward crafts have a unique craft time */ + hideoutTaskRewardTimeSeconds: number; + /** Rouble amount player needs to sacrifice to get chance of hideout/task rewards */ + hideoutCraftSacrificeThresholdRub: number; craftTimeThreshholds: ICraftTimeThreshhold[]; - /** -1 means no override */ + /** -1 means no override, value in seconds */ craftTimeOverride: number; - /** Specific reward pool when player sacrificed one specific item */ - directRewards: Record; + /** Specific reward pool when player sacrifice specific item(s) */ + directRewards: IDirectRewardSettings[]; + /** Overrides for reward stack sizes, keyed by item tpl */ directRewardStackSize: Record; /** Item tpls to exclude from the reward pool */ rewardItemBlacklist: string[]; @@ -34,6 +44,9 @@ export interface ICraftTimeThreshhold extends MinMax { craftTimeSeconds: number; } export interface IDirectRewardSettings { - rewardTpls: string[]; + reward: string[]; + requiredItems: string[]; craftTimeSeconds: number; + /** Is the reward a one time reward or can it be given multiple times */ + repeatable: boolean; } diff --git a/types/models/spt/config/ITraderConfig.d.ts b/types/models/spt/config/ITraderConfig.d.ts index 5d2d4a68..2835a0d2 100644 --- a/types/models/spt/config/ITraderConfig.d.ts +++ b/types/models/spt/config/ITraderConfig.d.ts @@ -4,10 +4,10 @@ import { ILootRequest } from "@spt/models/spt/services/ILootRequest"; export interface ITraderConfig extends IBaseConfig { kind: "spt-trader"; updateTime: IUpdateTime[]; + updateTimeDefault: number; purchasesAreFoundInRaid: boolean; /** Should trader reset times be set based on server start time (false = bsg time - on the hour) */ tradersResetFromServerStart: boolean; - updateTimeDefault: number; traderPriceMultipler: number; fence: IFenceConfig; moddedTraders: IModdedTraders; diff --git a/types/models/spt/hideout/IHideout.d.ts b/types/models/spt/hideout/IHideout.d.ts index e93f7487..40f2d9ba 100644 --- a/types/models/spt/hideout/IHideout.d.ts +++ b/types/models/spt/hideout/IHideout.d.ts @@ -1,12 +1,10 @@ import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutProductionData } from "@spt/models/eft/hideout/IHideoutProduction"; -import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IQteData } from "@spt/models/eft/hideout/IQteData"; export interface IHideout { areas: IHideoutArea[]; production: IHideoutProductionData; - scavcase: IHideoutScavCase[]; settings: IHideoutSettingsBase; qte: IQteData[]; } diff --git a/types/servers/HttpServer.d.ts b/types/servers/HttpServer.d.ts index e54d4a80..c01b30ca 100644 --- a/types/servers/HttpServer.d.ts +++ b/types/servers/HttpServer.d.ts @@ -4,13 +4,11 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { WebSocketServer } from "@spt/servers/WebSocketServer"; import { IHttpListener } from "@spt/servers/http/IHttpListener"; import { LocalisationService } from "@spt/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; - protected databaseServer: DatabaseServer; protected httpServerHelper: HttpServerHelper; protected localisationService: LocalisationService; protected httpListeners: IHttpListener[]; @@ -19,7 +17,7 @@ export declare class HttpServer { protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; protected started: boolean; - constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); + constructor(logger: ILogger, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ diff --git a/types/services/CircleOfCultistService.d.ts b/types/services/CircleOfCultistService.d.ts index e4d34108..8e946397 100644 --- a/types/services/CircleOfCultistService.d.ts +++ b/types/services/CircleOfCultistService.d.ts @@ -3,14 +3,15 @@ import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { QuestHelper } from "@spt/helpers/QuestHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotHideoutArea } from "@spt/models/eft/common/tables/IBotBase"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IStageRequirement } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; -import { IHideoutProduction, IHideoutProductionData, IRequirement, IRequirementBase } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IRequirement, IRequirementBase } from "@spt/models/eft/hideout/IHideoutProduction"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IDirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { ICraftTimeThreshhold, ICultistCircleSettings, IDirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -33,13 +34,14 @@ export declare class CircleOfCultistService { protected profileHelper: ProfileHelper; protected inventoryHelper: InventoryHelper; protected hideoutHelper: HideoutHelper; + protected questHelper: QuestHelper; protected databaseService: DatabaseService; protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected static circleOfCultistSlotId: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, cloner: ICloner, eventOutputHolder: EventOutputHolder, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, hideoutHelper: HideoutHelper, databaseService: DatabaseService, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, cloner: ICloner, eventOutputHolder: EventOutputHolder, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, hideoutHelper: HideoutHelper, questHelper: QuestHelper, databaseService: DatabaseService, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Start a sacrifice event * Generate rewards @@ -50,24 +52,38 @@ export declare class CircleOfCultistService { * @returns IItemEventRouterResponse */ startSacrifice(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse; + /** + * Create a map of the possible direct rewards, keyed by the items needed to be sacrificed + * @param directRewards Direct rewards array from hideout config + * @returns Map + */ + protected generateSacrificedItemsCache(directRewards: IDirectRewardSettings[]): Map; + /** + * Get the reward amount multiple value based on players hideout management skill + configs rewardPriceMultiplerMinMax values + * @param pmcData Player profile + * @param cultistCircleSettings Circle config settings + * @returns Reward Amount Multipler + */ + protected getRewardAmountMultipler(pmcData: IPmcData, cultistCircleSettings: ICultistCircleSettings): number; /** * Register production inside player profile * @param sessionId Session id * @param pmcData Player profile * @param recipeId Recipe id * @param sacrificedItems Items player sacrificed - * @param rewardAmountRoubles Rouble amount to reward player in items with - * @param directRewardSettings OPTIONAL: If craft is giving direct rewards + * @param craftingTime How long the ritual should take */ - protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: IItem[], rewardAmountRoubles: number, directRewardSettings?: IDirectRewardSettings): void; + protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: IItem[], craftingTime: number): void; /** * Get the circle craft time as seconds, value is based on reward item value - * OR rewards are direct, then use custom craft time defined in oarameter object + * And get the bonus status to determine what tier of reward is given * @param rewardAmountRoubles Value of rewards in roubles - * @param directRewardSettings OPTIONAL: If craft is giving direct rewards - * @returns craft time seconds + * @param circleConfig Circle config values + * @param directRewardSettings OPTIONAL - Values related to direct reward being given + * @returns craft time + type of reward + reward details */ - protected getCircleCraftTimeSeconds(rewardAmountRoubles: number, directRewardSettings?: IDirectRewardSettings): number; + protected getCircleCraftingInfo(rewardAmountRoubles: number, circleConfig: ICultistCircleSettings, directRewardSettings?: IDirectRewardSettings): ICraftDetails; + protected getMatchingThreshold(thresholds: ICraftTimeThreshhold[], rewardAmountRoubles: number): ICraftTimeThreshhold; /** * Get the items player sacrificed in circle * @param pmcData Player profile @@ -81,20 +97,40 @@ export declare class CircleOfCultistService { * @param cultistCircleStashId Id of stash item * @returns Array of item arrays */ - protected getRewardsWithinBudget(rewardItemTplPool: string[], rewardBudget: number, cultistCircleStashId: string): IItem[][]; + protected getRewardsWithinBudget(rewardItemTplPool: string[], rewardBudget: number, cultistCircleStashId: string, circleConfig: ICultistCircleSettings): IItem[][]; /** - * Give every item as a reward that's passed in - * @param rewardTpls Item tpls to turn into reward items + * Get direct rewards + * @param sessionId sessionId + * @param directReward Items sacrificed * @param cultistCircleStashId Id of stash item - * @returns Array of item arrays + * @returns The reward object + */ + protected getDirectRewards(sessionId: string, directReward: IDirectRewardSettings, cultistCircleStashId: string): IItem[][]; + /** + * Check for direct rewards from what player sacrificed + * @param sessionId sessionId + * @param sacrificedItems Items sacrificed + * @returns Direct reward items to send to player */ - protected getExplicitRewards(explicitRewardSettings: IDirectRewardSettings, cultistCircleStashId: string): IItem[][]; + protected checkForDirectReward(sessionId: string, sacrificedItems: IItem[], directRewardsCache: Map): IDirectRewardSettings; + /** + * Create an md5 key of the sacrificed + reward items + * @param directReward Direct reward to create key for + * @returns Key + */ + protected getDirectRewardHashKey(directReward: IDirectRewardSettings): string; /** * Explicit rewards have thier own stack sizes as they dont use a reward rouble pool * @param rewardTpl Item being rewarded to get stack size of * @returns stack size of item */ - protected getExplicitRewardBaseTypeStackSize(rewardTpl: string): number; + protected getDirectRewardBaseTypeStackSize(rewardTpl: string): number; + /** + * Add a record to the players profile to signal they have accepted a non-repeatable direct reward + * @param sessionId Session id + * @param directReward Reward sent to player + */ + protected flagDirectRewardAsAcceptedInProfile(sessionId: string, directReward: IDirectRewardSettings): void; /** * Get the size of a reward items stack * 1 for everything except ammo, ammo can be between min stack and max stack @@ -107,9 +143,11 @@ export declare class CircleOfCultistService { * Get a pool of tpl IDs of items the player needs to complete hideout crafts/upgrade areas * @param sessionId Session id * @param pmcData Profile of player who will be getting the rewards + * @param rewardType Do we return bonus items (hideout/task items) + * @param cultistCircleConfig Circle config * @returns Array of tpls */ - protected getCultistCircleRewardPool(sessionId: string, pmcData: IPmcData): string[]; + protected getCultistCircleRewardPool(sessionId: string, pmcData: IPmcData, craftingInfo: ICraftDetails, cultistCircleConfig: ICultistCircleSettings): string[]; /** * Get all active hideout areas * @param areas Hideout areas to iterate over @@ -117,12 +155,13 @@ export declare class CircleOfCultistService { */ protected getPlayerAccessibleHideoutAreas(areas: IBotHideoutArea[]): IBotHideoutArea[]; /** - * Get all recipes the player has access to, includes base + unlocked recipes - * @param unlockedRecipes Recipes player has flagged as unlocked - * @param allRecipes All recipes - * @returns Array of recipes + * Get array of random reward items + * @param rewardPool Reward pool to add to + * @param itemRewardBlacklist Reward Blacklist + * @param valuable Should these items meet the valuable threshold + * @returns rewardPool */ - protected getPlayerAccessibleRecipes(unlockedRecipes: string[], allRecipes: IHideoutProductionData): IHideoutProduction[]; + protected getRandomLoot(rewardPool: Set, itemRewardBlacklist: string[], valuable: boolean): Set; /** * Iterate over passed in hideout requirements and return the Item * @param requirements Requirements to iterate over @@ -130,3 +169,13 @@ export declare class CircleOfCultistService { */ protected getItemRequirements(requirements: IRequirementBase[]): (IStageRequirement | IRequirement)[]; } +export declare enum CircleRewardType { + RANDOM = 0, + HIDEOUT_TASK = 1 +} +export interface ICraftDetails { + time: number; + rewardType: CircleRewardType; + rewardAmountRoubles: number; + rewardDetails?: ICraftTimeThreshhold; +} diff --git a/types/services/DatabaseService.d.ts b/types/services/DatabaseService.d.ts index cbe33077..934617a2 100644 --- a/types/services/DatabaseService.d.ts +++ b/types/services/DatabaseService.d.ts @@ -21,12 +21,15 @@ import { ITemplates } from "@spt/models/spt/templates/ITemplates"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { LocalisationService } from "@spt/services/LocalisationService"; +import { HashUtil } from "@spt/utils/HashUtil"; export declare class DatabaseService { protected logger: ILogger; protected databaseServer: DatabaseServer; protected localisationService: LocalisationService; + protected hashUtil: HashUtil; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService); + protected isDataValid: boolean; + constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, hashUtil: HashUtil); /** * @returns assets/database/ */ @@ -115,4 +118,20 @@ export declare class DatabaseService { * @returns assets/database/locationServices/ */ getLocationServices(): ILocationServices; + /** + * Validates that the database doesn't contain invalid ID data + */ + validateDatabase(): void; + /** + * Validate that the given table only contains valid MongoIDs + * @param table Table to validate for MongoIDs + * @param tableType The type of table, used in output message + * @returns True if the table only contains valid data + */ + private validateTable; + /** + * Check if the database is valid + * @returns True if the database contains valid data, false otherwise + */ + isDatabaseValid(): boolean; } diff --git a/types/services/LocaleService.d.ts b/types/services/LocaleService.d.ts index 2326dcc1..a14c89c8 100644 --- a/types/services/LocaleService.d.ts +++ b/types/services/LocaleService.d.ts @@ -44,7 +44,7 @@ export declare class LocaleService { * Get the full locale of the computer running the server lowercased e.g. en-gb / pt-pt * @returns string */ - protected getPlatformForServerLocale(): string; + getPlatformForServerLocale(): string; /** * Get the locale of the computer running the server * @returns langage part of locale e.g. 'en' part of 'en-US' diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index 53b83e8c..93b1b963 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -141,6 +141,14 @@ export declare class LocationLifecycleService { * @param locationName */ protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, isSurvived: boolean, isTransfer: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + /** + * On death Quest items are lost, the client does not clean up completed conditions for picking up those quest items, + * If the completed conditions remain in the profile the player is unable to pick the item up again + * @param sessionId Session id + * @param lostQuestItems Quest items lost on player death + * @param profileQuests Quest status data from player profile + */ + protected checkForAndFixPickupQuestsAfterDeath(sessionId: string, lostQuestItems: IItem[], profileQuests: IQuestStatus[]): void; /** * In 0.15 Lightkeeper quests do not give rewards in PvE, this issue also occurs in spt * We check for newly completed Lk quests and run them through the servers `CompleteQuest` process diff --git a/types/services/ProfileFixerService.d.ts b/types/services/ProfileFixerService.d.ts index 43d1d119..4a3a5ff6 100644 --- a/types/services/ProfileFixerService.d.ts +++ b/types/services/ProfileFixerService.d.ts @@ -2,9 +2,11 @@ import { HideoutHelper } from "@spt/helpers/HideoutHelper"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBonus, IHideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; +import { IQuest, IQuestReward } from "@spt/models/eft/common/tables/IQuest"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IStageBonus } from "@spt/models/eft/hideout/IHideoutArea"; @@ -36,9 +38,10 @@ export declare class ProfileFixerService { protected hashUtil: HashUtil; protected configServer: ConfigServer; protected cloner: ICloner; + protected questHelper: QuestHelper; protected coreConfig: ICoreConfig; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, watermark: Watermark, databaseService: DatabaseService, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, configServer: ConfigServer, cloner: ICloner, questHelper: QuestHelper); /** * Find issues in the pmc profile data that may cause issues and fix them * @param pmcProfile profile to check and fix @@ -71,6 +74,25 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to remove dead quests from */ protected removeOrphanedQuests(pmcProfile: IPmcData): void; + /** + * Verify that all quest production unlocks have been applied to the PMC Profile + * @param pmcProfile The profile to validate quest productions for + */ + protected verifyQuestProductionUnlocks(pmcProfile: IPmcData): void; + /** + * Validate that the given profile has the given quest reward production scheme unlocked, and add it if not + * @param pmcProfile Profile to check + * @param productionUnlockReward The quest reward to validate + * @param questDetails The quest the reward belongs to + * @returns + */ + protected verifyQuestProductionUnlock(pmcProfile: IPmcData, productionUnlockReward: IQuestReward, questDetails: IQuest): void; + /** + * Initial release of SPT 3.10 used an incorrect favorites structure, reformat + * the structure to the correct MongoID array structure + * @param pmcProfile + */ + protected fixFavorites(pmcProfile: IPmcData): void; /** * If the profile has elite Hideout Managment skill, add the additional slots from globals * NOTE: This seems redundant, but we will leave it here just incase. @@ -120,4 +142,5 @@ export declare class ProfileFixerService { * @returns matching bonus */ protected getBonusFromProfile(profileBonuses: IBonus[], bonus: IStageBonus): IBonus | undefined; + checkForAndRemoveInvalidTraders(fullProfile: ISptProfile): void; } diff --git a/types/services/SeasonalEventService.d.ts b/types/services/SeasonalEventService.d.ts index 7ce39dca..446ccccb 100644 --- a/types/services/SeasonalEventService.d.ts +++ b/types/services/SeasonalEventService.d.ts @@ -138,6 +138,18 @@ export declare class SeasonalEventService { */ protected enableHalloweenSummonEvent(): void; protected configureZombies(zombieSettings: IZombieSettings): void; + /** + * Get location ids of maps with an infection above 0 + * @param locationInfections Dict of locations with their infection percentage + * @returns Array of location ids + */ + protected getLocationsWithZombies(locationInfections: Record): string[]; + /** + * BSG store the location ids differently inside `LocationInfection`, need to convert to matching location IDs + * @param infectedLocationKey Key to convert + * @returns Array of locations + */ + protected getLocationFromInfectedLocation(infectedLocationKey: string): string[]; protected addEventWavesToMaps(eventType: string): void; /** * Add event bosses to maps diff --git a/types/utils/App.d.ts b/types/utils/App.d.ts index 211044e8..0e4850ea 100644 --- a/types/utils/App.d.ts +++ b/types/utils/App.d.ts @@ -7,6 +7,7 @@ import { HttpServer } from "@spt/servers/HttpServer"; import { LocalisationService } from "@spt/services/LocalisationService"; import { EncodingUtil } from "@spt/utils/EncodingUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { DatabaseService } from "@spt/services/DatabaseService"; export declare class App { protected logger: ILogger; protected timeUtil: TimeUtil; @@ -14,11 +15,12 @@ export declare class App { protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; protected httpServer: HttpServer; + protected databaseService: DatabaseService; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, databaseService: DatabaseService, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/types/utils/RandomUtil.d.ts b/types/utils/RandomUtil.d.ts index 0da184f6..601300cc 100644 --- a/types/utils/RandomUtil.d.ts +++ b/types/utils/RandomUtil.d.ts @@ -106,77 +106,177 @@ export declare class RandomUtil { protected cloner: ICloner; protected logger: ILogger; constructor(cloner: ICloner, logger: ILogger); + /** + * Generates a secure random number between 0 (inclusive) and 1 (exclusive). + * + * This method uses the `crypto` module to generate a 48-bit random integer, + * which is then divided by the maximum possible 48-bit integer value to + * produce a floating-point number in the range [0, 1). + * + * @returns A secure random number between 0 (inclusive) and 1 (exclusive). + */ + private getSecureRandomNumber; + /** + * Generates a random integer between the specified minimum and maximum values, inclusive. + * + * @param min - The minimum value (inclusive). + * @param max - The maximum value (inclusive). + * @returns A random integer between the specified minimum and maximum values. + */ getInt(min: number, max: number): number; + /** + * Generates a random integer between 1 (inclusive) and the specified maximum value (exclusive). + * If the maximum value is less than or equal to 1, it returns 1. + * + * @param max - The upper bound (exclusive) for the random integer generation. + * @returns A random integer between 1 and max - 1, or 1 if max is less than or equal to 1. + */ getIntEx(max: number): number; + /** + * Generates a random floating-point number within the specified range. + * + * @param min - The minimum value of the range (inclusive). + * @param max - The maximum value of the range (exclusive). + * @returns A random floating-point number between `min` (inclusive) and `max` (exclusive). + */ getFloat(min: number, max: number): number; + /** + * Generates a random boolean value. + * + * @returns A random boolean value, where the probability of `true` and `false` is approximately equal. + */ getBool(): boolean; + /** + * Calculates the percentage of a given number and returns the result. + * + * @param percent - The percentage to calculate. + * @param number - The number to calculate the percentage of. + * @param toFixed - The number of decimal places to round the result to (default is 2). + * @returns The calculated percentage of the given number, rounded to the specified number of decimal places. + */ getPercentOfValue(percent: number, number: number, toFixed?: number): number; /** - * Reduce a value by a percentage - * @param number Value to reduce - * @param percentage Percentage to reduce value by - * @returns Reduced value + * Reduces a given number by a specified percentage. + * + * @param number - The original number to be reduced. + * @param percentage - The percentage by which to reduce the number. + * @returns The reduced number after applying the percentage reduction. */ reduceValueByPercent(number: number, percentage: number): number; /** - * Check if number passes a check out of 100 - * @param chancePercent value check needs to be above - * @returns true if value passes check + * Determines if a random event occurs based on the given chance percentage. + * + * @param chancePercent - The percentage chance (0-100) that the event will occur. + * @returns `true` if the event occurs, `false` otherwise. */ getChance100(chancePercent: number): boolean; + /** + * Returns a random string from the provided array of strings. + * + * This method is separate from getArrayValue so we can use a generic inferance with getArrayValue. + * + * @param arr - The array of strings to select a random value from. + * @returns A randomly selected string from the array. + */ getStringArrayValue(arr: string[]): string; + /** + * Returns a random element from the provided array. + * + * @template T - The type of elements in the array. + * @param arr - The array from which to select a random element. + * @returns A random element from the array. + */ getArrayValue(arr: T[]): T; + /** + * Retrieves a random key from the given object. + * + * @param node - The object from which to retrieve a key. + * @returns A string representing one of the keys of the node object. + * + * TODO: v3.11 - This method is not type-safe and should be refactored to use a more specific type: + * https://github.com/sp-tarkov/server/pull/972/commits/f2b8efe211d95f71aec0a4bc84f4542335433412 + */ getKey(node: any): string; + /** + * Retrieves the value associated with a key from the given node object. + * + * @param node - An object with string keys and any type of values. + * @returns The value associated with the key obtained from the node. + * + * TODO: v3.11 - This method is not type-safe and should be refactored to use a more specific type: + * https://github.com/sp-tarkov/server/pull/972/commits/f2b8efe211d95f71aec0a4bc84f4542335433412 + */ getKeyValue(node: { [x: string]: any; }): any; /** - * Generate a normally distributed random number - * Uses the Box-Muller transform - * @param {number} mean Mean of the normal distribution - * @param {number} sigma Standard deviation of the normal distribution - * @returns {number} The value drawn + * Generates a normally distributed random number using the Box-Muller transform. + * + * @param mean - The mean (μ) of the normal distribution. + * @param sigma - The standard deviation (σ) of the normal distribution. + * @param attempt - The current attempt count to generate a valid number (default is 0). + * @returns A normally distributed random number. + * + * @remarks + * This function uses the Box-Muller transform to generate a normally distributed random number. + * If the generated number is less than 0, it will recursively attempt to generate a valid number up to 100 times. + * If it fails to generate a valid number after 100 attempts, it will return a random float between 0.01 and twice the mean. */ getNormallyDistributedRandomNumber(mean: number, sigma: number, attempt?: number): number; /** - * Draw Random integer low inclusive, high exclusive - * if high is not set we draw from 0 to low (exclusive) - * @param {integer} low Lower bound inclusive, when high is not set, this is high - * @param {integer} high Higher bound exclusive - * @returns {integer} The random integer in [low, high) + * Generates a random integer between the specified range. + * + * @param low - The lower bound of the range (inclusive). + * @param high - The upper bound of the range (exclusive). If not provided, the range will be from 0 to `low`. + * @returns A random integer within the specified range. */ randInt(low: number, high?: number): number; /** - * Draw a random element of the provided list N times to return an array of N random elements - * Drawing can be with or without replacement - * @param {array} list The array we want to draw randomly from - * @param {integer} count The number of times we want to draw - * @param {boolean} replacement Draw with or without replacement from the input array(default true) - * @return {array} Array consisting of N random elements + * Draws a specified number of random elements from a given list. + * + * @template T - The type of elements in the list. + * @param originalList - The list to draw elements from. + * @param count - The number of elements to draw. Defaults to 1. + * @param replacement - Whether to draw with replacement. Defaults to true. + * @returns An array containing the drawn elements. */ drawRandomFromList(originalList: Array, count?: number, replacement?: boolean): Array; /** - * Draw a random (top level) element of the provided dictionary N times to return an array of N random dictionary keys - * Drawing can be with or without replacement - * @param {any} dict The dictionary we want to draw randomly from - * @param {integer} count The number of times we want to draw - * @param {boolean} replacement Draw with ot without replacement from the input dict - * @return {array} Array consisting of N random keys of the dictionary + * Draws a specified number of random keys from a given dictionary. + * + * @param dict - The dictionary from which to draw keys. + * @param count - The number of keys to draw. Defaults to 1. + * @param replacement - Whether to draw with replacement. Defaults to true. + * @returns An array of randomly drawn keys from the dictionary. + * + * TODO: v3.11 - This method is not type-safe and should be refactored to use a more specific type: + * https://github.com/sp-tarkov/server/pull/972/commits/f2b8efe211d95f71aec0a4bc84f4542335433412 */ drawRandomFromDict(dict: any, count?: number, replacement?: boolean): any[]; + /** + * Generates a biased random number within a specified range. + * + * @param min - The minimum value of the range (inclusive). + * @param max - The maximum value of the range (inclusive). + * @param shift - The bias shift to apply to the random number generation. + * @param n - The number of iterations to use for generating a Gaussian random number. + * @returns A biased random number within the specified range. + * @throws Will throw if `max` is less than `min` or if `n` is less than 1. + */ getBiasedRandomNumber(min: number, max: number, shift: number, n: number): number; /** - * Fisher-Yates shuffle an array - * @param array Array to shuffle - * @returns Shuffled array + * Shuffles an array in place using the Fisher-Yates algorithm. + * + * @template T - The type of elements in the array. + * @param array - The array to shuffle. + * @returns The shuffled array. */ shuffle(array: Array): Array; /** - * Rolls for a probability based on chance - * @param number Probability Chance as float (0-1) - * @returns If roll succeed or not - * @example - * rollForChanceProbability(0.25); // returns true 25% probability + * Rolls for a chance probability and returns whether the roll is successful. + * + * @param probabilityChance - The probability chance to roll for, represented as a number between 0 and 1. + * @returns `true` if the random number is less than or equal to the probability chance, otherwise `false`. */ rollForChanceProbability(probabilityChance: number): boolean; } From e39c0986aff2f75ffc71c09df2fb38ec4fb3b408 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 6 Dec 2024 18:46:45 +0100 Subject: [PATCH 2/2] Update IGetOtherProfileResponse --- types/models/eft/profile/IGetOtherProfileResponse.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 0b4683a1..88a49b4f 100644 --- a/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -8,7 +8,7 @@ export interface IGetOtherProfileResponse { skills: ISkills; equipment: IOtherProfileEquipment; achievements: Record; - favoriteItems: IItem[]; + favoriteItems: string[]; pmcStats: IOtherProfileStats; scavStats: IOtherProfileStats; }