From bb1fe2e42282d12d1ef11ab3ffb45bf18f1e2359 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 5 Sep 2023 14:22:50 +0100 Subject: [PATCH] Update types for 370 --- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../13AddTrader/types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../7OnLoadHook/types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- .../types/callbacks/InventoryCallbacks.d.ts | 4 ++- .../controllers/InventoryController.d.ts | 1 + .../types/helpers/HideoutHelper.d.ts | 12 ++++++++- .../types/helpers/InRaidHelper.d.ts | 2 ++ .../types/helpers/InventoryHelper.d.ts | 3 +++ .../types/helpers/ItemHelper.d.ts | 8 ++++++ .../types/models/spt/config/IBotConfig.d.ts | 15 ++++++++--- .../models/spt/config/IInRaidConfig.d.ts | 2 ++ .../models/spt/config/ILocationConfig.d.ts | 2 ++ .../services/BotEquipmentFilterService.d.ts | 27 ++++++++++--------- 190 files changed, 1102 insertions(+), 342 deletions(-) diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts b/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts b/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts b/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/18CustomItemService/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored diff --git a/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts index e9f7cf3..5d4b51d 100644 --- a/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/InventoryCallbacks.d.ts @@ -21,9 +21,11 @@ import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRout export declare class InventoryCallbacks { protected inventoryController: InventoryController; constructor(inventoryController: InventoryController); - /** Handle "move" */ + /** Handle Move event */ moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Remove event */ removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse; + /** Handle Split event */ splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse; mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse; transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse; diff --git a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts index 89909e8..5e7d19a 100644 --- a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts @@ -76,6 +76,7 @@ export declare class InventoryController { */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; /** + * Handle Remove event * Implements functionality "Discard" from Main menu (Stash etc.) * Removes item from PMC Profile */ diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index 4b0148f..80ac27c 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -149,6 +149,16 @@ export declare class HideoutHelper { * @returns Updated HideoutArea object */ protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; + /** + * Get an adjusted water filter drain rate based on time elapsed since last run, + * handle edge case when craft time has gone on longer than total production time + * @param secondsSinceServerTick Time passed + * @param totalProductionTime Total time collecting water + * @param productionProgress how far water collector has progressed + * @param baseFilterDrainRate Base drain rate + * @returns + */ + protected adjustWaterFilterDrainRate(secondsSinceServerTick: number, totalProductionTime: number, productionProgress: number, baseFilterDrainRate: number): number; /** * Get the water filter drain rate based on hideout bonues player has * @param pmcData Player profile @@ -160,7 +170,7 @@ export declare class HideoutHelper { * @param prodId Id, e.g. Water collector id * @returns seconds to produce item */ - protected getProductionTimeSeconds(prodId: string): number; + protected getTotalProductionTimeSeconds(prodId: string): number; /** * Create a upd object using passed in parameters * @param stackCount diff --git a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts index 0157f9d..a0987bc 100644 --- a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts @@ -2,6 +2,7 @@ import { IPmcData, IPostRaidPmcData } from "../models/eft/common/IPmcData"; import { Quest, TraderInfo, Victim } from "../models/eft/common/tables/IBotBase"; import { Item } from "../models/eft/common/tables/IItem"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; +import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "../models/spt/config/ILostOnDeathConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -27,6 +28,7 @@ export declare class InRaidHelper { protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; protected lostOnDeathConfig: ILostOnDeathConfig; + protected inRaidConfig: IInRaidConfig; constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer); /** * Lookup quest item loss from lostOnDeath config diff --git a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts index 6e77109..3215426 100644 --- a/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InventoryHelper.d.ts @@ -4,6 +4,7 @@ import { AddItem, IAddItemRequestData } from "../models/eft/inventory/IAddItemRe import { IAddItemTempObject } from "../models/eft/inventory/IAddItemTempObject"; import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData"; import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData"; +import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData"; import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IInventoryConfig, RewardDetails } from "../models/spt/config/IInventoryConfig"; @@ -80,6 +81,7 @@ export declare class InventoryHelper { */ protected splitStackIntoSmallerStacks(assortItems: Item[], requestItem: AddItem, result: IAddItemTempObject[]): void; /** + * Handle Remove event * Remove item from player inventory + insured items array * Also deletes child items * @param pmcData Profile to remove item from @@ -89,6 +91,7 @@ export declare class InventoryHelper { * @returns IItemEventRouterResponse */ removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; + removeItemAndChildrenFromMailRewards(sessionId: string, removeRequest: IInventoryRemoveRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): number[]; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): number[]; diff --git a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts index 47fe9ab..99fca56 100644 --- a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts @@ -237,6 +237,14 @@ declare class ItemHelper { * @param ammoBoxDetails Item template from items db */ addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + /** + * Check if item is stored inside of a container + * @param item Item to check is inside of container + * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack + * @param items Inventory with child parent items to check + * @returns True when item is in container + */ + itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index 0b8f512..6bca539 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -74,13 +74,19 @@ export interface LootNvalue { export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ weaponModLimits: ModLimits; - /** Whitelsit for weapons allowed per gun */ + /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; + /** Chance face shield is down/active */ faceShieldIsActiveChancePercent?: number; + /** Chance gun flashlight is active during the day */ lightIsActiveDayChancePercent?: number; + /** Chance gun flashlight is active during the night */ lightIsActiveNightChancePercent?: number; + /** Chance gun laser is active during the day */ laserIsActiveChancePercent?: number; + /** Chance NODS are down/active during the day */ nvgIsActiveChanceDayPercent?: number; + /** Chance NODS are down/active during the night */ nvgIsActiveChanceNightPercent?: number; /** Adjust weighting/chances of items on bot by level of bot */ randomisation: RandomisationDetails[]; @@ -88,9 +94,10 @@ export interface EquipmentFilters { blacklist: EquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ whitelist: EquipmentFilterDetails[]; - clothing: WeightingAdjustmentDetails[]; - /** Adjust clothing choice weighting by level of bot */ - weightingAdjustments: WeightingAdjustmentDetails[]; + /** Adjust equipment/ammo */ + weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + /** Same as weightingAdjustments but based on player level instead of bot level */ + weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts index c8fa57e..3d3b1a2 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts @@ -12,6 +12,8 @@ export interface IInRaidConfig extends IBaseConfig { carExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ scavExtractGain: number; + /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ + keepFiRSecureContainerOnDeath: boolean; } export interface RaidMenuSettings { aiAmount: string; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts index 41b9593..16bb7c2 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts @@ -35,6 +35,8 @@ export interface ILocationConfig extends IBaseConfig { minFillStaticMagazinePercent: number; makeWishingTreeAlwaysGiveGift: boolean; allowDuplicateItemsInStaticContainers: boolean; + /** Key: map, value: loose loot ids to ignore */ + looseLootBlacklist: Record; } export interface IContainerRandomistionSettings { enabled: boolean; diff --git a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts index 026d783..0b8cf61 100644 --- a/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotEquipmentFilterService.d.ts @@ -1,4 +1,5 @@ import { BotHelper } from "../helpers/BotHelper"; +import { ProfileHelper } from "../helpers/ProfileHelper"; import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; @@ -7,17 +8,19 @@ import { ConfigServer } from "../servers/ConfigServer"; export declare class BotEquipmentFilterService { protected logger: ILogger; protected botHelper: BotHelper; + protected profileHelper: ProfileHelper; protected configServer: ConfigServer; protected botConfig: IBotConfig; protected botEquipmentConfig: Record; - constructor(logger: ILogger, botHelper: BotHelper, configServer: ConfigServer); + constructor(logger: ILogger, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); /** * Filter a bots data to exclude equipment and cartridges defines in the botConfig + * @param sessionId Players id * @param baseBotNode bots json data to filter * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; /** * Iterate over the changes passed in and alter data in baseValues * @param equipmentChanges Changes to apply @@ -57,19 +60,19 @@ export declare class BotEquipmentFilterService { */ protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails; /** - * Retrieve clothing weighting adjustments from bot.json config + * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for - * @param playerLevel level of player - * @returns Weighting adjustments for bots clothing - */ - protected getBotClothingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; - /** - * Retrieve item weighting adjustments from bot.json config - * @param botRole Bot type to get adjustments for - * @param playerLevel level of player + * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, playerLevel: number): WeightingAdjustmentDetails; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails; + /** + * Retrieve item weighting adjustments from bot.json config based on player level + * @param botRole Bot type to get adjustments for + * @param playerlevel Level of bot + * @returns Weighting adjustments for bot items + */ + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored