diff --git a/README.md b/README.md index b5a2145..44b845b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mod examples for v3.7.4 +# Mod examples for v3.7.5 A collection of example mods that perform typical actions in SPT diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/BundleCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/ModCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RepairHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RepairHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/SecureContainerHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/ItemAddedResult.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/10ScopesAndTypes/types/servers/RagfairServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/RagfairServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairCategoriesService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/BundleCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/ModCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RepairHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RepairHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/SecureContainerHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/ItemAddedResult.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/11BundleLoadingSample/types/servers/RagfairServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/RagfairServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairCategoriesService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/BundleCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/ModCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RepairHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RepairHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/SecureContainerHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/ItemAddedResult.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/12ClassExtensionOverride/types/servers/RagfairServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/RagfairServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairCategoriesService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/13AddTrader/types/callbacks/BundleCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/13AddTrader/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/13AddTrader/types/callbacks/ModCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/13AddTrader/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/13AddTrader/types/controllers/TradeController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/13AddTrader/types/helpers/RepairHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/13AddTrader/types/helpers/RepairHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/13AddTrader/types/helpers/SecureContainerHelper.d.ts b/TypeScript/13AddTrader/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/13AddTrader/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/13AddTrader/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/13AddTrader/types/models/enums/ItemAddedResult.d.ts b/TypeScript/13AddTrader/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/13AddTrader/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts b/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/13AddTrader/types/servers/RagfairServer.d.ts b/TypeScript/13AddTrader/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/13AddTrader/types/servers/RagfairServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts b/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/13AddTrader/types/services/MailSendService.d.ts b/TypeScript/13AddTrader/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/13AddTrader/types/services/MailSendService.d.ts +++ b/TypeScript/13AddTrader/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/13AddTrader/types/services/RagfairCategoriesService.d.ts b/TypeScript/13AddTrader/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/13AddTrader/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts b/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/13AddTrader/types/services/RepairService.d.ts b/TypeScript/13AddTrader/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/13AddTrader/types/services/RepairService.d.ts +++ b/TypeScript/13AddTrader/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/BundleCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/ModCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RepairHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RepairHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/SecureContainerHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/ItemAddedResult.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/14AfterDBLoadHook/types/servers/RagfairServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/RagfairServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairCategoriesService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/15HttpListenerExample/types/callbacks/BundleCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/ModCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/RepairHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RepairHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/SecureContainerHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/15HttpListenerExample/types/models/enums/ItemAddedResult.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/15HttpListenerExample/types/servers/RagfairServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/15HttpListenerExample/types/servers/RagfairServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairCategoriesService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/16ImporterUtil/types/callbacks/BundleCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/16ImporterUtil/types/callbacks/ModCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts b/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/16ImporterUtil/types/helpers/RepairHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RepairHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/16ImporterUtil/types/helpers/SecureContainerHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/16ImporterUtil/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/16ImporterUtil/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/16ImporterUtil/types/models/enums/ItemAddedResult.d.ts b/TypeScript/16ImporterUtil/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts b/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/16ImporterUtil/types/servers/RagfairServer.d.ts b/TypeScript/16ImporterUtil/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/16ImporterUtil/types/servers/RagfairServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts b/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/16ImporterUtil/types/services/RagfairCategoriesService.d.ts b/TypeScript/16ImporterUtil/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/16ImporterUtil/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts b/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/16ImporterUtil/types/services/RepairService.d.ts b/TypeScript/16ImporterUtil/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/16ImporterUtil/types/services/RepairService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BundleCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ModCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RepairHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RepairHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/SecureContainerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemAddedResult.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/RagfairServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/RagfairServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairCategoriesService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BundleCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ModCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RepairHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RepairHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/SecureContainerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemAddedResult.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/RagfairServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/RagfairServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairCategoriesService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/18CustomItemService/types/callbacks/BundleCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/18CustomItemService/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/18CustomItemService/types/callbacks/ModCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/18CustomItemService/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts b/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/18CustomItemService/types/helpers/RepairHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/18CustomItemService/types/helpers/RepairHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/18CustomItemService/types/helpers/SecureContainerHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/18CustomItemService/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/18CustomItemService/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/18CustomItemService/types/models/enums/ItemAddedResult.d.ts b/TypeScript/18CustomItemService/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/18CustomItemService/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts b/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/18CustomItemService/types/servers/RagfairServer.d.ts b/TypeScript/18CustomItemService/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/18CustomItemService/types/servers/RagfairServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts b/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts +++ b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/18CustomItemService/types/services/RagfairCategoriesService.d.ts b/TypeScript/18CustomItemService/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/18CustomItemService/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts b/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/18CustomItemService/types/services/RepairService.d.ts b/TypeScript/18CustomItemService/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/18CustomItemService/types/services/RepairService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/BundleCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/ModCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/19UseExternalLibraries/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RepairHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RepairHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/SecureContainerHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/ItemAddedResult.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/ItemEventActions.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/19UseExternalLibraries/types/servers/RagfairServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/RagfairServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/19UseExternalLibraries/types/servers/WebSocketServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/WebSocketServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts b/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts index 205d92c..e2e140b 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts @@ -120,6 +120,11 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * Attempt to fix common item issues that corrupt profiles + * @param pmcProfile Profile to check items of + */ + fixProfileBreakingInventoryItemIssues(pmcProfile: IPmcData): void; /** * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 * @param pmcProfile profile to update diff --git a/TypeScript/19UseExternalLibraries/types/services/RagfairCategoriesService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/1LogToConsole/types/callbacks/BundleCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/1LogToConsole/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/1LogToConsole/types/callbacks/ModCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/1LogToConsole/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/1LogToConsole/types/helpers/SecureContainerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/1LogToConsole/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/1LogToConsole/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/1LogToConsole/types/models/enums/ItemAddedResult.d.ts b/TypeScript/1LogToConsole/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/1LogToConsole/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts b/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/1LogToConsole/types/servers/RagfairServer.d.ts b/TypeScript/1LogToConsole/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/1LogToConsole/types/servers/RagfairServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts b/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts +++ b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/1LogToConsole/types/services/RagfairCategoriesService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/1LogToConsole/types/services/RepairService.d.ts b/TypeScript/1LogToConsole/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/1LogToConsole/types/services/RepairService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/2EditDatabase/types/callbacks/BundleCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/2EditDatabase/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/2EditDatabase/types/callbacks/ModCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/2EditDatabase/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/2EditDatabase/types/helpers/RepairHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/2EditDatabase/types/helpers/RepairHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/2EditDatabase/types/helpers/SecureContainerHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/2EditDatabase/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/2EditDatabase/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/2EditDatabase/types/models/enums/ItemAddedResult.d.ts b/TypeScript/2EditDatabase/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/2EditDatabase/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts b/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/2EditDatabase/types/servers/RagfairServer.d.ts b/TypeScript/2EditDatabase/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/2EditDatabase/types/servers/RagfairServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts b/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts +++ b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/2EditDatabase/types/services/RagfairCategoriesService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/2EditDatabase/types/services/RepairService.d.ts b/TypeScript/2EditDatabase/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/2EditDatabase/types/services/RepairService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/BundleCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/ModCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RepairHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RepairHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/SecureContainerHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/ItemAddedResult.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/3GetSptConfigFile/types/servers/RagfairServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/RagfairServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairCategoriesService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BundleCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ModCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RepairHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RepairHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/SecureContainerHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemAddedResult.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemEventActions.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } 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 43ee964..14d77f1 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/RagfairServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/RagfairServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/WebSocketServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/WebSocketServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairCategoriesService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/BundleCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/ModCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RepairHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RepairHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/SecureContainerHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/ItemAddedResult.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/4UseACustomConfigFile/types/servers/RagfairServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/RagfairServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairCategoriesService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/5ReplaceMethod/types/callbacks/BundleCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/ModCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/RepairHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RepairHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/SecureContainerHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/5ReplaceMethod/types/models/enums/ItemAddedResult.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/5ReplaceMethod/types/servers/RagfairServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/5ReplaceMethod/types/servers/RagfairServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairCategoriesService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/BundleCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/ModCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RepairHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RepairHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/SecureContainerHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemAddedResult.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/RagfairServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/RagfairServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairCategoriesService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/7OnLoadHook/types/callbacks/BundleCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/7OnLoadHook/types/callbacks/ModCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/7OnLoadHook/types/helpers/RepairHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RepairHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/7OnLoadHook/types/helpers/SecureContainerHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/7OnLoadHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/7OnLoadHook/types/models/enums/ItemAddedResult.d.ts b/TypeScript/7OnLoadHook/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts b/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/7OnLoadHook/types/servers/RagfairServer.d.ts b/TypeScript/7OnLoadHook/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/7OnLoadHook/types/servers/RagfairServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts b/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/7OnLoadHook/types/services/RagfairCategoriesService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/7OnLoadHook/types/services/RepairService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/8OnUpdateHook/types/callbacks/BundleCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/ModCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/RepairHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RepairHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/SecureContainerHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/8OnUpdateHook/types/models/enums/ItemAddedResult.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/8OnUpdateHook/types/servers/RagfairServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/8OnUpdateHook/types/servers/RagfairServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairCategoriesService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for diff --git a/TypeScript/9RouterHooks/types/callbacks/BundleCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/BundleCallbacks.d.ts index ab8a631..a49b8ec 100644 --- a/TypeScript/9RouterHooks/types/callbacks/BundleCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/BundleCallbacks.d.ts @@ -12,7 +12,7 @@ export declare class BundleCallbacks { protected configServer: ConfigServer; protected httpConfig: IHttpConfig; constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer); - sendBundle(sessionID: string, req: any, resp: any, body: any): any; + sendBundle(sessionID: string, req: any, resp: any, body: any): void; /** * Handle singleplayer/bundles */ diff --git a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts index 54bdfc7..e85e539 100644 --- a/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/GameCallbacks.d.ts @@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class GameCallbacks implements OnLoad { +export declare class GameCallbacks implements OnLoad { protected httpResponse: HttpResponseUtil; protected watermark: Watermark; protected saveServer: SaveServer; @@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad { */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any; } -export { GameCallbacks }; diff --git a/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts index d1455c3..ddbb070 100644 --- a/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts @@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; export declare class InventoryCallbacks { protected inventoryController: InventoryController; @@ -46,4 +47,5 @@ export declare class InventoryCallbacks { editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; /** Handle OpenRandomLootContainer */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts index f515532..b452291 100644 --- a/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/LauncherCallbacks.d.ts @@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD import { SaveServer } from "@spt-aki/servers/SaveServer"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { Watermark } from "@spt-aki/utils/Watermark"; -declare class LauncherCallbacks { +export declare class LauncherCallbacks { protected httpResponse: HttpResponseUtil; protected launcherController: LauncherController; protected saveServer: SaveServer; @@ -27,4 +27,3 @@ declare class LauncherCallbacks { getLoadedServerMods(): string; getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string; } -export { LauncherCallbacks }; diff --git a/TypeScript/9RouterHooks/types/callbacks/ModCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/ModCallbacks.d.ts index 9a28104..6af1e68 100644 --- a/TypeScript/9RouterHooks/types/callbacks/ModCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/ModCallbacks.d.ts @@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; -declare class ModCallbacks implements OnLoad { +export declare class ModCallbacks implements OnLoad { protected logger: ILogger; protected httpResponse: HttpResponseUtil; protected httpFileUtil: HttpFileUtil; @@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad { onLoad(): Promise; getRoute(): string; } -export { ModCallbacks }; diff --git a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts index f696603..02e2127 100644 --- a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts @@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { PlayerService } from "@spt-aki/services/PlayerService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; @@ -49,10 +51,11 @@ export declare class InventoryController { protected profileHelper: ProfileHelper; protected paymentHelper: PaymentHelper; protected localisationService: LocalisationService; + protected playerService: PlayerService; protected lootGenerator: LootGenerator; protected eventOutputHolder: EventOutputHolder; protected httpResponseUtil: HttpResponseUtil; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil); /** * Move Item * change location of item with parentId and slotId @@ -162,6 +165,7 @@ export declare class InventoryController { * @returns response */ examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse; + protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void; /** * Get the tplid of an item from the examine request object * @param body response request @@ -217,4 +221,5 @@ export declare class InventoryController { * @returns IItemEventRouterResponse */ openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse; + redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts index 2ddafc9..80b1ff6 100644 --- a/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RagfairController.d.ts @@ -84,7 +84,7 @@ export declare class RagfairController { * @param offers ragfair offers to get categories for * @returns record with tpls + counts */ - protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; + protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Add Required offers to offers result * @param searchRequest Client search request data diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index 9743855..7068128 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -61,7 +61,9 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} sessionId Player's session id + * @param {string} _info Request from client + * @param {string} sessionID Player's session id + * * @returns {array} array of "repeatableQuestObjects" as descibed above */ getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; diff --git a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts index 8812b1f..3824e2b 100644 --- a/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/TradeController.d.ts @@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -declare class TradeController { +export declare class TradeController { protected logger: ILogger; protected eventOutputHolder: EventOutputHolder; protected tradeHelper: TradeHelper; @@ -63,4 +63,3 @@ declare class TradeController { protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse; } -export { TradeController }; diff --git a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts index d101107..8f7da7a 100644 --- a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts @@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService"; import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator { protected ragfairPriceService: RagfairPriceService; protected localisationService: LocalisationService; protected paymentHelper: PaymentHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected fenceService: FenceService; protected itemHelper: ItemHelper; protected configServer: ConfigServer; @@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator { tpl: string; price: number; }[]; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer); /** * Create a flea offer and store it in the Ragfair server offers array * @param userID Owner of the offer diff --git a/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts index a41d63e..293abb1 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper { */ addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult; /** - * is the provided item allowed inside a container - * @param slot location item wants to be placed in - * @param itemTpl item being placed - * @returns true if allowed + * Is the provided item allowed inside a container + * @param slotGrid Items sub-grid we want to place item inside + * @param itemTpl Item tpl being placed + * @returns True if allowed */ - protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; } diff --git a/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts index 43b0ec5..1e7dffa 100644 --- a/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HandbookHelper.d.ts @@ -1,3 +1,4 @@ +import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; declare class LookupItem { @@ -59,5 +60,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; + getCategoryById(handbookId: string): Category; } export {}; diff --git a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts index bcc77e8..b2bba8c 100644 --- a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts @@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +import { TimeUtil } from "@spt-aki/utils/TimeUtil"; import { ProfileHelper } from "./ProfileHelper"; export declare class InRaidHelper { protected logger: ILogger; + protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected jsonUtil: JsonUtil; protected itemHelper: ItemHelper; @@ -31,7 +33,7 @@ export declare class InRaidHelper { protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config * @returns True if items should be removed from inventory @@ -60,7 +62,6 @@ export declare class InRaidHelper { * Reset a profile to a baseline, used post-raid * Reset points earned during session property * Increment exp - * Remove Labs keycard * @param profileData Profile to update * @param saveProgressRequest post raid save data request data * @param sessionID Session id @@ -89,13 +90,13 @@ export declare class InRaidHelper { */ updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; /** - * Look for quests with status = fail that were not failed pre-raid and run the failQuest() function + * Look for quests with a status different from what it began the raid with * @param sessionId Player id * @param pmcData Player profile * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client + * @param postRaidProfile Profile sent by client with post-raid quests */ - protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; + protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; /** * Take body part effects from client profile and apply to server profile * @param saveProgressRequest post-raid request diff --git a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts index be5d92d..c7daa8c 100644 --- a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts @@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { ObjectId } from "@spt-aki/utils/ObjectId"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; -declare class ItemHelper { +export declare class ItemHelper { protected logger: ILogger; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; @@ -355,4 +355,4 @@ declare namespace ItemHelper { height: number; } } -export { ItemHelper }; +export {}; diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts index 9797257..55e6fe8 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairHelper.d.ts @@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper"; import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; -import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult"; import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -30,14 +29,19 @@ export declare class RagfairHelper { * @returns string */ getCurrencyTag(currency: string): string; - filterCategories(sessionID: string, info: ISearchRequestData): string[]; + filterCategories(sessionID: string, request: ISearchRequestData): string[]; getDisplayableAssorts(sessionID: string): Record; protected getCategoryList(handbookId: string): string[]; - countCategories(result: IGetOffersResult): void; /** * Merges Root Items * Ragfair allows abnormally large stacks. */ mergeStackable(items: Item[]): Item[]; + /** + * Return the symbol for a currency + * e.g. 5449016a4bdc2d6f028b456f return ₽ + * @param currencyTpl currency to get symbol for + * @returns symbol of currency + */ getCurrencySymbol(currencyTpl: string): string; } diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts index 4dcb016..7a4de8a 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairSellHelper.d.ts @@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; export declare class RagfairSellHelper { protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; + protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected ragfairConfig: IRagfairConfig; - constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); /** * Get the percent chance to sell an item based on its average listed price vs player chosen listing price * @param averageOfferPriceRub Price of average offer in roubles @@ -19,13 +21,6 @@ export declare class RagfairSellHelper { * @returns percent value */ calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number; - /** - * Get percent chance to sell an item when price is below items average listing price - * @param playerListedPriceRub Price player listed item for in roubles - * @param averageOfferPriceRub Price of average offer in roubles - * @returns percent value - */ - protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number; /** * Get array of item count and sell time (empty array = no sell) * @param sellChancePercent chance item will sell diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts index 734aa9d..4d2d4c4 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairServerHelper.d.ts @@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil"; * Helper class for common ragfair server actions */ export declare class RagfairServerHelper { + protected logger: ILogger; protected randomUtil: RandomUtil; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; @@ -38,7 +40,7 @@ export declare class RagfairServerHelper { protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; protected static goodsReturnedTemplate: string; - constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer); /** * Is item valid / on blacklist / quest item * @param itemDetails @@ -76,14 +78,29 @@ export declare class RagfairServerHelper { */ getDynamicOfferCurrency(): string; getMemberType(userID: string): MemberCategory; + /** + * Get a player or traders nickname from their profile by their user id + * @param userID Sessionid/userid + * @returns Nickname of individual + */ getNickname(userID: string): string; - getPresetItems(item: any): Item[]; + /** + * Given a preset id from globals.json, return an array of items[] with unique ids + * @param item Preset item + * @returns Array of weapon and its children + */ + getPresetItems(item: Item): Item[]; + /** + * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json + * @param item Preset item + * @returns + */ getPresetItemsByTpl(item: Item): Item[]; /** - * Generate new unique ids for the children while preserving hierarchy - * @param item base item - * @param preset + * Generate new unique ids for child items while preserving hierarchy + * @param rootItem Base/primary item of preset + * @param preset Primary item + children of primary item * @returns Item array with new IDs */ - reparentPresets(item: Item, preset: Item[]): Item[]; + reparentPresets(rootItem: Item, preset: Item[]): Item[]; } diff --git a/TypeScript/9RouterHooks/types/helpers/RepairHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RepairHelper.d.ts index 6438b66..9ef0eaa 100644 --- a/TypeScript/9RouterHooks/types/helpers/RepairHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RepairHelper.d.ts @@ -25,12 +25,22 @@ export declare class RepairHelper { * @param applyMaxDurabilityDegradation should item have max durability reduced */ updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; - protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; /** - * Is the supplied tpl a weapon - * @param tpl tplId to check is a weapon - * @returns true if tpl is a weapon + * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material + * @param armorMaterial What material is the armor being repaired made of + * @param isRepairKit Was a repair kit used + * @param armorMax Max amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by */ - isWeaponTemplate(tpl: string): boolean; + protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number; + /** + * Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount + * @param itemProps Weapon properties + * @param isRepairKit Was a repair kit used + * @param weaponMax ax amount of durability item can have + * @param traderQualityMultipler Different traders produce different loss values + * @returns Amount to reduce max durability by + */ + protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/TypeScript/9RouterHooks/types/helpers/SecureContainerHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/SecureContainerHelper.d.ts index 9d1efec..36b227c 100644 --- a/TypeScript/9RouterHooks/types/helpers/SecureContainerHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/SecureContainerHelper.d.ts @@ -9,5 +9,10 @@ export interface OwnerInventoryItems { export declare class SecureContainerHelper { protected itemHelper: ItemHelper; constructor(itemHelper: ItemHelper); + /** + * Get an array of the item IDs (NOT tpls) inside a secure container + * @param items Inventory items to look for secure container in + * @returns Array of ids + */ getSecureContainerItems(items: Item[]): string[]; } diff --git a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts index 933495c..bf8360d 100644 --- a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts @@ -53,5 +53,11 @@ export declare class TradeHelper { * @param itemsPurchasedCount number of items being bought */ protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; + /** + * Traders allow a limited number of purchases per refresh cycle (default 60 mins) + * @param assortBeingPurchased the item from trader being bought + * @param assortId Id of assort being purchased + * @param count How many are being bought + */ protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts index 162af73..0b6effb 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderAssortHelper.d.ts @@ -44,6 +44,7 @@ export declare class TraderAssortHelper { * Filter out assorts not unlocked due to level OR quest completion * @param sessionId session id * @param traderId traders id + * @param flea Should assorts player hasn't unlocked be returned - default false * @returns a traders' assorts */ getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort; diff --git a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts index f6b4bd2..8d8da00 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts @@ -63,6 +63,12 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; + /** + * Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc) + * @param traderId Trader id to get standing for + * @param rawProfileTemplate Raw profile from profiles.json to look up standing from + * @returns Standing value + */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; /** * Alter a traders unlocked status diff --git a/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts index 8d81024..ab42805 100644 --- a/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/WeightedRandomHelper.d.ts @@ -8,6 +8,11 @@ export declare class WeightedRandomHelper { getWeightedInventoryItem(itemArray: { [tplId: string]: unknown; } | ArrayLike): string; + /** + * Choos an item from the passed in array based on the weightings of each + * @param itemArray Items and weights to use + * @returns Chosen item from array + */ getWeightedValue(itemArray: { [key: string]: unknown; } | ArrayLike): T; diff --git a/TypeScript/9RouterHooks/types/models/eft/inventory/IRedeemProfileRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/inventory/IRedeemProfileRequestData.d.ts new file mode 100644 index 0000000..d351a8c --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/inventory/IRedeemProfileRequestData.d.ts @@ -0,0 +1,9 @@ +import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData"; +export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData { + Action: "RedeemProfileReward"; + events: IRedeemProfileRequestEvent[]; +} +export interface IRedeemProfileRequestEvent { + MessageId: string; + EventId: string; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts index a4971b6..78302ee 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/IAkiProfile.d.ts @@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"; import { MessageType } from "@spt-aki/models/enums/MessageType"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; export interface IAkiProfile { info: Info; characters: Characters; @@ -95,7 +96,7 @@ export interface Message { items?: MessageItems; maxStorageTime?: number; systemData?: ISystemData; - profileChangeEvents?: any[]; + profileChangeEvents?: IProfileChangeEvent[]; } export interface MessagePreview { uid: string; diff --git a/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts index 254b410..6aa332b 100644 --- a/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts @@ -21,7 +21,10 @@ export declare enum Ammo762x54 { PS_GZH = "59e77a2386f7742ee578960a", T46M_GZH = "5e023cf8186a883be655e54f", BT_GZH = "5e023d34e8a400319a28ed44", - BS_GZH = "5e023d48186a883be655e551" + BS_GZH = "5e023d48186a883be655e551", + FMJ = "64b8f7968532cf95ee0a0dbf", + SP_BT = "64b8f7b5389d7ffd620ccba2", + HP_BT = "64b8f7c241772715af0f9c3d" } export declare enum Ammo86x70 { TAC_X = "5fc382b6d6fa9c00c571bbc3", @@ -33,7 +36,8 @@ export declare enum Ammo46x30 { AP_SX = "5ba26835d4351e0035628ff5", ACTION_SX = "5ba26812d4351e003201fef1", FMJ_SX = "5ba2678ad4351e44f824b344", - SUBSONIC_SX = "5ba26844d4351e00334c9475" + SUBSONIC_SX = "5ba26844d4351e00334c9475", + JSP_SX = "64b6979341772715af0f9c39" } export declare enum Ammo57x28 { SS198LF = "5cc80f79e4a949033c7343b2", @@ -77,7 +81,8 @@ export declare enum Ammo9x19 { AP_63 = "5c925fa22e221601da359b7b", LUGER_CCI = "5a3c16fe86f77452b62de32a", PBP_GZH = "5efb0da7a29a85116f6ea05f", - QUAKEMAKER = "5efb0e16aeb21837e749c7ff" + QUAKEMAKER = "5efb0e16aeb21837e749c7ff", + FMJ_M882 = "64b7bbb74b75259c590fa897" } export declare enum Ammo9x21 { P_GZH = "5a26abfac4a28232980eabff", @@ -131,7 +136,8 @@ export declare enum Ammo762x35 { BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", AP = "5fd20ff893a8961fc660a954", V_MAX = "6196364158ef8c428c287d9f", - WHISPER = "6196365d58ef8c428c287da1" + WHISPER = "6196365d58ef8c428c287da1", + CBJ = "64b8725c4b75259c590fa899" } export declare enum Ammo762x39 { PS_GZH = "5656d7c34bdc2d9d198b4587", @@ -139,7 +145,10 @@ export declare enum Ammo762x39 { US_GZH = "59e4d24686f7741776641ac7", T45M1_GZH = "59e4cf5286f7741778269d8a", BP_GZH = "59e0d99486f7744a32234762", - MAI_AP = "601aa3d2b2bcb34913271e6d" + MAI_AP = "601aa3d2b2bcb34913271e6d", + PP_GZH = "64b7af434b75259c590fa893", + SP = "64b7af734b75259c590fa895", + FMJ = "64b7af5a8532cf95ee0a0dbd" } export declare enum Ammo9x39 { SP5_GS = "57a0dfb82459774d3078b56c", @@ -175,7 +184,8 @@ export declare enum Ammo12Gauge { GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde", SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845", COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5", - LEAD_SLUG = "58820d1224597753c90aeb13" + LEAD_SLUG = "58820d1224597753c90aeb13", + PIRANHA = "64b8ee384b75259c590fa89b" } export declare enum Ammo20Gauge { BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b", diff --git a/TypeScript/9RouterHooks/types/models/enums/ItemAddedResult.d.ts b/TypeScript/9RouterHooks/types/models/enums/ItemAddedResult.d.ts index 6c8a1cf..8eafb90 100644 --- a/TypeScript/9RouterHooks/types/models/enums/ItemAddedResult.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/ItemAddedResult.d.ts @@ -2,5 +2,6 @@ export declare enum ItemAddedResult { UNKNOWN = -1, SUCCESS = 1, NO_SPACE = 2, - NO_CONTAINERS = 3 + NO_CONTAINERS = 3, + INCOMPATIBLE_ITEM = 4 } diff --git a/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts b/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts index 4b3e9ef..f43d4ba 100644 --- a/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/ItemEventActions.d.ts @@ -22,5 +22,6 @@ export declare enum ItemEventActions { REMOVE_WEAPON_BUILD = "RemoveWeaponBuild", REMOVE_BUILD = "RemoveBuild", SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild", - REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild" + REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", + REDEEM_PROFILE_REWARD = "RedeemProfileReward" } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts index e2a299c..b73761b 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts @@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType"; import { Traders } from "@spt-aki/models/enums/Traders"; import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; +import { IProfileChangeEvent } from "../dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "aki-gifts"; gifts: Record; @@ -25,4 +26,6 @@ export interface Gift { timestampToSend?: number; associatedEvent: SeasonalEventType; collectionTimeHours: number; + /** Optional, can be used to change profile settings like level/skills */ + profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts index 43ee964..14d77f1 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts @@ -19,15 +19,18 @@ export interface Sell { time: Time; /** Player offer reputation gain/loss settings */ reputation: Reputation; - /** How many hours are simulated to figure out if player offer was sold */ - simulatedSellHours: number; /**Seconds from clicking remove to remove offer from market */ expireSeconds: number; } export interface Chance { + /** Base chance percent to sell an item */ base: number; - overpriced: number; - underpriced: number; + /** Value to multiply the sell chance by */ + sellMultiplier: number; + /** Max possible sell chance % for a player listed offer */ + maxSellChancePercent: number; + /** Min possible sell chance % for a player listed offer */ + minSellChancePercent: number; } export interface Time extends MinMax { base: number; @@ -129,7 +132,7 @@ export interface Blacklist { enableBsgList: boolean; /** Should quest items be blacklisted from flea */ enableQuestList: boolean; - /** Should trader items that are blacklisted by bsg */ + /** Should trader items that are blacklisted by bsg be listed on flea */ traderItems: boolean; } export interface IUnreasonableModPrices { diff --git a/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts index eee6424..2068ede 100644 --- a/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -25,6 +25,12 @@ export interface ISendMessageDetails { systemData?: ISystemData; /** Optional - Used by ragfair messages */ ragfairDetails?: MessageContentRagfair; - /** Optional - Usage not known, unsure of purpose, even dumps dont have it */ - profileChangeEvents?: any[]; + /** OPTIONAL - allows modification of profile settings via mail */ + profileChangeEvents?: IProfileChangeEvent[]; +} +export interface IProfileChangeEvent { + _id: string; + Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + value: number; + entity?: string; } diff --git a/TypeScript/9RouterHooks/types/servers/RagfairServer.d.ts b/TypeScript/9RouterHooks/types/servers/RagfairServer.d.ts index 35eb9e7..f6f9730 100644 --- a/TypeScript/9RouterHooks/types/servers/RagfairServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/RagfairServer.d.ts @@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -27,9 +28,8 @@ export declare class RagfairServer { * Get traders who need to be periodically refreshed * @returns string array of traders */ - protected getUpdateableTraders(): string[]; - getAllCategories(): Record; - getBespokeCategories(offers: IRagfairOffer[]): Record; + getUpdateableTraders(): string[]; + getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record; /** * Disable/Hide an offer from flea * @param offerId diff --git a/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts b/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts index 6ddc3ac..e0bf025 100644 --- a/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/WebSocketServer.d.ts @@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; export declare class WebSocketServer { protected logger: ILogger; protected randomUtil: RandomUtil; @@ -16,7 +17,8 @@ export declare class WebSocketServer { protected localisationService: LocalisationService; protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; - constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); + protected profileHelper: ProfileHelper; + constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper); protected httpConfig: IHttpConfig; protected defaultNotification: INotification; protected webSockets: Record; diff --git a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts index 202a6b4..08752bf 100644 --- a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts +++ b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to diff --git a/TypeScript/9RouterHooks/types/services/RagfairCategoriesService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairCategoriesService.d.ts index c24d57d..ef40275 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairCategoriesService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairCategoriesService.d.ts @@ -1,40 +1,17 @@ +import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; +import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; export declare class RagfairCategoriesService { protected logger: ILogger; - protected categories: Record; - constructor(logger: ILogger); + protected paymentHelper: PaymentHelper; + constructor(logger: ILogger, paymentHelper: PaymentHelper); /** - * Get all flea categories and their count of offers - * @returns item categories and count + * Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy + * @param offers All offers in flea + * @param searchRequestData Search criteria requested + * @param fleaUnlocked Can player see full flea yet (level 15 by default) + * @returns KVP of item tpls + count of offers */ - getAllCategories(): Record; - /** - * With the supplied items, get custom categories - * @returns a custom list of categories - */ - getBespokeCategories(offers: IRagfairOffer[]): Record; - /** - * Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count - * @param offers ragfair offers - * @returns categories and count - */ - protected processOffersIntoCategories(offers: IRagfairOffer[]): Record; - /** - * Increment or decrement a category array - * @param offer Offer to process - * @param categories Categories to update - * @param increment (Optional) Should item be incremented or decremented - */ - protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record, increment?: boolean): void; - /** - * Increase category count by 1 - * @param offer - */ - incrementCategory(offer: IRagfairOffer): void; - /** - * Reduce category count by 1 - * @param offer - */ - decrementCategory(offer: IRagfairOffer): void; + getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record; } diff --git a/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts index 5c22ad2..ce86ee3 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairOfferService.d.ts @@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; -import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -20,7 +19,6 @@ export declare class RagfairOfferService { protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; - protected ragfairCategoriesService: RagfairCategoriesService; protected profileHelper: ProfileHelper; protected eventOutputHolder: EventOutputHolder; protected httpResponse: HttpResponseUtil; @@ -30,7 +28,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer); /** * Get all offers * @returns IRagfairOffer array diff --git a/TypeScript/9RouterHooks/types/services/RepairService.d.ts b/TypeScript/9RouterHooks/types/services/RepairService.d.ts index b9e6151..cb0070f 100644 --- a/TypeScript/9RouterHooks/types/services/RepairService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RepairService.d.ts @@ -56,6 +56,7 @@ export declare class RepairService { * @param pmcData Profile to add points to */ addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void; + protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number; /** * Return an appromixation of the amount of skill points live would return for the given repairDetails * @param repairDetails the repair details to calculate skill points for