diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/13AddTrader/types/services/FenceService.d.ts b/TypeScript/13AddTrader/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/13AddTrader/types/services/FenceService.d.ts +++ b/TypeScript/13AddTrader/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/15HttpListenerExample/types/helpers/HealthHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HealthHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/16ImporterUtil/types/helpers/HealthHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HealthHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HealthHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HealthHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HealthHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HealthHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/18CustomItemService/types/helpers/HealthHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/18CustomItemService/types/helpers/HealthHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/18CustomItemService/types/services/FenceService.d.ts b/TypeScript/18CustomItemService/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/18CustomItemService/types/services/FenceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HealthHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HealthHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/1LogToConsole/types/services/FenceService.d.ts b/TypeScript/1LogToConsole/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/1LogToConsole/types/services/FenceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/20CustomChatBot/types/helpers/HealthHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/20CustomChatBot/types/helpers/HealthHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/HealthHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/HealthHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/22CustomAkiCommand/types/helpers/HealthHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/HealthHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/2EditDatabase/types/services/FenceService.d.ts b/TypeScript/2EditDatabase/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/2EditDatabase/types/services/FenceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HealthHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HealthHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index 4d46ab0..df1718e 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -148,11 +148,12 @@ export declare class RepeatableQuestController { changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** - * Some accounts have access to repeatable quest refreshes for free + * Some accounts have access to free repeatable quest refreshes * Track the usage of them inside players profile - * @param fullProfile Profile of player - * @param repeatableSubType Can be daily/weekly/scav repeatables - * @param repeatableTypeName Subtype of repeatables: daily / weekly / scav + * @param fullProfile Player profile + * @param repeatableSubType Can be daily / weekly / scav repeatable + * @param repeatableTypeName Subtype of repeatable quest: daily / weekly / scav + * @returns Is the repeatable being replaced for free */ - protected handleFreeRefreshUses(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): void; + protected useFreeRefreshIfAvailable(fullProfile: ISptProfile, repeatableSubType: IPmcDataRepeatableQuest, repeatableTypeName: string): boolean; } diff --git a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts index 707ba95..2c7801b 100644 --- a/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RagfairOfferGenerator.d.ts @@ -170,7 +170,7 @@ export declare class RagfairOfferGenerator { * @param tpl Item to look for matching condition object * @returns condition id */ - protected getDynamicConditionIdForTpl(tpl: string): string; + protected getDynamicConditionIdForTpl(tpl: string): string | undefined; /** * Alter an items condition based on its item base type * @param conditionSettingsId also the parentId of item being altered diff --git a/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts index 7fb646c..650f633 100644 --- a/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts @@ -22,12 +22,12 @@ export declare class HealthHelper { */ resetVitality(sessionID: string): ISptProfile; /** - * Update player profile with changes from request object + * Update player profile vitality values with changes from client request object * @param pmcData Player profile * @param request Heal request * @param sessionID Session id - * @param addEffects Should effects be added or removed (default - add) - * @param deleteExistingEffects Should all prior effects be removed before apply new ones + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** diff --git a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts index 5269646..f0ff69a 100644 --- a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts @@ -9,9 +9,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; -import { AddItem } from "@spt/models/eft/inventory/IAddItemRequestData"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; -import { IAddItemTempObject } from "@spt/models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "@spt/models/eft/inventory/IInventoryMoveRequestData"; import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventoryRemoveRequestData"; @@ -106,19 +104,12 @@ export declare class InventoryHelper { * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots * @param sortingTableFS2D 2-dimensional representation of the sorting table slots - * @param itemWithChildren Item to place - * @param playerInventory + * @param itemWithChildren Item to place with children + * @param playerInventory Players inventory * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; - /** - * Split an items stack size based on its StackMaxSize value - * @param assortItems Items to add to inventory - * @param requestItem Details of purchased item to add to inventory - * @param result Array split stacks are appended to - */ - protected splitStackIntoSmallerChildStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -154,6 +145,14 @@ export declare class InventoryHelper { * @returns [width, height] */ getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + /** + * Calculates the size of an item including attachements + * takes into account if item is folded + * @param itemTpl Items template id + * @param itemID Items id + * @param inventoryItemHash Hashmap of inventory items + * @returns An array representing the [width, height] of the item + */ protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; /** * Get a blank two-dimentional representation of a container diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts index a8c969c..d60b496 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts @@ -27,7 +27,8 @@ export interface FenceConfig { presetPriceMult: number; armorMaxDurabilityPercentMinMax: IItemDurabilityCurrentMax; weaponDurabilityPercentMinMax: IItemDurabilityCurrentMax; - chancePlateExistsInArmorPercent: number; + /** Keyed to plate protection level */ + chancePlateExistsInArmorPercent: Record; /** Key: item tpl */ itemStackSizeOverrideMinMax: Record; itemTypeLimits: Record; diff --git a/TypeScript/9RouterHooks/types/services/FenceService.d.ts b/TypeScript/9RouterHooks/types/services/FenceService.d.ts index 786573f..c156122 100644 --- a/TypeScript/9RouterHooks/types/services/FenceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/FenceService.d.ts @@ -4,7 +4,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -254,6 +254,19 @@ export declare class FenceService { * @param itemDbDetails Armor items db template */ protected randomiseArmorModDurability(armor: Item[], itemDbDetails: ITemplateItem): void; + /** + * Randomise the durability values of items on armor with a passed in slot + * @param softInsertSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorSoftInsertDurabilities(softInsertSlots: Slot[], armorItemAndMods: Item[]): void; + /** + * Randomise the durability values of plate items in armor + * Has chance to remove plate + * @param plateSlots Slots of items to randomise + * @param armorItemAndMods Array of armor + inserts to get items from + */ + protected randomiseArmorInsertsDurabilities(plateSlots: Slot[], armorItemAndMods: Item[]): void; /** * Get stack size of a singular item (no mods) * @param itemDbDetails item being added to fence