diff --git a/README.md b/README.md index 0e2ce0e..889c570 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mod examples for v3.8.1 +# Mod examples for v3.8.3 A collection of example mods that perform typical actions in SPT diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} 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 cfcc831..c7c7c94 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: 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 9a1eb01..dde1a39 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/10ScopesAndTypes/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/10ScopesAndTypes/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/11BundleLoadingSample/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IQteData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/11BundleLoadingSample/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IQteData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts b/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/13AddTrader/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/13AddTrader/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/13AddTrader/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/13AddTrader/types/models/eft/hideout/IQteData.d.ts b/TypeScript/13AddTrader/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/13AddTrader/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/13AddTrader/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/13AddTrader/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts b/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/13AddTrader/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/13AddTrader/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/13AddTrader/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IQteData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/15HttpListenerExample/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/hideout/IQteData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/15HttpListenerExample/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/15HttpListenerExample/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/16ImporterUtil/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/16ImporterUtil/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/16ImporterUtil/types/models/eft/hideout/IQteData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/16ImporterUtil/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/16ImporterUtil/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/16ImporterUtil/types/models/enums/BaseClasses.d.ts b/TypeScript/16ImporterUtil/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/16ImporterUtil/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/16ImporterUtil/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IQteData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BaseClasses.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IQteData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BaseClasses.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/18CustomItemService/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/18CustomItemService/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/18CustomItemService/types/models/eft/hideout/IQteData.d.ts b/TypeScript/18CustomItemService/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/18CustomItemService/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/18CustomItemService/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/18CustomItemService/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/18CustomItemService/types/models/enums/BaseClasses.d.ts b/TypeScript/18CustomItemService/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/18CustomItemService/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/18CustomItemService/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/18CustomItemService/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/18CustomItemService/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/19UseExternalLibraries/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/hideout/IQteData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/19UseExternalLibraries/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/BaseClasses.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} 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 cfcc831..c7c7c94 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/1LogToConsole/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/1LogToConsole/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/1LogToConsole/types/models/eft/hideout/IQteData.d.ts b/TypeScript/1LogToConsole/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/1LogToConsole/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/1LogToConsole/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/1LogToConsole/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/1LogToConsole/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/1LogToConsole/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/1LogToConsole/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/20CustomChatBot/types/callbacks/GameCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/20CustomChatBot/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/20CustomChatBot/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/20CustomChatBot/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/20CustomChatBot/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/20CustomChatBot/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/20CustomChatBot/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/20CustomChatBot/types/models/eft/hideout/IQteData.d.ts b/TypeScript/20CustomChatBot/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/20CustomChatBot/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/20CustomChatBot/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/20CustomChatBot/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/20CustomChatBot/types/models/enums/BaseClasses.d.ts b/TypeScript/20CustomChatBot/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/20CustomChatBot/types/models/enums/SkillTypes.d.ts b/TypeScript/20CustomChatBot/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/20CustomChatBot/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/20CustomChatBot/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts +++ b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/GameCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/hideout/IQteData.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/BaseClasses.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/SkillTypes.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/GameCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/22CustomAkiCommand/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/hideout/IQteData.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/22CustomAkiCommand/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/BaseClasses.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/SkillTypes.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/2EditDatabase/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/2EditDatabase/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/2EditDatabase/types/models/eft/hideout/IQteData.d.ts b/TypeScript/2EditDatabase/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/2EditDatabase/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/2EditDatabase/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/2EditDatabase/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts b/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/2EditDatabase/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/2EditDatabase/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/2EditDatabase/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/3GetSptConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IQteData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/3GetSptConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/hideout/IQteData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/BaseClasses.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IQteData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/5ReplaceMethod/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/hideout/IQteData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/5ReplaceMethod/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/5ReplaceMethod/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IQteData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/7OnLoadHook/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/7OnLoadHook/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/7OnLoadHook/types/models/eft/hideout/IQteData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/7OnLoadHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/7OnLoadHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts b/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/7OnLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/7OnLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/8OnUpdateHook/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/hideout/IQteData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/8OnUpdateHook/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/8OnUpdateHook/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns diff --git a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts index 2de57cb..9fcd5ea 100644 --- a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts @@ -1,6 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; @@ -92,13 +93,9 @@ export declare class DialogueCallbacks implements OnUpdate { /** Handle client/friend/delete */ deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData; /** Handle client/friend/ignore/set */ - ignoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + ignoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; /** Handle client/friend/ignore/remove */ - unIgnoreFriend(url: string, request: { - uid: string; - }, sessionID: string): INullResponseData; + unIgnoreFriend(url: string, request: IUIDRequestData, sessionID: string): INullResponseData; clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData; removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData; onUpdate(timeSinceLastRun: number): Promise; diff --git a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts index 51c7595..511d68a 100644 --- a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts @@ -1,6 +1,7 @@ import { GameController } from "@spt-aki/controllers/GameController"; import { OnLoad } from "@spt-aki/di/OnLoad"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { ICheckVersionResponse } from "@spt-aki/models/eft/game/ICheckVersionResponse"; import { ICurrentGroupResponse } from "@spt-aki/models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "@spt-aki/models/eft/game/IGameConfigResponse"; @@ -10,7 +11,6 @@ import { IGameLogoutResponseData } from "@spt-aki/models/eft/game/IGameLogoutRes import { IGameStartResponse } from "@spt-aki/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt-aki/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt-aki/models/eft/game/IGetRaidTimeResponse"; -import { IReportNicknameRequestData } from "@spt-aki/models/eft/game/IReportNicknameRequestData"; import { IServerDetails } from "@spt-aki/models/eft/game/IServerDetails"; import { IVersionValidateRequestData } from "@spt-aki/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; @@ -69,7 +69,7 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; - reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData; + reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string diff --git a/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts index 59faade..2d561fa 100644 --- a/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/NotifierCallbacks.d.ts @@ -1,9 +1,9 @@ import { NotifierController } from "@spt-aki/controllers/NotifierController"; import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; import { ISelectProfileResponse } from "@spt-aki/models/eft/notifier/ISelectProfileResponse"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -29,6 +29,6 @@ export declare class NotifierCallbacks { * Handle client/game/profile/select * @returns ISelectProfileResponse */ - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts index b0e222f..93c0709 100644 --- a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts @@ -26,7 +26,7 @@ export declare class BuildController { saveWeaponBuild(sessionId: string, body: IPresetBuildActionRequestData): void; /** Handle client/builds/equipment/save event */ saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; - /** Handle client/builds/delete*/ + /** Handle client/builds/delete */ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index b3d7079..b08f2ef 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -2,6 +2,7 @@ import { DialogueHelper } from "@spt-aki/helpers/DialogueHelper"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt-aki/models/eft/insurance/IGetInsuranceCostRequestData"; @@ -20,6 +21,7 @@ import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -27,6 +29,7 @@ export declare class InsuranceController { protected logger: ILogger; protected randomUtil: RandomUtil; protected mathUtil: MathUtil; + protected jsonUtil: JsonUtil; protected hashUtil: HashUtil; protected eventOutputHolder: EventOutputHolder; protected timeUtil: TimeUtil; @@ -35,6 +38,7 @@ export declare class InsuranceController { protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; protected dialogueHelper: DialogueHelper; + protected weightedRandomHelper: WeightedRandomHelper; protected traderHelper: TraderHelper; protected paymentService: PaymentService; protected insuranceService: InsuranceService; @@ -43,7 +47,7 @@ export declare class InsuranceController { protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, weightedRandomHelper: WeightedRandomHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -146,35 +150,15 @@ export declare class InsuranceController { * @returns void */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: Item[]): Record; /** - * Sorts the attachment items by their dynamic price in descending order. - * - * @param attachments The array of attachments items. - * @returns An array of items enriched with their max price and common locale-name. + * Get count of items to remove from weapon (take into account trader + price of attachment) + * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price + * @param traderId Trader attachment insured against + * @returns Attachment count to remove */ - protected sortAttachmentsByPrice(attachments: Item[]): EnrichedItem[]; - /** - * Logs the details of each attachment item. - * - * @param attachments The array of attachment items. - */ - protected logAttachmentsDetails(attachments: EnrichedItem[]): void; - /** - * Counts the number of successful rolls for the attachment items. - * - * @param attachments The array of attachment items. - * @param traderId The ID of the trader that has insured these attachments. - * @returns The number of successful rolls. - */ - protected countSuccessfulRolls(attachments: Item[], traderId: string): number; - /** - * Marks the most valuable attachments for deletion based on the number of successful rolls made. - * - * @param attachments The array of attachment items. - * @param successfulRolls The number of successful rolls. - * @param toDelete The array that accumulates the IDs of the items to be deleted. - */ - protected attachmentDeletionByValue(attachments: EnrichedItem[], successfulRolls: number, toDelete: Set): void; + protected getAttachmentCountToRemove(weightedAttachmentByPrice: Record, traderId: string): number; /** * Remove items from the insured items that should not be returned to the player. * @@ -192,7 +176,7 @@ export declare class InsuranceController { */ protected sendMail(sessionID: string, insurance: Insurance): void; /** - * Determines whether a insured item should be removed from the player's inventory based on a random roll and + * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. * * @param traderId The ID of the trader who insured the item. @@ -220,8 +204,3 @@ export declare class InsuranceController { */ cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData; } -interface EnrichedItem extends Item { - name: string; - dynamicPrice: number; -} -export {}; diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index aae8473..1842abe 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -63,7 +63,7 @@ export declare class RepeatableQuestController { * @param {string} _info Request from client * @param {string} sessionID Player's session id * - * @returns {array} Array of "repeatableQuestObjects" as descibed above + * @returns {array} Array of "repeatableQuestObjects" as described above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; /** diff --git a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts index 4f487be..a7a36e9 100644 --- a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IPmcConfig } from "@spt-aki/models/spt/config/IPmcConfig"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -17,11 +18,13 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected ragfairPriceService: RagfairPriceService; protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; protected pocketLootPool: Record; protected vestLootPool: Record; protected backpackLootPool: Record; protected pmcConfig: IPmcConfig; - constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService); + protected roubleTpl: string; + constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, ragfairPriceService: RagfairPriceService, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper); /** * Create an array of loot items a PMC can have in their pockets * @returns string array of tpls @@ -44,11 +47,4 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCBackpackLootPool(botRole: string): Record; - /** - * Find the greated common divisor of all weights and use it on the passed in dictionary - * @param weightedDict - */ - protected reduceWeightValues(weightedDict: Record): void; - protected commonDivisor(numbers: number[]): number; - protected gcd(a: number, b: number): number; } diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts index 26958ca..d53189c 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -2,6 +2,7 @@ import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/Giv import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,10 +31,16 @@ export declare class GiveSptCommand implements ISptCommand { * spt give 5 <== this is the reply when the algo isn't sure about an item */ private static commandRegex; - private static maxAllowedDistance; + private static acceptableConfidence; protected savedCommand: Map; constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + /** + * A "simple" function that checks if an item is supposed to be given to a player or not + * @param templateItem the template item to check + * @returns true if its obtainable, false if its not + */ + protected isItemAllowed(templateItem: ITemplateItem): boolean; } diff --git a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts index 47a98bf..8199ca3 100644 --- a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts @@ -10,8 +10,8 @@ import { Inventory } from "@spt-aki/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemDirectRequest"; import { AddItem } from "@spt-aki/models/eft/inventory/IAddItemRequestData"; -import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IAddItemsDirectRequest } from "@spt-aki/models/eft/inventory/IAddItemsDirectRequest"; +import { IAddItemTempObject } from "@spt-aki/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt-aki/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt-aki/models/eft/inventory/IInventoryRemoveRequestData"; diff --git a/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts index ab42805..f3a34f3 100644 --- a/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts @@ -34,4 +34,11 @@ export declare class WeightedRandomHelper { item: any; index: number; }; + /** + * Find the greated common divisor of all weights and use it on the passed in dictionary + * @param weightedDict values to reduce + */ + reduceWeightValues(weightedDict: Record): void; + protected commonDivisor(numbers: number[]): number; + protected gcd(a: number, b: number): number; } diff --git a/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts index e5aaa4a..d296b9a 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts @@ -922,7 +922,7 @@ export interface IBtrMapConfig { mapID: string; pathsConfigurations: IBtrMapConfig[]; } -export interface IBtrMapConfig { +export interface IBtrPathConfig { id: string; enterPoint: string; exitPoint: string; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/request/IUIDRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/request/IUIDRequestData.d.ts new file mode 100644 index 0000000..d905ad7 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/common/request/IUIDRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUIDRequestData { + uid: string; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts index cfcc831..c7c7c94 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts @@ -373,7 +373,7 @@ export interface IQuestStatus { startTime: number; status: QuestStatus; statusTimers?: Record; - /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client*/ + /** Property does not exist in live profile data, but is used by ProfileChanges.questsStatus when sent to client */ completedConditions?: string[]; availableAfter?: number; } diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts index 9a1eb01..dde1a39 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Dialogue, IUserBuilds } from "@spt-aki/models/eft/profile/IAkiProfile"; export interface IProfileTemplates { - Standard: IProfileSides; + "Standard": IProfileSides; "Left Behind": IProfileSides; "Prepare To Escape": IProfileSides; "Edge Of Darkness": IProfileSides; diff --git a/TypeScript/9RouterHooks/types/models/eft/game/IReportNicknameRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/game/IReportNicknameRequestData.d.ts deleted file mode 100644 index 087c58b..0000000 --- a/TypeScript/9RouterHooks/types/models/eft/game/IReportNicknameRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IReportNicknameRequestData { - uid: string; -} diff --git a/TypeScript/9RouterHooks/types/models/eft/hideout/IQteData.d.ts b/TypeScript/9RouterHooks/types/models/eft/hideout/IQteData.d.ts index bb29c5f..f7f674e 100644 --- a/TypeScript/9RouterHooks/types/models/eft/hideout/IQteData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/hideout/IQteData.d.ts @@ -1,14 +1,14 @@ import { Effect } from "@spt-aki/models/eft/health/Effect"; import { BodyPart } from "@spt-aki/models/eft/health/IOffraidHealRequestData"; -import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; -import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; -import { Traders } from "@spt-aki/models/enums/Traders"; import { QteActivityType } from "@spt-aki/models/enums/hideout/QteActivityType"; import { QteEffectType } from "@spt-aki/models/enums/hideout/QteEffectType"; import { QteResultType } from "@spt-aki/models/enums/hideout/QteResultType"; import { QteRewardType } from "@spt-aki/models/enums/hideout/QteRewardType"; import { QteType } from "@spt-aki/models/enums/hideout/QteType"; import { RequirementType } from "@spt-aki/models/enums/hideout/RequirementType"; +import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; +import { Traders } from "@spt-aki/models/enums/Traders"; export interface IQteData { id: string; type: QteActivityType; diff --git a/TypeScript/9RouterHooks/types/models/eft/notifier/ISelectProfileRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/notifier/ISelectProfileRequestData.d.ts deleted file mode 100644 index 2bc3d1e..0000000 --- a/TypeScript/9RouterHooks/types/models/eft/notifier/ISelectProfileRequestData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISelectProfileRequestData { - uid: string; -} diff --git a/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts b/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts index 6d2106b..d98a58f 100644 --- a/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/BaseClasses.d.ts @@ -109,5 +109,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 " + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", + HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts index dc059a8..c41ce6f 100644 --- a/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/SkillTypes.d.ts @@ -34,7 +34,7 @@ export declare enum SkillTypes { NIGHT_OPS = "NightOps", SILENT_OPS = "SilentOps", LOCKPICKING = "Lockpicking", - /** Also called Weapon Maintenance*/ + /** Also called Weapon Maintenance */ WEAPON_TREATMENT = "WeaponTreatment", MAG_DRILLS = "MagDrills", FREE_TRADING = "Freetrading", diff --git a/TypeScript/9RouterHooks/types/models/spt/callbacks/INotifierCallbacks.d.ts b/TypeScript/9RouterHooks/types/models/spt/callbacks/INotifierCallbacks.d.ts index 60b3695..7da556b 100644 --- a/TypeScript/9RouterHooks/types/models/spt/callbacks/INotifierCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/callbacks/INotifierCallbacks.d.ts @@ -1,7 +1,7 @@ import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; +import { IUIDRequestData } from "@spt-aki/models/eft/common/request/IUIDRequestData"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { INotifierChannel } from "@spt-aki/models/eft/notifier/INotifier"; -import { ISelectProfileRequestData } from "@spt-aki/models/eft/notifier/ISelectProfileRequestData"; export interface INotifierCallbacks { /** * If we don't have anything to send, it's ok to not send anything back @@ -12,6 +12,6 @@ export interface INotifierCallbacks { sendNotification(sessionID: string, req: any, resp: any, data: any): void; getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData; createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData; + selectProfile(url: string, info: IUIDRequestData, sessionID: string): IGetBodyResponseData; notify(url: string, info: any, sessionID: string): string; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index 8edc3df..0148f2a 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -175,7 +175,7 @@ export interface IRandomisedResourceDetails { meds: IRandomisedResourceValues; } export interface IRandomisedResourceValues { - /** Minimum percent of item to randomized between min and max resource*/ + /** Minimum percent of item to randomized between min and max resource */ resourcePercent: number; /** Chance for randomization to not occur */ chanceMaxResourcePercent: number; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts index c3bd01c..3ecc337 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts @@ -51,7 +51,7 @@ export interface IRelease { export interface IGameFixes { /** Shotguns use a different value than normal guns causing huge pellet dispersion */ fixShotgunDispersion: boolean; - /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load*/ + /** Remove items added by mods when the mod no longer exists - can fix dead profiles stuck at game load */ removeModItemsFromProfile: boolean; /** Fix issues that cause the game to not start due to inventory item issues */ fixProfileBreakingInventoryItemIssues: boolean; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts index 794abb7..86200f6 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,6 @@ export interface IInsuranceConfig extends IBaseConfig { returnTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; + minAttachmentRoublePriceToBeTaken: number; + chanceNoAttachmentsTakenPercent: number; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts index 400284c..87ef6b5 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts @@ -21,17 +21,17 @@ export interface ILocationConfig extends IBaseConfig { fitLootIntoContainerAttempts: number; /** Add all possible zones to each maps `OpenZones` property */ addOpenZonesToAllMaps: boolean; - /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves*/ + /** Allow addition of custom bot waves designed by SPT to be added to maps - defined in configs/location.json.customWaves */ addCustomBotWavesToMaps: boolean; /** Should the limits defined inside botTypeLimits to appled to locations on game start */ enableBotTypeLimits: boolean; - /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true*/ + /** Add limits to a locations base.MinMaxBots array if enableBotTypeLimits is true */ botTypeLimits: Record; /** container randomisation settings */ containerRandomisationSettings: IContainerRandomistionSettings; - /** How full must a random loose magazine be %*/ + /** How full must a random loose magazine be % */ minFillLooseMagazinePercent: number; - /** How full must a random static magazine be %*/ + /** How full must a random static magazine be % */ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ @@ -40,11 +40,11 @@ export interface ILocationConfig extends IBaseConfig { staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; - /** Key: map, value: settings to control how long scav raids are*/ + /** Key: map, value: settings to control how long scav raids are */ scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero*/ + /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts index 33dee7b..eac8a53 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts @@ -8,7 +8,7 @@ export interface IRagfairConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; /** Player listing settings */ sell: Sell; - /** Trader ids + should their assorts be listed on flea*/ + /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; } @@ -19,7 +19,7 @@ export interface Sell { chance: Chance; /** Settings to control how long it takes for a player offer to sell */ time: MinMax; - /**Seconds from clicking remove to remove offer from market */ + /** Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts index aca6452..8a906c7 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts @@ -31,7 +31,7 @@ export interface FenceConfig { /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; - /** Prevent duplicate offers of items of specific categories by parentId*/ + /** Prevent duplicate offers of items of specific categories by parentId */ preventDuplicateOffersOfCategory: string[]; regenerateAssortsOnRefresh: boolean; /** Max rouble price before item is not listed on flea */ diff --git a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts index bcd740f..2ab3204 100644 --- a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts @@ -6,8 +6,8 @@ import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { IHttpListener } from "@spt-aki/servers/http/IHttpListener"; +import { WebSocketServer } from "@spt-aki/servers/WebSocketServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; export declare class HttpServer { protected logger: ILogger; diff --git a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts index 0fefdd8..f89967c 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts @@ -100,9 +100,9 @@ export declare class RagfairPriceService implements OnLoad { */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; /** - * @param itemTemplateId - * @param desiredCurrency - * @param item + * @param itemTemplateId items tpl value + * @param desiredCurrency Currency to return result in + * @param item Item object (used for weapon presets) * @param offerItems * @param isPackOffer * @returns