3.5.0 type updates

This commit is contained in:
Valens 2023-01-15 00:21:11 -05:00
parent 654f7a0803
commit 08606cd070
23 changed files with 245 additions and 49 deletions

View File

@ -4,7 +4,7 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { Scavs } from "./scavs"; //import { Scavs } from "./scavs";
import { PMCs } from "./pmc"; import { PMCs } from "./pmc";
@ -13,7 +13,7 @@ class ValensProgression implements IPostDBLoadMod
private configServer: ConfigServer; private configServer: ConfigServer;
private botConfig: IBotConfig; private botConfig: IBotConfig;
private databaseServer: DatabaseServer; private databaseServer: DatabaseServer;
private scavs: Scavs; // private scavs: Scavs;
private pmcs: PMCs; private pmcs: PMCs;
public postDBLoad(container: DependencyContainer): void public postDBLoad(container: DependencyContainer): void
@ -24,8 +24,8 @@ class ValensProgression implements IPostDBLoadMod
this.databaseServer = container.resolve<DatabaseServer>("DatabaseServer"); this.databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
this.scavs = new Scavs(this.botConfig, this.databaseServer); // this.scavs = new Scavs(this.botConfig, this.databaseServer);
this.scavs.updateScavs(); // this.scavs.updateScavs();
this.pmcs = new PMCs(this.botConfig, this.databaseServer); this.pmcs = new PMCs(this.botConfig, this.databaseServer);
this.pmcs.updatePmcs(); this.pmcs.updatePmcs();

View File

@ -197,12 +197,88 @@ export class PMCs
const progressionWhitelistLL1PMC: EquipmentFilters = const progressionWhitelistLL1PMC: EquipmentFilters =
{ {
"weaponModLimits": {}, "weaponModLimits": {
"weaponSightWhitelist": {}, "scopeLimit": 1,
"nvgIsActiveChancePercent": 5, "lightLaserLimit": 1
},
"weaponSightWhitelist": {
"5447b5fc4bdc2d87278b4567": ["55818ad54bdc2ddc698b4569", "55818acf4bdc2dde698b456b", "55818ac54bdc2d5b648b456e", "55818add4bdc2d5b648b456f", "55818aeb4bdc2ddc698b456a"],
"5447b5f14bdc2d61278b4567": ["55818ad54bdc2ddc698b4569", "55818acf4bdc2dde698b456b", "55818ac54bdc2d5b648b456e", "55818add4bdc2d5b648b456f", "55818aeb4bdc2ddc698b456a"],
"5447bedf4bdc2d87278b4568": ["55818ad54bdc2ddc698b4569", "55818add4bdc2d5b648b456f", "55818aeb4bdc2ddc698b456a"],
"5447bed64bdc2d97278b4568": ["55818ad54bdc2ddc698b4569", "55818acf4bdc2dde698b456b", "55818ac54bdc2d5b648b456e", "55818add4bdc2d5b648b456f", "55818aeb4bdc2ddc698b456a"],
"5447b6194bdc2d67278b4567": ["55818ad54bdc2ddc698b4569", "55818ae44bdc2dde698b456c", "55818ac54bdc2d5b648b456e", "55818aeb4bdc2ddc698b456a", "55818add4bdc2d5b648b456f"],
"5447b5cf4bdc2d65278b4567": ["55818ad54bdc2ddc698b4569", "55818acf4bdc2dde698b456b", "55818ac54bdc2d5b648b456e"],
"617f1ef5e8b54b0998387733": ["55818ad54bdc2ddc698b4569", "55818acf4bdc2dde698b456b", "55818ac54bdc2d5b648b456e"],
"5447b6094bdc2dc3278b4567": ["55818ad54bdc2ddc698b4569", "55818acf4bdc2dde698b456b", "55818ac54bdc2d5b648b456e"],
"5447b5e04bdc2d62278b4567": ["55818ad54bdc2ddc698b4569", "55818acf4bdc2dde698b456b", "55818ac54bdc2d5b648b456e"],
"5447b6254bdc2dc3278b4568": ["55818ae44bdc2dde698b456c", "55818ac54bdc2d5b648b456e", "55818aeb4bdc2ddc698b456a", "55818add4bdc2d5b648b456f"]
},
"nvgIsActiveChancePercent": 50,
"faceShieldIsActiveChancePercent": 85, "faceShieldIsActiveChancePercent": 85,
"lightLaserIsActiveChancePercent": 75, "lightLaserIsActiveChancePercent": 75,
"randomisation": [], "randomisation": [{
"levelRange": {
"min": 1,
"max": 14
},
"generation": {
"drugs": {"min": 0, "max": 1},
"grenades": {"min": 0, "max": 1},
"healing": {"min": 0, "max": 1},
"looseLoot": {"min": 0, "max": 5},
"magazines": {"min": 1, "max": 2},
"stims": {"min": 0, "max": 0}
},
"equipment": {
"ArmBand": 90,
"FirstPrimaryWeapon": 80,
"Holster": 5,
"Earpiece": 35,
"Eyewear": 5,
"Backpack": 30,
"FaceCover": 5
},
"mods": {
"mod_barrel": 20,
"mod_bipod": 10,
"mod_flashlight": 5,
"mod_foregrip": 15,
"mod_handguard": 25,
"mod_launcher": 0,
"mod_magazine": 25,
"mod_mount": 15,
"mod_mount_000": 15,
"mod_mount_001": 15,
"mod_mount_002": 15,
"mod_mount_003": 15,
"mod_mount_004": 15,
"mod_mount_005": 15,
"mod_mount_006": 15,
"mod_muzzle": 10,
"mod_muzzle_000": 10,
"mod_muzzle_001": 10,
"mod_equipment": 5,
"mod_equipment_000": 10,
"mod_equipment_001": 5,
"mod_equipment_002": 0,
"mod_nvg": 0,
"mod_pistol_grip_akms": 15,
"mod_pistol_grip": 10,
"mod_scope": 15,
"mod_scope_000": 15,
"mod_scope_001": 15,
"mod_scope_002": 15,
"mod_scope_003": 15,
"mod_tactical": 10,
"mod_tactical001": 10,
"mod_tactical002": 10,
"mod_tactical_000": 10,
"mod_tactical_001": 10,
"mod_tactical_002": 10,
"mod_tactical_003": 10,
"mod_tactical_2": 10
}
}],
"blacklist": [], "blacklist": [],
"weightingAdjustments": [], "weightingAdjustments": [],
"whitelist": [{ "whitelist": [{

View File

@ -91,8 +91,9 @@ export declare class HideoutController {
* Add generated scav case rewards to player profile * Add generated scav case rewards to player profile
* @param pmcData player profile to add rewards to * @param pmcData player profile to add rewards to
* @param rewards reward items to add to profile * @param rewards reward items to add to profile
* @param recipieId recipie id to save into Production dict
*/ */
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void; protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void;
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse; protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;

View File

@ -129,9 +129,14 @@ export declare class InventoryController {
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; protected getExaminedItemTpl(body: IInventoryExamineRequestData): string;
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handles sorting of Inventory. * Handle ApplyInventoryChanges
* Sorts supplied items.
* @param pmcData Player profile
* @param request sort request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/ */
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse; sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse; createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse; deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse; editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -103,6 +103,11 @@ export declare class RagfairController {
* @param profile full profile of player * @param profile full profile of player
*/ */
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void; protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
/**
* Adjust ragfair offer stack count to match same value as traders assort stack count
* @param offer Flea offer to adjust
*/
protected setTraderOfferStackSize(offer: IRagfairOffer): void;
protected isLinkedSearch(info: ISearchRequestData): boolean; protected isLinkedSearch(info: ISearchRequestData): boolean;
protected isRequiredSearch(info: ISearchRequestData): boolean; protected isRequiredSearch(info: ISearchRequestData): boolean;
update(): void; update(): void;

View File

@ -239,13 +239,14 @@ export declare class RepeatableQuestController {
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
/** /**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @param repeatableQuestConfig config file
* @returns a list of rewardable items [[_tpl, itemTemplate],...] * @returns a list of rewardable items [[_tpl, itemTemplate],...]
*/ */
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][]; protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {*} tpl template id of item to check * @param {string} tpl template id of item to check
* @returns boolean: true if item is valid reward * @returns boolean: true if item is valid reward
*/ */
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean; isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;

View File

@ -103,7 +103,34 @@ export declare class RagfairOfferGenerator {
* @param traderID Trader to generate offers for * @param traderID Trader to generate offers for
*/ */
generateFleaOffersForTrader(traderID: string): void; generateFleaOffersForTrader(traderID: string): void;
protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[]; /**
* Get array of an item with its mods + condition properties (e.g durability)
* Apply randomisation adjustments to condition if item base is found in ragfair.json/dynamic/condition
* @param userID id of owner of item
* @param itemWithMods Item and mods, get condition of first item (only first array item is used)
* @param itemDetails db details of first item
* @returns
*/
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
/**
* Get the relevant condition id if item tpl matches in ragfair.json/condition
* @param tpl Item to look for matching condition object
* @returns condition id
*/
protected getDynamicConditionIdForTpl(tpl: string): string;
/**
* Alter an items condition based on its item base type
* @param conditionSettingsId also the parentId of item being altered
* @param item Item to adjust condition details of
* @param itemDetails db item details of first item in array
*/
protected randomiseItemCondition(conditionSettingsId: string, item: Item, itemDetails: ITemplateItem): void;
/**
* Adjust an items durability/maxDurability value
* @param item item (weapon/armor) to adjust
* @param multiplier Value to multiple durability by
*/
protected randomiseDurabilityValues(item: Item, multiplier: number): void;
/** /**
* Add missing conditions to an item if needed * Add missing conditions to an item if needed
* Durabiltiy for repairable items * Durabiltiy for repairable items
@ -111,7 +138,7 @@ export declare class RagfairOfferGenerator {
* @param item item to add conditions to * @param item item to add conditions to
* @returns Item with conditions added * @returns Item with conditions added
*/ */
protected addMissingCondition(item: Item): Item; protected addMissingConditions(item: Item): Item;
/** /**
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
* @param offerItems Items for sale in offer * @param offerItems Items for sale in offer

View File

@ -23,4 +23,6 @@ export declare class DurabilityLimitsHelper {
protected getMaxWeaponDeltaFromConfig(botRole: string): number; protected getMaxWeaponDeltaFromConfig(botRole: string): number;
protected getMinArmorDeltaFromConfig(botRole: string): number; protected getMinArmorDeltaFromConfig(botRole: string): number;
protected getMaxArmorDeltaFromConfig(botRole: string): number; protected getMaxArmorDeltaFromConfig(botRole: string): number;
protected getMinArmorLimitPercentFromConfig(botRole: string): number;
protected getMinWeaponLimitPercentFromConfig(botRole: string): number;
} }

View File

@ -36,6 +36,7 @@ export declare class HideoutHelper {
static waterCollector: string; static waterCollector: string;
static bitcoin: string; static bitcoin: string;
static expeditionaryFuelTank: string; static expeditionaryFuelTank: string;
static maxSkillPoint: number;
protected hideoutConfig: IHideoutConfig; protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, playerService: PlayerService, localisationService: LocalisationService, configServer: ConfigServer);
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse; registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
@ -118,6 +119,19 @@ export declare class HideoutHelper {
protected hasManagementSkillSlots(pmcData: IPmcData): boolean; protected hasManagementSkillSlots(pmcData: IPmcData): boolean;
protected getHideoutManagementSkill(pmcData: IPmcData): Common; protected getHideoutManagementSkill(pmcData: IPmcData): Common;
protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number; protected getHideoutManagementConsumptionBonus(pmcData: IPmcData): number;
/**
* Get the crafting skill details from player profile
* @param pmcData Player profile
* @returns crafting skill, null if not found
*/
protected getCraftingSkill(pmcData: IPmcData): Common;
/**
* Adjust craft time based on crafting skill level found in player profile
* @param pmcData Player profile
* @param productionTime Time to complete hideout craft in seconds
* @returns Adjusted craft time in seconds
*/
protected getCraftingSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number): number;
isProduction(productive: Productive): productive is Production; isProduction(productive: Productive): productive is Production;
getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse; getBTC(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
/** /**

View File

@ -27,10 +27,10 @@ export declare class TradeHelper {
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer); constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer);
/** /**
* Buy item from flea or trader * Buy item from flea or trader
* @param pmcData * @param pmcData Player profile
* @param buyRequestData data from client * @param buyRequestData data from client
* @param sessionID * @param sessionID Session id
* @param foundInRaid * @param foundInRaid Should item be found in raid
* @param upd optional item details used when buying from flea * @param upd optional item details used when buying from flea
* @returns * @returns
*/ */

View File

@ -76,7 +76,7 @@ export declare class TraderHelper {
*/ */
protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; protected getTraderDurabiltyPurchaseThreshold(traderId: string): number;
/** /**
* Get the price of an item and all of its attached children * Get the price of passed in item and all of its attached children (mods)
* Take into account bonuses/adjsutments e.g. discounts * Take into account bonuses/adjsutments e.g. discounts
* @param pmcData profile data * @param pmcData profile data
* @param item item to calculate price of * @param item item to calculate price of
@ -94,7 +94,14 @@ export declare class TraderHelper {
* @returns price as number * @returns price as number
*/ */
protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /**
* Get discount modifier for desired trader
* @param trader Trader to get discount for
* @param buyPriceCoefficient
* @param fenceInfo fence info, needed if getting fence modifier value
* @returns discount modifier value
*/
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number;
/** /**
* Add standing to a trader and level them up if exp goes over level threshold * Add standing to a trader and level them up if exp goes over level threshold
* @param sessionID Session id * @param sessionID Session id

View File

@ -23,6 +23,8 @@ export declare class PreAkiModLoader implements IModLoader {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected static container: DependencyContainer; protected static container: DependencyContainer;
protected readonly basepath = "user/mods/"; protected readonly basepath = "user/mods/";
protected readonly modOrderPath = "user/mods/order.json";
protected order: Record<string, number>;
protected imported: Record<string, ModLoader.IMod>; protected imported: Record<string, ModLoader.IMod>;
protected akiConfig: ICoreConfig; protected akiConfig: ICoreConfig;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, modCompilerService: ModCompilerService, bundleLoader: BundleLoader, localisationService: LocalisationService, configServer: ConfigServer);

View File

@ -20,6 +20,7 @@ export interface TemplateSide {
export interface ProfileTraderTemplate { export interface ProfileTraderTemplate {
initialLoyaltyLevel: number; initialLoyaltyLevel: number;
setQuestsAvailableForStart?: boolean; setQuestsAvailableForStart?: boolean;
setQuestsAvailableForFinish?: boolean;
initialStanding: number; initialStanding: number;
initialSalesSum: number; initialSalesSum: number;
jaegerUnlocked: boolean; jaegerUnlocked: boolean;

View File

@ -84,6 +84,7 @@ export interface ModLimits {
} }
export interface RandomisationDetails { export interface RandomisationDetails {
levelRange: MinMax; levelRange: MinMax;
generation?: Record<string, MinMax>;
randomisedWeaponModSlots?: string[]; randomisedWeaponModSlots?: string[];
randomisedArmorSlots?: string[]; randomisedArmorSlots?: string[];
/** Equipment chances */ /** Equipment chances */

View File

@ -14,19 +14,9 @@ export interface IBotDurability {
} }
/** Durability values to be used when a more specific bot type cant be found */ /** Durability values to be used when a more specific bot type cant be found */
export interface DefaultDurability { export interface DefaultDurability {
armor: DefaultArmor; armor: ArmorDurability;
weapon: WeaponDurability; weapon: WeaponDurability;
} }
export interface DefaultArmor {
maxDelta: number;
minDelta: number;
}
export interface WeaponDurability {
lowestMax: number;
highestMax: number;
maxDelta: number;
minDelta: number;
}
export interface PmcDurability { export interface PmcDurability {
armor: PmcDurabilityArmor; armor: PmcDurabilityArmor;
weapon: WeaponDurability; weapon: WeaponDurability;
@ -44,4 +34,12 @@ export interface BotDurability {
export interface ArmorDurability { export interface ArmorDurability {
maxDelta: number; maxDelta: number;
minDelta: number; minDelta: number;
minLimitPercent: number;
}
export interface WeaponDurability {
lowestMax: number;
highestMax: number;
maxDelta: number;
minDelta: number;
minLimitPercent: number;
} }

View File

@ -4,4 +4,5 @@ export interface IRepairConfig extends IBaseConfig {
priceMultiplier: number; priceMultiplier: number;
applyRandomizeDurabilityLoss: boolean; applyRandomizeDurabilityLoss: boolean;
weaponSkillRepairGain: number; weaponSkillRepairGain: number;
armorKitSkillPointGainPerRepairPointMultiplier: number;
} }

View File

@ -15,15 +15,21 @@ export interface UpdateTime {
seconds: number; seconds: number;
} }
export interface FenceConfig { export interface FenceConfig {
discountOptions: DiscountOptions;
partialRefreshTimeSeconds: number; partialRefreshTimeSeconds: number;
partialRefreshChangePercent: number; partialRefreshChangePercent: number;
assortSize: number; assortSize: number;
maxPresetsPercent: number; maxPresetsPercent: number;
itemPriceMult: number;
presetPriceMult: number; presetPriceMult: number;
armorMaxDurabilityPercentMinMax: MinMax; armorMaxDurabilityPercentMinMax: MinMax;
presetMaxDurabilityPercentMinMax: MinMax; presetMaxDurabilityPercentMinMax: MinMax;
itemPriceMult: number;
regenerateAssortsOnRefresh: boolean;
itemTypeLimits: Record<string, number>; itemTypeLimits: Record<string, number>;
regenerateAssortsOnRefresh: boolean;
blacklist: string[]; blacklist: string[];
} }
export interface DiscountOptions {
assortSize: number;
itemPriceMult: number;
presetPriceMult: number;
}

View File

@ -24,5 +24,6 @@ export declare class AkiHttpListener implements IHttpListener {
sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void;
getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): string;
protected getBodyInfo(body: Buffer): string; protected getBodyInfo(body: Buffer): string;
sendJson(resp: ServerResponse, output: any, sessionID: string): void;
sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void; sendZlibJson(resp: ServerResponse, output: any, sessionID: string): void;
} }

View File

@ -1,5 +1,6 @@
import { BotHelper } from "../helpers/BotHelper"; import { BotHelper } from "../helpers/BotHelper";
import { EquipmentChances, IBotType, ModsChances } from "../models/eft/common/tables/IBotType"; import { MinMax } from "../models/common/MinMax";
import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails"; import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig"; import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
@ -24,6 +25,12 @@ export declare class BotEquipmentFilterService {
* @param baseValues Values to update * @param baseValues Values to update
*/ */
protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void; protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void;
/**
* Iterate over the Generation changes and alter data in baseValues.Generation
* @param generationChanges Changes to apply
* @param baseBotGeneration dictionary to update
*/
protected adjustGenerationChances(generationChanges: Record<string, MinMax>, baseBotGeneration: Generation): void;
/** /**
* Get equipment settings for bot * Get equipment settings for bot
* @param botEquipmentRole equipment role to return * @param botEquipmentRole equipment role to return

View File

@ -1,7 +1,7 @@
import { HandbookHelper } from "../helpers/HandbookHelper"; import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { FenceLevel } from "../models/eft/common/IGlobals"; import { FenceLevel, Preset } from "../models/eft/common/IGlobals";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
@ -34,10 +34,12 @@ export declare class FenceService {
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected fenceAssort: ITraderAssort; protected fenceAssort: ITraderAssort;
protected fenceDiscountAssort: ITraderAssort;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
protected nextMiniRefreshTimestamp: number; protected nextMiniRefreshTimestamp: number;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer);
protected setFenceAssort(fenceAssort: ITraderAssort): void; protected setFenceAssort(assort: ITraderAssort): void;
protected setFenceDiscountAssort(assort: ITraderAssort): void;
/** /**
* Get assorts player can purchase * Get assorts player can purchase
* Adjust prices based on fence level of player * Adjust prices based on fence level of player
@ -46,12 +48,27 @@ export declare class FenceService {
*/ */
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
/** /**
* Adjust assorts price by a modifier * Adjust all items contained inside an assort by a multiplier
* @param item * @param assort Assort that contains items with prices to adjust
* @param assort * @param itemMultipler multipler to use on items
* @param modifier * @param presetMultiplier preset multipler to use on presets
*/ */
protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number): void; protected adjustAssortItemPrices(assort: ITraderAssort, itemMultipler: number, presetMultiplier: number): void;
/**
* Merge two trader assort files together
* @param firstAssort assort 1#
* @param secondAssort assort #2
* @returns merged assort
*/
protected mergeAssorts(firstAssort: ITraderAssort, secondAssort: ITraderAssort): ITraderAssort;
/**
* Adjust assorts price by a modifier
* @param item assort item details
* @param assort assort to be modified
* @param modifier value to multiply item price by
* @param presetModifier value to multiply preset price by
*/
protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void;
/** /**
* Get fence assorts with no price adjustments based on fence rep * Get fence assorts with no price adjustments based on fence rep
* @returns ITraderAssort * @returns ITraderAssort
@ -80,7 +97,7 @@ export declare class FenceService {
/** /**
* Choose an item (not mod) at random and remove from assorts * Choose an item (not mod) at random and remove from assorts
*/ */
protected removeRandomItemFromAssorts(): void; protected removeRandomItemFromAssorts(assort: ITraderAssort): void;
/** /**
* Get an integer rounded count of items to replace based on percentrage from traderConfig value * Get an integer rounded count of items to replace based on percentrage from traderConfig value
* @param totalItemCount total item count * @param totalItemCount total item count
@ -102,11 +119,23 @@ export declare class FenceService {
*/ */
protected createBaseTraderAssortItem(): ITraderAssort; protected createBaseTraderAssortItem(): ITraderAssort;
/** /**
* Hydrate result parameter object with generated assorts * Hydrate assorts parameter object with generated assorts
* @param assortCount Number of assorts to generate * @param assortCount Number of assorts to generate
* @param assorts object to add assorts to * @param assorts object to add created assorts to
*/ */
protected createAssorts(assortCount: number, assorts: ITraderAssort): void; protected createAssorts(assortCount: number, assorts: ITraderAssort, loyaltyLevel: number): void;
protected addItemAssorts(assortCount: number, fenceAssortIds: string[], assorts: ITraderAssort, fenceAssort: ITraderAssort, itemTypeCounts: Record<string, {
current: number;
max: number;
}>, loyaltyLevel: number): void;
/**
* Add preset weapons to fence presets
* @param assortCount how many assorts to add to assorts
* @param defaultWeaponPresets
* @param assorts object to add presets to
* @param loyaltyLevel
*/
protected addPresets(desiredPresetCount: number, defaultWeaponPresets: Record<string, Preset>, assorts: ITraderAssort, loyaltyLevel: number): void;
/** /**
* Randomise items' upd properties e.g. med packs/weapons/armor * Randomise items' upd properties e.g. med packs/weapons/armor
* @param itemDetails Item being randomised * @param itemDetails Item being randomised

View File

@ -62,7 +62,15 @@ export declare class PaymentService {
* Post-raid healing would often take money out of the players pockets/secure container * Post-raid healing would often take money out of the players pockets/secure container
* @param a First money stack item * @param a First money stack item
* @param b Second money stack item * @param b Second money stack item
* @param inventoryItems players inventory items
* @returns sort order * @returns sort order
*/ */
protected prioritiseStashSort(a: Item, b: Item): number; protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number;
/**
* Recursivly check items parents to see if it is inside the players inventory, not stash
* @param itemId item id to check
* @param inventoryItems player inventory
* @returns true if its in inventory
*/
protected isInInventory(itemId: string, inventoryItems: Item[]): boolean;
} }

View File

@ -1,3 +1,4 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { RepairHelper } from "../helpers/RepairHelper"; import { RepairHelper } from "../helpers/RepairHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
@ -16,12 +17,13 @@ export declare class RepairService {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected questHelper: QuestHelper; protected questHelper: QuestHelper;
protected itemHelper: ItemHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected repairHelper: RepairHelper; protected repairHelper: RepairHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
repairConfig: IRepairConfig; repairConfig: IRepairConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer);
/** /**
* Use trader to repair an items durability * Use trader to repair an items durability
* @param sessionID Session id * @param sessionID Session id
@ -70,4 +72,6 @@ export declare class RepairDetails {
repairCost?: number; repairCost?: number;
repairedItem: Item; repairedItem: Item;
repairedItemIsArmor: boolean; repairedItemIsArmor: boolean;
repairAmount: number;
repairedByKit: boolean;
} }

View File

@ -32,7 +32,7 @@ export declare class VFS {
createDirAsync(filepath: string): Promise<void>; createDirAsync(filepath: string): Promise<void>;
copyDir(filepath: string, target: string, fileExtensions?: string | string[]): void; copyDir(filepath: string, target: string, fileExtensions?: string | string[]): void;
copyDirAsync(filepath: string, target: string, fileExtensions: string | string[]): Promise<void>; copyDirAsync(filepath: string, target: string, fileExtensions: string | string[]): Promise<void>;
readFile(filepath: string): any; readFile(...args: Parameters<typeof fs.readFileSync>): any;
readFileAsync(filepath: string): Promise<any>; readFileAsync(filepath: string): Promise<any>;
writeFile(filepath: any, data?: string, append?: boolean, atomic?: boolean): void; writeFile(filepath: any, data?: string, append?: boolean, atomic?: boolean): void;
writeFileAsync(filepath: any, data?: string, append?: boolean, atomic?: boolean): Promise<void>; writeFileAsync(filepath: any, data?: string, append?: boolean, atomic?: boolean): Promise<void>;