update to 3.2.3

This commit is contained in:
CWX 2022-09-17 20:46:11 +01:00
parent 3b48af9d45
commit 4ffd4ce6d7
1066 changed files with 18278 additions and 4202 deletions

View File

@ -1,10 +1,10 @@
{ {
"name": "BushWhacker", "name": "BushWhacker",
"author": "CWX", "author": "CWX",
"version": "1.2.3", "version": "1.2.4",
"license": "NCSA", "license": "NCSA",
"main": "src/mod.js", "main": "src/mod.js",
"akiVersion": "3.2.2", "akiVersion": "3.2.3",
"scripts": { "scripts": {
"setup:environment": "npm i", "setup:environment": "npm i",
"build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist", "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist",

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<AssemblyName>CWX-BushWhacker</AssemblyName> <AssemblyName>CWX-BushWhacker</AssemblyName>
<Version>1.1.0</Version> <Version>1.2.4</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -5,7 +5,7 @@ using UnityEngine;
namespace BushWhacker namespace BushWhacker
{ {
[BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.0")] [BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.4")]
public class BushWhacker : BaseUnityPlugin public class BushWhacker : BaseUnityPlugin
{ {
public void Start() public void Start()

View File

@ -1,5 +1,5 @@
# BushWhacker # BushWhacker
## CWX-BushWhacker for EFT - SPT-AKI ## CWX-BushWhacker for EFT - SPT-AKI
### CURRENT AKI VERSION: 2.3.1 ### CURRENT AKI VERSION: 3.2.3
### GAMEVERSION: 0.12.12.17349 ### GAMEVERSION: 0.12.12.31.19428
### USING BEPINEX ### USING BEPINEX

View File

@ -1,10 +1,10 @@
{ {
"name": "BushWhacker", "name": "BushWhacker",
"author": "CWX", "author": "CWX",
"version": "1.2.3", "version": "1.2.4",
"license": "NCSA", "license": "NCSA",
"main": "src/mod.js", "main": "src/mod.js",
"akiVersion": "3.2.2", "akiVersion": "3.2.3",
"scripts": { "scripts": {
"setup:environment": "npm i", "setup:environment": "npm i",
"build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist", "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist",

View File

@ -1,5 +1,5 @@
import { InsuranceController } from "../controllers/InsuranceController"; import { InsuranceController } from "../controllers/InsuranceController";
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate"; import { OnUpdate } from "../di/OnUpdate";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData"; import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
@ -10,14 +10,13 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { InsuranceService } from "../services/InsuranceService"; import { InsuranceService } from "../services/InsuranceService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class InsuranceCallbacks extends OnLoadOnUpdate { export declare class InsuranceCallbacks extends OnUpdate {
protected insuranceController: InsuranceController; protected insuranceController: InsuranceController;
protected insuranceService: InsuranceService; protected insuranceService: InsuranceService;
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected insuranceConfig: IInsuranceConfig; protected insuranceConfig: IInsuranceConfig;
constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer); constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer);
onLoad(): void;
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>; getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
onUpdate(secondsSinceLastRun: number): boolean; onUpdate(secondsSinceLastRun: number): boolean;

View File

@ -11,4 +11,5 @@ export declare class LocationCallbacks {
constructor(httpResponse: HttpResponseUtil, locationController: LocationController); constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>; getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>; getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
} }

View File

@ -1,5 +1,6 @@
import { ProfileController } from "../controllers/ProfileController"; import { ProfileController } from "../controllers/ProfileController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData"; import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
@ -12,20 +13,51 @@ import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendRespon
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
/** Handle profile related client events */
export declare class ProfileCallbacks { export declare class ProfileCallbacks {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected profileController: ProfileController; protected profileController: ProfileController;
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController); constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>; createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; /**
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>; * Get the complete player profile (scav + pmc character)
* @param url
* @param info Empty
* @param sessionID Session id
* @returns Profile object
*/
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
/**
* Handle the creation of a scav profile for player
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
* @param url
* @param info empty
* @param sessionID Session id
* @returns Profile object
*/
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
/**
* Handle client/game/profile/voice/change event
* @param url
* @param info Change voice request object
* @param sessionID Session id
* @returns Client response
*/
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData; changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
/**
* Handle client/game/profile/nickname/change event
* Client allows player to adjust their profile name
* @param url
* @param info Change nickname request object
* @param sessionID Session id
* @returns client response
*/
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>; changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>; validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>; getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
/** /**
* Called when creating a character, when you choose a character face/voice * Called when creating a character when choosing a character face/voice
* @param url * @param url
* @param info response (empty) * @param info response (empty)
* @param sessionID * @param sessionID

View File

@ -19,6 +19,9 @@ import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer"; import { RagfairServer } from "../servers/RagfairServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
/**
* Handle ragfair related callback events
*/
export declare class RagfairCallbacks extends OnLoadOnUpdate { export declare class RagfairCallbacks extends OnLoadOnUpdate {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected logger: ILogger; protected logger: ILogger;

View File

@ -6,6 +6,20 @@ import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepa
export declare class RepairCallbacks { export declare class RepairCallbacks {
protected repairController: RepairController; protected repairController: RepairController;
constructor(repairController: RepairController); constructor(repairController: RepairController);
/**
* use trader to repair item
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
/**
* Use repair kit to repair item
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
} }

View File

@ -9,10 +9,10 @@ export declare class TraderCallbacks extends OnLoadOnUpdate {
protected traderController: TraderController; protected traderController: TraderController;
constructor(httpResponse: HttpResponseUtil, traderController: TraderController); constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
onLoad(): void; onLoad(): void;
onUpdate(): boolean;
getRoute(): string; getRoute(): string;
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>; getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
onUpdate(): boolean;
} }

View File

@ -4,7 +4,7 @@ export declare class ContextVariable {
private timestamp; private timestamp;
private type; private type;
constructor(value: any, type: ContextVariableType); constructor(value: any, type: ContextVariableType);
getValue(): any; getValue<T>(): T;
getTimestamp(): Date; getTimestamp(): Date;
getType(): ContextVariableType; getType(): ContextVariableType;
} }

View File

@ -1,3 +1,4 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { BotGenerator } from "../generators/BotGenerator"; import { BotGenerator } from "../generators/BotGenerator";
import { BotHelper } from "../helpers/BotHelper"; import { BotHelper } from "../helpers/BotHelper";
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData"; import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
@ -5,15 +6,22 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { IBotCore } from "../models/eft/common/tables/IBotCore"; import { IBotCore } from "../models/eft/common/tables/IBotCore";
import { Difficulty } from "../models/eft/common/tables/IBotType"; import { Difficulty } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { PmcAiService } from "../services/PmcAiService";
export declare class BotController { export declare class BotController {
protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected botGenerator: BotGenerator; protected botGenerator: BotGenerator;
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected pmcAiService: PmcAiService;
protected botGenerationCacheService: BotGenerationCacheService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected applicationContext: ApplicationContext;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, pmcAiService: PmcAiService, botGenerationCacheService: BotGenerationCacheService, configServer: ConfigServer, applicationContext: ApplicationContext);
/** /**
* Return the number of bot loadout varieties to be generated * Return the number of bot loadout varieties to be generated
* @param type bot Type we want the loadout gen count for * @param type bot Type we want the loadout gen count for
@ -29,7 +37,18 @@ export declare class BotController {
* @returns Difficulty object * @returns Difficulty object
*/ */
getBotDifficulty(type: string, difficulty: string): Difficulty; getBotDifficulty(type: string, difficulty: string): Difficulty;
protected getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string): Difficulty; protected getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Generate bot profiles and store in cache
* @param sessionId Session id
* @param info bot generation request info
* @returns IBotBase array
*/
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[]; generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/**
* Get the max number of bots allowed on a map
* Looks up location player is entering when getting cap value
* @returns cap number
*/
getBotCap(): number; getBotCap(): number;
} }

View File

@ -7,11 +7,13 @@ import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService"; import { LocaleService } from "../services/LocaleService";
import { ProfileFixerService } from "../services/ProfileFixerService"; import { ProfileFixerService } from "../services/ProfileFixerService";
import { Watermark } from "../utils/Watermark"; import { Watermark } from "../utils/Watermark";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected watermark: Watermark; protected watermark: Watermark;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected localeService: LocaleService; protected localeService: LocaleService;
@ -20,9 +22,14 @@ export declare class GameController {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void; gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void;
/**
* Make non-trigger-spawned raiders spawn earlier + always
*/
protected adjustLabsRaiderSpawnRate(): void;
protected logProfileDetails(fullProfile: IAkiProfile): void; protected logProfileDetails(fullProfile: IAkiProfile): void;
getGameConfig(sessionID: string): IGameConfigResponse; getGameConfig(sessionID: string): IGameConfigResponse;
getServer(): any[]; getServer(): any[];
getValidGameVersion(): any;
} }

View File

@ -28,6 +28,7 @@ import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { JsonUtil } from "../utils/JsonUtil";
export declare class HideoutController { export declare class HideoutController {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
@ -45,9 +46,10 @@ export declare class HideoutController {
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected jsonUtil: JsonUtil;
protected static nameBackendCountersCrafting: string; protected static nameBackendCountersCrafting: string;
protected hideoutConfig: IHideoutConfig; protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil);
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse; upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse; upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/** /**

View File

@ -5,9 +5,11 @@ import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper"; import { ProfileHelper } from "../helpers/ProfileHelper";
import { QuestHelper } from "../helpers/QuestHelper"; import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData"; import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData"; import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
@ -15,6 +17,7 @@ import { InsuranceService } from "../services/InsuranceService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class InraidController { export declare class InraidController {
protected logger: ILogger;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -29,16 +32,40 @@ export declare class InraidController {
protected inRaidHelper: InRaidHelper; protected inRaidHelper: InRaidHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected inraidConfig: IInRaidConfig; protected inraidConfig: IInRaidConfig;
constructor(saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer);
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void; saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
/**
* Handle updating the profile post-pmc raid
* @param sessionID session id
* @param offraidData post-raid data of raid
*/
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
/**
* Reduce body part hp to % of max
* @param pmcData profile to edit
* @param multipler multipler to apply to max health
*/
protected reducePmcHealthToPercent(pmcData: IPmcData, multipler: number): void;
/**
* Handle updating the profile post-pscav raid
* @param sessionID session id
* @param offraidData post-raid data of raid
*/
protected savePlayerScavProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
/**
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
* @param statusOnExit exit value from offraidData object
* @returns true if dead
*/
protected isPlayerDead(statusOnExit: string): boolean;
/** /**
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
* @param offraidData Save Progress Request * @param offraidData Save Progress Request
* @param pmcData player profile * @param pmcData player profile
* @param isPlayerScav Was the player a pScav * @param isPlayerScav Was the player a pScav
*/ */
private markOrRemoveFoundInRaidItems; protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
private handlePostRaidPlayerScavProcess; protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
private handlePostRaidPlayerScavKarmaChanges; protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
} }

View File

@ -92,7 +92,11 @@ export declare class InventoryController {
*/ */
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse; toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handles Tagging of items (primary Containers). * Add a tag to an inventory item
* @param pmcData profile with item to add tag to
* @param body tag request data
* @param sessionID session id
* @returns client response object
*/ */
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse; tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse; bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -1,18 +1,33 @@
import { LocationGenerator } from "../generators/LocationGenerator"; import { LocationGenerator } from "../generators/LocationGenerator";
import { LootGenerator } from "../generators/LootGenerator";
import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILocationBase } from "../models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase"; import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { LootItem } from "../models/spt/services/LootItem";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class LocationController { export declare class LocationController {
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected logger: ILogger; protected logger: ILogger;
protected locationGenerator: LocationGenerator; protected locationGenerator: LocationGenerator;
protected lootGenerator: LootGenerator;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
constructor(jsonUtil: JsonUtil, logger: ILogger, locationGenerator: LocationGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil); protected configServer: ConfigServer;
protected airdropConfig: IAirdropConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
get(location: string): ILocationBase; get(location: string): ILocationBase;
generate(name: string): ILocationBase; generate(name: string): ILocationBase;
generateAll(): ILocationsGenerateAllResponse; generateAll(): ILocationsGenerateAllResponse;
/**
* Get loot for an airdop container
* Generates it randomly based on config/airdrop.json values
* @returns Array of LootItem
*/
getAirdropLoot(): LootItem[];
} }

View File

@ -9,23 +9,33 @@ import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestDa
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { IMatchConfig } from "../models/spt/config/IMatchConfig"; import { IMatchConfig } from "../models/spt/config/IMatchConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { BotLootCacheService } from "../services/BotLootCacheService"; import { BotLootCacheService } from "../services/BotLootCacheService";
import { MatchLocationService } from "../services/MatchLocationService"; import { MatchLocationService } from "../services/MatchLocationService";
import { PmcAiService } from "../services/PmcAiService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
export declare class MatchController { export declare class MatchController {
protected logger: ILogger;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected matchLocationService: MatchLocationService; protected matchLocationService: MatchLocationService;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected botLootCacheService: BotLootCacheService; protected botLootCacheService: BotLootCacheService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected profileSnapshotService: ProfileSnapshotService;
protected pmcAiService: PmcAiService;
protected botGenerationCacheService: BotGenerationCacheService;
protected applicationContext: ApplicationContext; protected applicationContext: ApplicationContext;
protected matchConfig: IMatchConfig; protected matchConfig: IMatchConfig;
protected inraidConfig: IInRaidConfig; protected inraidConfig: IInRaidConfig;
constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, applicationContext: ApplicationContext); protected botConfig: IBotConfig;
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, pmcAiService: PmcAiService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
getEnabled(): boolean; getEnabled(): boolean;
getProfile(info: IGetProfileRequestData): IPmcData[]; getProfile(info: IGetProfileRequestData): IPmcData[];
createGroup(sessionID: string, info: ICreateGroupRequestData): any; createGroup(sessionID: string, info: ICreateGroupRequestData): any;

View File

@ -39,16 +39,31 @@ export declare class QuestController {
* @returns array of IQuest * @returns array of IQuest
*/ */
getClientQuests(sessionID: string): IQuest[]; getClientQuests(sessionID: string): IQuest[];
/**
* Is the quest for the opposite side the player is on
* @param side player side (usec/bear)
* @param questId questId to check
*/
protected questIsForOtherSide(side: string, questId: string): boolean;
/**
* Handle the client accepting a quest and starting it
* Send starting rewards if any to player and
* Send start notification if any to player
* @param pmcData Profile to update
* @param acceptedQuest Quest accepted
* @param sessionID Session id
* @returns client response
*/
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Remove completed quest from profile * Update completed quest in profile
* Add newly unlocked quests to profile * Add newly unlocked quests to profile
* Also recalculate thier level due to exp rewards * Also recalculate thier level due to exp rewards
* @param pmcData Player profile * @param pmcData Player profile
* @param body completed quest request * @param body Completed quest request
* @param sessionID session id * @param sessionID Session id
* @returns ItemEvent response * @returns ItemEvent client response
*/ */
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
@ -67,10 +82,20 @@ export declare class QuestController {
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[]; protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
/** /**
* Fail the quests provided * Fail the quests provided
* Update quest in profile, otherwise add fresh quest object with failed status
* @param sessionID session id * @param sessionID session id
* @param pmcData player profile * @param pmcData player profile
* @param questsToFail quests to fail * @param questsToFail quests to fail
*/ */
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void;
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Increment a backend counter stored value by an amount,
* Create counter if it does not exist
* @param pmcData Profile to find backend counter in
* @param conditionId backend counter id to update
* @param questId quest id counter is associated with
* @param counterValue value to increment the backend counter with
*/
protected updateProfileBackendCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
} }

View File

@ -9,6 +9,7 @@ import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper"; import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper"; import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper"; import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
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 { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -33,6 +34,9 @@ import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService"; import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
/**
* Handle RagfairCallback events
*/
export declare class RagfairController { export declare class RagfairController {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
@ -52,14 +56,20 @@ export declare class RagfairController {
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper;
protected ragfairHelper: RagfairHelper; protected ragfairHelper: RagfairHelper;
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected ragfairRequiredItemsService: RagfairRequiredItemsService; protected ragfairRequiredItemsService: RagfairRequiredItemsService;
protected ragfairOfferGenerator: RagfairOfferGenerator; protected ragfairOfferGenerator: RagfairOfferGenerator;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer);
getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult; getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
/**
* Update a trader flea offer with buy restrictions stored in the traders assort
* @param offer flea offer to update
*/
protected setTraderOfferPurchaseLimits(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

@ -8,9 +8,9 @@ import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepa
import { IRepairConfig } from "../models/spt/config/IRepairConfig"; import { IRepairConfig } from "../models/spt/config/IRepairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ItemEventRouter } from "../routers/ItemEventRouter";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
import { RepairService } from "../services/RepairService";
export declare class RepairController { export declare class RepairController {
protected logger: ILogger; protected logger: ILogger;
protected itemEventRouter: ItemEventRouter; protected itemEventRouter: ItemEventRouter;
@ -19,23 +19,23 @@ export declare class RepairController {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected repairHelper: RepairHelper; protected repairHelper: RepairHelper;
protected configServer: ConfigServer; protected repairService: RepairService;
protected repairConfig: IRepairConfig; protected repairConfig: IRepairConfig;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer); constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
/** /**
* Repair with trader * Repair with trader
* @param pmcData player profile
* @param body endpoint request data
* @param sessionID session id * @param sessionID session id
* @param body endpoint request data
* @param pmcData player profile
* @returns item event router action * @returns item event router action
*/ */
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
/** /**
* Repair with repair kit * Repair with repair kit
* @param pmcData player profile
* @param body endpoint request data
* @param sessionID session id * @param sessionID session id
* @param body endpoint request data
* @param pmcData player profile
* @returns item event router action * @returns item event router action
*/ */
repairWithKit(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse; repairWithKit(sessionID: string, body: IRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
} }

View File

@ -7,6 +7,7 @@ import { Exit } from "../models/eft/common/ILocationBase";
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { TraderInfo } from "../models/eft/common/tables/IBotBase"; import { TraderInfo } from "../models/eft/common/tables/IBotBase";
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests"; import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
import { ELocationName } from "../models/enums/ELocationName"; import { ELocationName } from "../models/enums/ELocationName";
@ -15,6 +16,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter"; import { ItemEventRouter } from "../routers/ItemEventRouter";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { PaymentService } from "../services/PaymentService"; import { PaymentService } from "../services/PaymentService";
import { ProfileFixerService } from "../services/ProfileFixerService"; import { ProfileFixerService } from "../services/ProfileFixerService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -64,9 +66,10 @@ export declare class RepeatableQuestController {
protected itemEventRouter: ItemEventRouter; protected itemEventRouter: ItemEventRouter;
protected paymentService: PaymentService; protected paymentService: PaymentService;
protected objectId: ObjectId; protected objectId: ObjectId;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, configServer: ConfigServer); constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint * This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
* Returns an array of objects in the format of repeatable quests to the client. * Returns an array of objects in the format of repeatable quests to the client.
@ -217,4 +220,16 @@ export declare class RepeatableQuestController {
debugLogRepeatableQuestIds(pmcData: IPmcData): void; debugLogRepeatableQuestIds(pmcData: IPmcData): void;
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>; probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
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)
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
*/
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
* 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
* @returns boolean: true if item is valid reward
*/
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
} }

View File

@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper";
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService";
import { TraderAssortService } from "../services/TraderAssortService"; import { TraderAssortService } from "../services/TraderAssortService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
@ -15,12 +16,29 @@ export declare class TraderController {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected traderAssortService: TraderAssortService; protected traderAssortService: TraderAssortService;
protected fenceService: FenceService;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, jsonUtil: JsonUtil); constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil);
/**
* Runs when onLoad event is fired
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
* Store timestamp of next assort refresh in nextResupply property of traders .base object
*/
load(): void; load(): void;
getTrader(traderID: string, sessionID: string): ITraderBase; /**
* Runs when onUpdate is fired
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
* Fence is handled slightly differently
* @returns has run
*/
update(): boolean;
/**
* Return an array of all traders
* @param sessionID Session id
* @returns array if ITraderBase objects
*/
getAllTraders(sessionID: string): ITraderBase[]; getAllTraders(sessionID: string): ITraderBase[];
updateTraders(): boolean; getTrader(sessionID: string, traderID: string): ITraderBase;
getAssort(sessionId: string, traderId: string): ITraderAssort; getAssort(sessionId: string, traderId: string): ITraderAssort;
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>; getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;
} }

View File

@ -1,4 +1,7 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
/**
* Handle the registration of classes to be used by the Dependency Injection code
*/
export declare class Container { export declare class Container {
static registerTypes(depContainer: DependencyContainer): void; static registerTypes(depContainer: DependencyContainer): void;
static registerListTypes(depContainer: DependencyContainer): void; static registerListTypes(depContainer: DependencyContainer): void;

View File

@ -9,6 +9,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { PmcAiService } from "../services/PmcAiService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
@ -30,9 +31,10 @@ export declare class BotGenerator {
protected botEquipmentFilterService: BotEquipmentFilterService; protected botEquipmentFilterService: BotEquipmentFilterService;
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected gameEventHelper: GameEventHelper; protected gameEventHelper: GameEventHelper;
protected pmcAiService: PmcAiService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botEquipmentFilterService: BotEquipmentFilterService, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botEquipmentFilterService: BotEquipmentFilterService, botHelper: BotHelper, gameEventHelper: GameEventHelper, pmcAiService: PmcAiService, configServer: ConfigServer);
/** /**
* Generate a player scav bot object * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -40,14 +42,14 @@ export declare class BotGenerator {
* @param botTemplate base bot template to use (e.g. assault/pmcbot) * @param botTemplate base bot template to use (e.g. assault/pmcbot)
* @returns * @returns
*/ */
generatePlayerScav(role: string, difficulty: string, botTemplate: IBotType): IBotBase; generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/** /**
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check * Generate an array of bot objects for populate a raid with
* @param botRole the bot role to check if should be a pmc * @param sessionId session id
* @returns true if should be a pmc * @param info request object
* @returns bot array
*/ */
protected shouldBotBePmc(botRole: string): boolean; generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/** /**
* Get a randomised PMC side based on bot config value 'isUsec' * Get a randomised PMC side based on bot config value 'isUsec'
* @returns pmc side as string * @returns pmc side as string
@ -58,12 +60,30 @@ export declare class BotGenerator {
* @returns IBotBase object * @returns IBotBase object
*/ */
protected getCloneOfBotBase(): IBotBase; protected getCloneOfBotBase(): IBotBase;
protected generateBot(bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase; /**
* Create a IBotBase object with equipment/loot/exp etc
* @param sessionId Session id
* @param bot bots base file
* @param role botRole bot will use
* @param node Bot template from db/bots/x.json
* @param isPmc Is bot to be a PMC
* @param isPlayerScav is bot to be a p scav bot
* @returns IBotBase object
*/
protected generateBot(sessionId: string, bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client
*/ */
protected logPmcGeneratedCount(output: IBotBase[]): void; protected logPmcGeneratedCount(output: IBotBase[]): void;
protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; /**
* Return a randomised bot level and exp value
* @param role botRole being generated for
* @param min Min exp value
* @param max Max exp value
* @returns IRandomisedBotLevelResult object
*/
protected generateRandomLevel(role: string, min: number, max: number): BotGenerator.IRandomisedBotLevelResult;
/** /**
* Converts health object to the required format * Converts health object to the required format
* @param healthObj health object from bot json * @param healthObj health object from bot json
@ -72,19 +92,23 @@ export declare class BotGenerator {
*/ */
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
protected generateSkills(skillsObj: Skills): Skills; protected generateSkills(skillsObj: Skills): Skills;
/**
* Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType)
* @param pmcSide eft side (usec/bear)
* @returns pmc side as defined in config
*/
protected getPmcRole(pmcSide: string): string;
/** /**
* Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper)
* @param nodeInventory Bots inventory to iterate over * @param nodeInventory Bots inventory to iterate over
*/ */
protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void;
/**
* Generate a random Id for a bot and apply to bots _id and aid value
* @param bot bot to update
* @returns updated IBotBase object
*/
protected generateId(bot: IBotBase): IBotBase; protected generateId(bot: IBotBase): IBotBase;
protected generateInventoryID(profile: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase;
/**
* Get the difficulty passed in, if its not "asoline", get selected difficulty from config
* @param requestedDifficulty
* @returns
*/
protected getPMCDifficulty(requestedDifficulty: string): string; protected getPMCDifficulty(requestedDifficulty: string): string;
/** /**
* Add a side-specific (usec/bear) dogtag item to a bots inventory * Add a side-specific (usec/bear) dogtag item to a bots inventory

View File

@ -1,13 +1,16 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Inventory, Chances, Generation, Mods } from "../models/eft/common/tables/IBotType"; import { Chances, Generation, Inventory, Mods } from "../models/eft/common/tables/IBotType";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
import { BotLootGenerator } from "./BotLootGenerator"; import { BotLootGenerator } from "./BotLootGenerator";
import { ILogger } from "../models/spt/utils/ILogger"; import { BotWeaponGenerator } from "./BotWeaponGenerator";
import { DatabaseServer } from "../servers/DatabaseServer";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
export declare class BotInventoryGenerator { export declare class BotInventoryGenerator {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
@ -17,8 +20,14 @@ export declare class BotInventoryGenerator {
protected botLootGenerator: BotLootGenerator; protected botLootGenerator: BotLootGenerator;
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected weightedRandomHelper: WeightedRandomHelper; protected weightedRandomHelper: WeightedRandomHelper;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper); protected configServer: ConfigServer;
generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer);
generateInventory(sessionId: string, templateInventory: Inventory, equipmentChances: Chances, itemGenerationLimitsMinMax: Generation, botRole: string, isPmc: boolean): PmcInventory;
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
slot: EquipmentSlots;
shouldSpawn: boolean;
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation): void;
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void; protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void;
protected generateInventoryBase(): PmcInventory; protected generateInventoryBase(): PmcInventory;
} }

View File

@ -1,4 +1,5 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { HandbookHelper } from "../helpers/HandbookHelper"; import { HandbookHelper } from "../helpers/HandbookHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
@ -20,11 +21,12 @@ export declare class BotLootGenerator {
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGenerator: BotWeaponGenerator; protected botWeaponGenerator: BotWeaponGenerator;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botLootCacheService: BotLootCacheService; protected botLootCacheService: BotLootCacheService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer);
generateLoot(templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void; generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void;
protected getRandomisedCount(min: number, max: number, nValue: number): number; protected getRandomisedCount(min: number, max: number, nValue: number): number;
/** /**
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
@ -47,7 +49,7 @@ export declare class BotLootGenerator {
* @param botRole bots role, .e.g. pmcBot * @param botRole bots role, .e.g. pmcBot
* @param isPmc are we generating for a pmc * @param isPmc are we generating for a pmc
*/ */
protected addLooseWeaponsToInventorySlot(botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void; protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void;
/** /**
* Get a random item from the pool parameter using the biasedRandomNumber system * Get a random item from the pool parameter using the biasedRandomNumber system
* @param pool pool of items to pick an item from * @param pool pool of items to pick an item from

View File

@ -1,4 +1,5 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { MinMax } from "../models/common/MinMax"; import { MinMax } from "../models/common/MinMax";
@ -14,6 +15,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
export declare class BotWeaponGenerator { export declare class BotWeaponGenerator {
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected logger: ILogger; protected logger: ILogger;
@ -24,11 +26,24 @@ export declare class BotWeaponGenerator {
protected botGeneratorHelper: BotGeneratorHelper; protected botGeneratorHelper: BotGeneratorHelper;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected inventoryMagGenComponents: IInventoryMagGen[];
protected readonly modMagazineSlotId = "mod_magazine"; protected readonly modMagazineSlotId = "mod_magazine";
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer); constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, inventoryMagGenComponents: IInventoryMagGen[]);
/** /**
* Get a random weapon from a bots pool of weapons (weighted) * Pick a random weapon based on weightings and generate a functional weapon
* @param equipmentSlot Primary/secondary/holster
* @param botTemplateInventory e.g. assault.json
* @param weaponParentId
* @param modChances
* @param botRole role of bot, e.g. assault/followerBully
* @param isPmc Is weapon generated for a pmc
* @returns GenerateWeaponResult object
*/
generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
/**
* Get a random weighted weapon from a bots pool of weapons
* @param equipmentSlot Primary/secondary/holster * @param equipmentSlot Primary/secondary/holster
* @param botTemplateInventory e.g. assault.json * @param botTemplateInventory e.g. assault.json
* @returns weapon tpl * @returns weapon tpl
@ -39,43 +54,24 @@ export declare class BotWeaponGenerator {
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool()) * @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
* @param equipmentSlot slot to fit into, primary/secondary/holster * @param equipmentSlot slot to fit into, primary/secondary/holster
* @param botTemplateInventory e.g. assault.json * @param botTemplateInventory e.g. assault.json
* @param weaponParentId * @param weaponParentId ParentId of the weapon being generated
* @param modChances * @param modChances Dictionary of item types and % chance weapon will have that mod
* @param botRole * @param botRole e.g. assault/exusec
* @param isPmc * @param isPmc
* @returns GenerateWeaponResult object * @returns GenerateWeaponResult object
*/ */
generateWeaponByTpl(weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult; generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
/** /**
* Generate an entirely random weapon * Create array with weapon base as only element and
* @param equipmentSlot Primary/secondary/holster * add additional properties based on weapon type
* @param botTemplateInventory e.g. assault.json * @param weaponTpl Weapon tpl to create item with
* @param weaponParentId * @param weaponParentId Weapons parent id
* @param modChances * @param equipmentSlot e.g. primary/secondary/holster
* @param botRole * @param weaponItemTemplate db template for weapon
* @param isPmc
* @returns GenerateWeaponResult object
*/
generateRandomWeapon(equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
/**
* Create array with weapon base as only element
* Add additional properties as required
* @param weaponTpl
* @param weaponParentId
* @param equipmentSlot
* @param weaponItemTemplate
* @param botRole for durability values * @param botRole for durability values
* @returns * @returns Base weapon item in array
*/ */
constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[]; protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Add compatible magazines to an inventory based on a generated weapon
* @param weaponDetails
* @param magCounts
* @param inventory
* @param botRole the bot type we're getting generating extra mags for
*/
addExtraMagazinesToInventory(weaponDetails: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
/** /**
* Get the mods necessary to kit out a weapon to its preset level * Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for * @param weaponTpl weapon to find preset for
@ -84,33 +80,21 @@ export declare class BotWeaponGenerator {
* @returns array of weapon mods * @returns array of weapon mods
*/ */
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[]; protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/** Checks if all required slots are occupied on a weapon and all it's mods */ /**
* Checks if all required slots are occupied on a weapon and all it's mods
* @param weaponItemArray Weapon + mods
* @returns true if valid
*/
protected isWeaponValid(weaponItemArray: Item[]): boolean; protected isWeaponValid(weaponItemArray: Item[]): boolean;
/** /**
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
* Additionally, adds extra bullets to SecuredContainer * Additionally, adds extra bullets to SecuredContainer
* @param weaponMods * @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
* @param weaponTemplate * @param magCounts Magazine count to add to inventory
* @param magCounts * @param inventory Inventory to add magazines to
* @param ammoTpl * @param botRole The bot type we're getting generating extra mags for
* @param inventory
* @param botRole the bot type we're getting generating extra mags for
* @returns
*/ */
protected generateExtraMagazines(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void; addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
/**
* Get a randomised number of bullets for a specific magazine
* @param magCounts min and max count of magazines
* @param magTemplate magazine to generate bullet count for
* @returns bullet count number
*/
protected getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
/**
* Get a randomised count of magazines
* @param magCounts min and max value returned value can be between
* @returns numberical value of magazine count
*/
protected getRandomisedMagazineCount(magCounts: MinMax): number;
/** /**
* Add ammo to the secure container * Add ammo to the secure container
* @param stackCount How many stacks of ammo to add * @param stackCount How many stacks of ammo to add
@ -127,21 +111,13 @@ export declare class BotWeaponGenerator {
* @returns magazine tpl string * @returns magazine tpl string
*/ */
protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string; protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string;
/**
* Get a weapons default magazine template id
* @param weaponTemplate weapon to get default magazine for
* @returns tpl of magazine
*/
protected getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string;
protected addBulletsToVestAndPockets(ammoTpl: string, bulletCount: number, inventory: PmcInventory): void;
/** /**
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo) * Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
* @param ammo a list of ammo tpls the weapon can use * @param ammo a list of ammo tpls the weapon can use
* @param weaponTemplate the weapon we want to pick ammo for * @param weaponTemplate the weapon we want to pick ammo for
* @param isPmc is the ammo being gathered for a pmc (runs pmc ammo filtering)
* @returns an ammo tpl that works with the desired gun * @returns an ammo tpl that works with the desired gun
*/ */
protected getCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem, isPmc: boolean): string; protected getWeightedCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem): string;
/** /**
* Get a weapons compatible cartridge caliber * Get a weapons compatible cartridge caliber
* @param weaponTemplate Weapon to look up caliber of * @param weaponTemplate Weapon to look up caliber of

View File

@ -3,10 +3,9 @@ import { GameEventHelper } from "../helpers/GameEventHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper"; import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
import { ILooseLoot, SpawnpointTemplate } from "../models/eft/common/ILooseLoot"; import { ILooseLoot, SpawnpointsForced, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase"; import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
@ -36,11 +35,19 @@ export declare class LocationGenerator {
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps; generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
protected getLooseLootMultiplerForLocation(location: string): number; protected getLooseLootMultiplerForLocation(location: string): number;
protected getStaticLootMultiplerForLocation(location: string): number; protected getStaticLootMultiplerForLocation(location: string): number;
/**
* Create array of loose + forced loot using probability system
* @param dynamicLootDist
* @param staticAmmoDist
* @param locationName Location to generate loot for
* @returns Array of spawn points with loot in them
*/
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[]; generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
/**
* Add forced spawn point loot into loot parameter array
* @param loot array to add forced loot to
* @param forcedSpawnPoints forced loot to add
*/
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void;
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem; protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
protected getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string;
protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
protected createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
protected createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item;
} }

View File

@ -0,0 +1,58 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { Preset } from "../models/eft/common/IGlobals";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { LootItem } from "../models/spt/services/LootItem";
import { LootRequest } from "../models/spt/services/LootRequest";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class LootGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper;
protected itemFilterService: ItemFilterService;
constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService);
/**
* Generate a list of items based on options passed in
* @param options parameters to adjust what loot is generated
* @returns An array of loot items
*/
createRandomloot(options: LootRequest): LootItem[];
/**
* Construct item limit record to hold max and current item count
* @param limits limits as defined in config
* @returns record, key: item tplId, value: current/max item count allowed
*/
protected initItemLimitCounter(limits: Record<string, number>): Record<string, {
current: number;
max: number;
}>;
/**
* Find a random item in items.json and add to result array
* @param items items to choose from
* @param itemTypeCounts item limit counts
* @param options item filters
* @param result array to add found item to
* @returns true if item was valid and added to pool
*/
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
current: number;
max: number;
}>, options: LootRequest, result: LootItem[]): boolean;
/**
*
* Find a random item in items.json and add to result array
* @param globalDefaultPresets presets to choose from
* @param itemTypeCounts item limit counts
* @param result array to add found preset to
* @returns true if preset was valid and added to pool
*/
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
current: number;
max: number;
}>, result: LootItem[]): boolean;
}

View File

@ -1,15 +1,21 @@
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ConfigServer } from "../servers/ConfigServer";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
/**
* Handle the generation of dynamic PMC loot in pockets and backpacks
* and the removal of blacklisted items
*/
export declare class PMCLootGenerator { export declare class PMCLootGenerator {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected itemFilterService: ItemFilterService;
protected pocketLootPool: string[]; protected pocketLootPool: string[];
protected backpackLootPool: string[]; protected backpackLootPool: string[];
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer); constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService);
generatePMCPocketLootPool(): string[]; generatePMCPocketLootPool(): string[];
generatePMCBackpackLootPool(): string[]; generatePMCBackpackLootPool(): string[];
} }

View File

@ -1,5 +1,8 @@
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { Preset } from "../models/eft/common/IGlobals";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -8,18 +11,40 @@ export declare class RagfairAssortGenerator {
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected configServer: ConfigServer;
protected generatedAssortItems: Item[]; protected generatedAssortItems: Item[];
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer); protected ragfairConfig: IRagfairConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
/** /**
* Get an array of unique items that can be sold on the flea * Get an array of unique items that can be sold on the flea
* @returns array of unique items * @returns array of unique items
*/ */
getAssortItems(): Item[]; getAssortItems(): Item[];
/**
* Check internal generatedAssortItems array has objects
* @returns true if array has objects
*/
protected assortsAreGenerated(): boolean; protected assortsAreGenerated(): boolean;
/** /**
* Generate an array of items the flea can sell * Generate an array of items the flea can sell
* @returns array of unique items * @returns array of unique items
*/ */
protected generateRagfairAssortItems(): Item[]; protected generateRagfairAssortItems(): Item[];
/**
* Get presets from globals.json
* @returns Preset object array
*/
protected getPresets(): Preset[];
/**
* Get default presets from globals.json
* @returns Preset object array
*/
protected getDefaultPresets(): Preset[];
/**
* Create a base assort item and return it with populated values + 999999 stack count + unlimited count = true
* @param tplId tplid to add to item
* @param id id to add to item
* @returns hydrated Item object
*/
protected createRagfairAssortItem(tplId: string, id?: string): Item; protected createRagfairAssortItem(tplId: string, id?: string): Item;
} }

View File

@ -41,15 +41,37 @@ export declare class RagfairOfferGenerator {
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
protected getTraderId(userID: string): string; protected getTraderId(userID: string): string;
protected getRating(userID: string): number; protected getRating(userID: string): number;
/**
* Is the offers user rating growing
* @param userID user to check rating of
* @returns true if its growing
*/
protected getRatingGrowing(userID: string): boolean; protected getRatingGrowing(userID: string): boolean;
/**
* Get number of section until offer should expire
* @param userID Id of the offer owner
* @param time Time the offer is posted
* @returns number of seconds until offer expires
*/
protected getOfferEndTime(userID: string, time: number): number; protected getOfferEndTime(userID: string, time: number): number;
/** /**
* Create multiple offers for items by using a unique list of items we've generated previously * Create multiple offers for items by using a unique list of items we've generated previously
* @param expiredOffers * @param expiredOffers optional, expired offers to regenerate
*/ */
generateDynamicOffers(expiredOffers?: Item[]): void; generateDynamicOffers(expiredOffers?: Item[]): void;
generateTraderOffers(traderID: string): void; /**
* Generate trader offers on flea using the traders assort data
* @param traderID Trader to generate offers for
*/
generateFleaOffersForTrader(traderID: string): void;
protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[]; protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[];
/**
* Add missing conditions to an item if needed
* Durabiltiy for repairable items
* HpResource for medical items
* @param item item to add conditions to
* @returns Item with conditions added
*/
protected addMissingCondition(item: Item): Item; protected addMissingCondition(item: Item): Item;
protected getOfferRequirements(items: Item[]): { protected getOfferRequirements(items: Item[]): {
count: number; count: number;
@ -57,6 +79,14 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** /**
* Create a flea offer and store it in the Ragfair server offers array * Create a flea offer and store it in the Ragfair server offers array
* @param userID owner of the offer
* @param time time offer is put up
* @param items items in the offer
* @param barterScheme
* @param loyalLevel
* @param price price of offer
* @param sellInOnePiece
* @returns
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
} }

View File

@ -8,9 +8,13 @@ import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../mo
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { RagfairPriceService } from "../services/RagfairPriceService"; import { RagfairPriceService } from "../services/RagfairPriceService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
/**
* Handle the creation of randomised scav case rewards
*/
export declare class ScavCaseRewardGenerator { export declare class ScavCaseRewardGenerator {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
@ -18,9 +22,10 @@ export declare class ScavCaseRewardGenerator {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected scavCaseConfig: IScavCaseConfig; protected scavCaseConfig: IScavCaseConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Create an array of rewards that will be given to the player upon completing their scav case build * Create an array of rewards that will be given to the player upon completing their scav case build
* @param body client request * @param body client request

View File

@ -1,7 +1,7 @@
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper"; import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { ConfigServer } from "../servers/ConfigServer";
import { IWeatherData } from "../models/eft/weather/IWeatherData"; import { IWeatherData } from "../models/eft/weather/IWeatherData";
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig"; import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class WeatherGenerator { export declare class WeatherGenerator {
@ -21,11 +21,16 @@ export declare class WeatherGenerator {
protected getAcceleratedTime(computedDate: Date): string; protected getAcceleratedTime(computedDate: Date): string;
/** /**
* Get current time formatted to fit BSGs requirement * Get current time formatted to fit BSGs requirement
* @param computedDate * @param computedDate date to format into bsg style
* @returns * @returns
*/ */
protected getNormalTime(computedDate: Date): string; protected getNormalTime(computedDate: Date): string;
generateWeather(data: IWeatherData): IWeatherData; /**
* Return randomised Weather data
* @param weatherData weather input data
* @returns Randomised weather data
*/
generateWeather(weatherData: IWeatherData): IWeatherData;
protected getWeightedFog(): string; protected getWeightedFog(): string;
protected getWeightedRain(): number; protected getWeightedRain(): number;
protected getRandomFloat(node: string): number; protected getRandomFloat(node: string): number;

View File

@ -0,0 +1,6 @@
import { InventoryMagGen } from "./InventoryMagGen";
export interface IInventoryMagGen {
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -0,0 +1,16 @@
import { MinMax } from "../../models/common/MinMax";
import { Inventory } from "../../models/eft/common/tables/IBotBase";
import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem";
export declare class InventoryMagGen {
private magCounts;
private magazineTemplate;
private weaponTemplate;
private ammoTemplate;
private pmcInventory;
constructor(magCounts: MinMax, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
getMagCount(): MinMax;
getMagazineTemplate(): ITemplateItem;
getWeaponTemplate(): ITemplateItem;
getAmmoTemplate(): ITemplateItem;
getPmcInventory(): Inventory;
}

View File

@ -0,0 +1,12 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { RandomUtil } from "../../../utils/RandomUtil";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
export declare class BarrelInventoryMagGen implements IInventoryMagGen {
protected randomUtil: RandomUtil;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(randomUtil: RandomUtil, botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -0,0 +1,14 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../../../helpers/ItemHelper";
import { ILogger } from "../../../models/spt/utils/ILogger";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
export declare class ExternalInventoryMagGen implements IInventoryMagGen {
protected logger: ILogger;
protected itemHelper: ItemHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(logger: ILogger, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -0,0 +1,10 @@
import { BotWeaponGeneratorHelper } from "../../../helpers/BotWeaponGeneratorHelper";
import { IInventoryMagGen } from "../IInventoryMagGen";
import { InventoryMagGen } from "../InventoryMagGen";
export declare class InternalMagazineInventoryMagGen implements IInventoryMagGen {
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
constructor(botWeaponGeneratorHelper: BotWeaponGeneratorHelper);
getPriority(): number;
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
process(inventoryMagGen: InventoryMagGen): void;
}

View File

@ -17,7 +17,7 @@ export declare class AssortHelper {
* @param assort assort items from a trader * @param assort assort items from a trader
* @returns assort items minus locked quest assorts * @returns assort items minus locked quest assorts
*/ */
stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort): ITraderAssort; stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, flea?: boolean): ITraderAssort;
/** /**
* Remove assorts from a trader that have not been unlocked yet * Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile * @param pmcProfile player profile
@ -32,5 +32,5 @@ export declare class AssortHelper {
* @param itemID item id to remove from asort * @param itemID item id to remove from asort
* @returns Modified assort * @returns Modified assort
*/ */
removeItemFromAssort(assort: ITraderAssort, itemID: string): ITraderAssort; removeItemFromAssort(assort: ITraderAssort, itemID: string, flea?: boolean): ITraderAssort;
} }

View File

@ -1,19 +1,33 @@
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper"; import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType"; import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem"; import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { Grid, ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
import { IBotConfig } from "../models/spt/config/IBotConfig"; import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { ItemFilterService } from "../services/ItemFilterService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil"; import { RandomUtil } from "../utils/RandomUtil";
import { BotWeaponGeneratorHelper } from "./BotWeaponGeneratorHelper";
import { ContainerHelper } from "./ContainerHelper"; import { ContainerHelper } from "./ContainerHelper";
import { InventoryHelper } from "./InventoryHelper"; import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { ProbabilityHelper } from "./ProbabilityHelper"; import { ProbabilityHelper } from "./ProbabilityHelper";
import { ProfileHelper } from "./ProfileHelper";
export declare class BotModLimits {
scope: ItemCount;
scopeMax: number;
scopeBaseTypes: string[];
flashlightLaser: ItemCount;
flashlightLaserMax: number;
flashlgihtLaserBaseTypes: string[];
}
export declare class ItemCount {
count: number;
}
export declare class BotGeneratorHelper { export declare class BotGeneratorHelper {
protected logger: ILogger; protected logger: ILogger;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
@ -25,16 +39,121 @@ export declare class BotGeneratorHelper {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected containerHelper: ContainerHelper; protected containerHelper: ContainerHelper;
protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, configServer: ConfigServer);
generateModsForItem(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
/** /**
* Is this magazine cylinder related (revolvers and grenade launchers) * Check mods are compatible and add to array
* @param magazineParentName the name of the magazines parent * @param equipment Equipment item to add mods to
* @returns true if it is cylinder related * @param modPool Mod list to choose frm
* @param parentId parentid of item to add mod to
* @param parentTemplate template objet of item to add mods to
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
* @returns Item + compatible mods as an array
*/ */
magazineIsCylinderRelated(magazineParentName: string): boolean; generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
/**
* @param sessionId session id
* @param weapon Weapon to add mods to
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponParentId parentId of weapon
* @param parentWeaponTemplate Weapon which mods will be generated on
* @param modSpawnChances Mod spawn chances
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges
* @param botRole Role of bot weapon is generated for
* @returns Weapon + mods array
*/
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string): Item[];
/**
*
* @param modSlot
* @param isRandomisableSlot
* @param modsParent
* @param botEquipBlacklist
* @param itemModPool
* @param weapon array with only weapon tpl in it, ready for mods to be added
* @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
* @param parentTemplate
* @returns
*/
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, modsParent: Slot, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
/**
* Find mod tpls of a provided type and add to modPool
* @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
* @param modTemplate db object for modItem we get compatible mods from
* @param modPool Pool of mods we are adding to
*/
protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
/**
* Check if mod item is on limited list + has surpassed the limit set for it
* @param botRole role the bot has e.g. assault
* @param modTemplate mods template data
* @param modLimits limits set for weapon being generated for this bot
* @returns true if over item limit
*/
protected modHasReachedItemLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits): boolean;
/**
* Initalise mod limits to be used when generating a weapon
* @param botRole "assault", "bossTagilla" or "pmc"
* @returns BotModLimits object
*/
protected initModLimits(botRole: string): BotModLimits;
/**
* Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole]
* @param allowedMods Mods to be added to mod pool
* @param botEquipBlacklist blacklist of items not allowed to be added to mod pool
* @param modSlot Slot to generate mods for
* @param itemModPool base mod pool to replace values of
*/
protected generateDynamicWeaponModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record<string, string[]>): void;
/**
* Find all compatible mods for equipment item and add to modPool
* @param itemDetails item to find mods for
* @param modPool ModPool to add mods to
*/
generateDynamicModPool(itemDetails: ITemplateItem, modPool: Mods): void;
/**
* Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
* @param allowedMods base mods to filter
* @param botEquipBlacklist equipment blacklist
* @param modSlot slot mods belong to
* @returns Filtered array of mod tpls
*/
protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
/**
* Check if the specific item type on the weapon has reached the set limit
* @param modTpl log mod tpl if over type limit
* @param currentCount current number of this item on gun
* @param maxLimit mod limit allowed
* @param botRole role of bot we're checking weapon of
* @returns true if limit reached
*/
protected weaponModLimitReached(modTpl: string, currentCount: {
count: number;
}, maxLimit: number, botRole: string): boolean;
/**
* Log errors if mod is not compatible with slot
* @param modToAdd template of mod to check
* @param itemSlot slot the item will be placed in
* @param modSlot slot the mod will fill
* @param parentTemplate tempalte of the mods parent item
* @returns true if valid
*/
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
/**
* Create a mod item with parameters as properties
* @param modId _id
* @param modTpl _tpl
* @param parentId parentId
* @param modSlot slotId
* @param modTemplate Used to add additional properites in the upd object
* @returns Item object
*/
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem): Item;
/** /**
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
* never return true for an item that has 0% spawn chance * never return true for an item that has 0% spawn chance
@ -46,7 +165,7 @@ export declare class BotGeneratorHelper {
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
/** /**
* Get a list of containers that hold ammo * Get a list of containers that hold ammo
* e.g. mod_magazine * e.g. mod_magazine / patron_in_weapon_000
* @returns string array * @returns string array
*/ */
protected getAmmoContainers(): string[]; protected getAmmoContainers(): string[];
@ -62,11 +181,11 @@ export declare class BotGeneratorHelper {
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots. * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine" * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
* * @param items The items where the CylinderMagazine's camora are appended to
* @param {object} items The items where the CylinderMagazine's camora are appended to * @param modPool modPool which should include available cartrigdes
* @param {object} modPool modPool which should include available cartrigdes * @param parentId The CylinderMagazine's UID
* @param {string} parentId The CylinderMagazine's UID * @param parentTemplate The CylinderMagazine's template
* @param {object} parentTemplate The CylinderMagazine's template * @returns
*/ */
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void; protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
/** /**
@ -75,6 +194,13 @@ export declare class BotGeneratorHelper {
* @returns string array of shells fro luitple camora sources * @returns string array of shells fro luitple camora sources
*/ */
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[]; protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Adds properties to an item
* e.g. Repairable / HasHinge / Foldable / MaxDurability
* @param itemTemplate
* @param botRole Used by weapons to randomise the durability values
* @returns Item Upd object with extra properties
*/
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: any): { generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: any): {
upd?: Upd; upd?: Upd;
}; };
@ -92,13 +218,15 @@ export declare class BotGeneratorHelper {
* @returns Repairable object * @returns Repairable object
*/ */
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable; protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
/** /**
* Sort by spawn chance, highest to lowest, higher is more common * Get a random mod from an items compatible mods Filter array
* @param unsortedModArray String array to sort * @param modTpl
* @returns Sorted string array * @param parentSlot
* @param modSlot
* @param items
* @returns item tpl
*/ */
protected sortModArray(unsortedModArray: string[]): string[]; protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
/** /**
* Can an item be added to an item without issue * Can an item be added to an item without issue
* @param items * @param items
@ -107,18 +235,8 @@ export declare class BotGeneratorHelper {
* @returns true if possible * @returns true if possible
*/ */
isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean; isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean;
/**
* Adds an item with all its childern into specified equipmentSlots, wherever it fits.
* @param equipmentSlots
* @param parentId
* @param parentTpl
* @param itemWithChildren
* @param inventory
* @returns a `boolean` indicating item was added
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: PmcInventory): boolean;
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
} }
/** TODO - move into own class */
export declare class ExhaustableArray<T> { export declare class ExhaustableArray<T> {
private itemPool; private itemPool;
private randomUtil; private randomUtil;

View File

@ -13,11 +13,34 @@ export declare class BotHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/**
* Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retreive difficulty of
* @param difficulty difficulty to get settings for (easy/normal etc)
* @returns Difficulty object
*/
getBotDifficultySettings(type: string, difficulty: string): Difficulty; getBotDifficultySettings(type: string, difficulty: string): Difficulty;
/**
* Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for
* @returns IBotType object
*/
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Get difficulty settings for a PMC
* @param type "usec" / "bear"
* @param difficulty what difficulty to retrieve
* @returns Difficulty object
*/
getPmcDifficultySettings(type: string, difficulty: string): Difficulty; getPmcDifficultySettings(type: string, difficulty: string): Difficulty;
/**
* Choose a random difficulty from - easy/normal/hard/impossible
* @returns random difficulty
*/
chooseRandomDifficulty(): string;
/** /**
* Randomise the chance the PMC will attack their own side * Randomise the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings * @param difficultySettings pmc difficulty settings
*/ */
randomisePmcHostility(difficultySettings: Difficulty): void; randomisePmcHostility(difficultySettings: Difficulty): void;
@ -31,7 +54,7 @@ export declare class BotHelper {
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/** /**
* Add a bot to the ENEMY_BOT_TYPES array * Add a bot to the ENEMY_BOT_TYPES array, do not add itself if its on the enemy list
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
* @param typesToAdd bot type to add to enemy list * @param typesToAdd bot type to add to enemy list
*/ */
@ -42,4 +65,10 @@ export declare class BotHelper {
* @param typesToAdd bot type to add to revenge list * @param typesToAdd bot type to add to revenge list
*/ */
addBotToRevengeList(difficultySettings: Difficulty, typesToAdd: string[]): void; addBotToRevengeList(difficultySettings: Difficulty, typesToAdd: string[]): void;
/**
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check
* @param botRole the bot role to check if should be a pmc
* @returns true if should be a pmc
*/
shouldBotBePmc(botRole: string): boolean;
} }

View File

@ -0,0 +1,78 @@
import { MinMax } from "../models/common/MinMax";
import { Inventory } from "../models/eft/common/tables/IBotBase";
import { Item } from "../models/eft/common/tables/IItem";
import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { ContainerHelper } from "./ContainerHelper";
import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper";
export declare class BotWeaponGeneratorHelper {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected inventoryHelper: InventoryHelper;
protected containerHelper: ContainerHelper;
constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper);
/**
* Get a randomised number of bullets for a specific magazine
* @param magCounts min and max count of magazines
* @param magTemplate magazine to generate bullet count for
* @returns bullet count number
*/
getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
/**
* Get a randomised count of magazines
* @param magCounts min and max value returned value can be between
* @returns numberical value of magazine count
*/
getRandomisedMagazineCount(magCounts: MinMax): number;
/**
* Is this magazine cylinder related (revolvers and grenade launchers)
* @param magazineParentName the name of the magazines parent
* @returns true if it is cylinder related
*/
magazineIsCylinderRelated(magazineParentName: string): boolean;
/**
* Create a magazine using the parameters given
* @param magazineTpl Tpl of the magazine to create
* @param ammoTpl Ammo to add to magazine
* @param magTemplate template object of magazine
* @returns Item array
*/
createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
/**
* Add a specific number of cartrdiges to a bots inventory (vest/pocket)
* @param ammoTpl Ammo tpl to add to vest/pockets
* @param cartridgeCount number of cartridges to add to vest/pockets
* @param inventory bot inventory to add cartridges to
*/
addBulletsToVestAndPockets(ammoTpl: string, cartridgeCount: number, inventory: Inventory): void;
/**
* Get a weapons default magazine template id
* @param weaponTemplate weapon to get default magazine for
* @returns tpl of magazine
*/
getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string;
/**
* Adds an item with all its childern into specified equipmentSlots, wherever it fits.
* @param equipmentSlots
* @param parentId
* @param parentTpl
* @param itemWithChildren
* @param inventory
* @returns a `boolean` indicating item was added
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): boolean;
/**
* is the provided item allowed inside a container
* @param slot location item wants to be placed in
* @param itemTpl item being placed
* @returns true if allowed
*/
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
}

View File

@ -44,14 +44,72 @@ export declare class HideoutHelper {
initProduction(recipeId: string, productionTime: number): Production; initProduction(recipeId: string, productionTime: number): Production;
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/**
* TODO:
* After looking at the skills there doesnt seem to be a configuration per skill to boost
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it)
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void;
/**
* Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id
*/
updatePlayerHideout(sessionID: string): void; updatePlayerHideout(sessionID: string): void;
/**
* Update progress timer for water collector
* @param pmcData profile to update
* @param productionId id of water collection production to update
* @param hideoutProperties Hideout properties
*/
protected updateWaterCollectorProductionTimer(pmcData: IPmcData, productionId: string, hideoutProperties: {
btcFarmCGs?: number;
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
}): void;
/**
* Iterate over productions and update their progress timers
* @param pmcData Profile to check for productions and update
* @param hideoutProperties Hideout properties
*/
protected updateProductionTimers(pmcData: IPmcData, hideoutProperties: {
btcFarmCGs: number;
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
}): void;
/**
* Update progress timer for scav case
* @param pmcData Profile to update
* @param productionId Id of scav case production to update
*/
protected updateScavCaseProductionTimer(pmcData: IPmcData, productionId: string): void;
/**
* Iterate over hideout areas that use resources (fuel/filters etc) and update associated values
* @param sessionID Session id
* @param pmcData Profile to update areas of
* @param hideoutProperties hideout properties
*/
protected updateAreasWithResources(sessionID: string, pmcData: IPmcData, hideoutProperties: {
btcFarmCGs: number;
isGeneratorOn: boolean;
waterCollectorHasFilter: boolean;
}): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): HideoutArea; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterFilters(waterFilterArea: HideoutArea, pwProd: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update
* @param production production object
* @param isGeneratorOn is generatory enabled
* @param pmcData Player profile
* @returns Updated HideoutArea object
*/
protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): HideoutArea; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): void;
protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production; protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production;
protected getBTCSlots(pmcData: IPmcData): number; protected getBTCSlots(pmcData: IPmcData): number;
protected getManagementSkillsSlots(): number; protected getManagementSkillsSlots(): number;

View File

@ -5,6 +5,7 @@ import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequ
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { InventoryHelper } from "./InventoryHelper"; import { InventoryHelper } from "./InventoryHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
@ -15,19 +16,8 @@ export declare class InRaidHelper {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected inventoryHelper: InventoryHelper; protected inventoryHelper: InventoryHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper); protected profileFixerService: ProfileFixerService;
/** constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
* Reset the SPT inraid property stored in a profile to 'none'
* @param sessionID Session id
*/
protected removePlayer(sessionID: string): void;
/**
* Some maps have one-time-use keys (e.g. Labs
* Remove the relevant key from an inventory based on the post-raid request data passed in
* @param offraidData post-raid data
* @param sessionID Session id
*/
protected removeMapAccessKey(offraidData: ISaveProgressRequestData, sessionID: string): void;
/** /**
* Check an array of items and add an upd object to money items with a stack count of 1 * Check an array of items and add an upd object to money items with a stack count of 1
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues * Single stack money items have no upd object and thus no StackObjectsCount, causing issues
@ -52,6 +42,18 @@ export declare class InRaidHelper {
* @returns Reset profile object * @returns Reset profile object
*/ */
updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData; updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): IPmcData;
/**
* Some maps have one-time-use keys (e.g. Labs
* Remove the relevant key from an inventory based on the post-raid request data passed in
* @param offraidData post-raid data
* @param sessionID Session id
*/
protected removeMapAccessKey(offraidData: ISaveProgressRequestData, sessionID: string): void;
/**
* Set the SPT inraid location Profile property to 'none'
* @param sessionID Session id
*/
protected setPlayerInRaidLocationStatusToNone(sessionID: string): void;
/** /**
* Adds SpawnedInSession property to items found in a raid * Adds SpawnedInSession property to items found in a raid
* Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true * Removes SpawnedInSession for non-scav players if item was taken into raid with SpawnedInSession = true
@ -93,5 +95,10 @@ export declare class InRaidHelper {
* @returns true if item is kept after death * @returns true if item is kept after death
*/ */
isItemKeptAfterDeath(slotId: string): boolean; isItemKeptAfterDeath(slotId: string): boolean;
/**
* Return the equipped items from a players inventory
* @param items Players inventory to search through
* @returns an array of equipped items
*/
getPlayerGear(items: Item[]): Item[]; getPlayerGear(items: Item[]): Item[];
} }

View File

@ -43,6 +43,7 @@ export declare class InventoryHelper {
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, configServer: ConfigServer);
addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse; addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse;
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse; removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record<number, number>; getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record<number, number>;
protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): Record<number, number>; protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): Record<number, number>;
protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash;

View File

@ -1,35 +1,30 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { InsuredItem } from "../models/eft/common/tables/IBotBase"; import { InsuredItem } from "../models/eft/common/tables/IBotBase";
import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { Item, Repairable } from "../models/eft/common/tables/IItem";
import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
import { RandomUtil } from "../utils/RandomUtil";
declare class ItemHelper { declare class ItemHelper {
protected logger: ILogger; protected logger: ILogger;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected randomUtil: RandomUtil;
protected objectId: ObjectId;
protected mathUtil: MathUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer); constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer);
/** /**
* Checks if a id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
* @param {string} tpl the template id / tpl * @param {string} tpl the template id / tpl
* @returns boolean; true for items that may be in player posession and not quest items * @returns boolean; true for items that may be in player posession and not quest items
*/ */
isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean;
/**
* 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.
* @param {*} tpl template id of item to check
* @returns boolean: true if item is valid reward
*/
isValidRewardItem(tpl: string): boolean;
/**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
*/
getRewardableItems(): [string, ITemplateItem][];
/** /**
* Check if the tpl / template Id provided is a descendent of the baseclass * Check if the tpl / template Id provided is a descendent of the baseclass
* *
@ -84,6 +79,11 @@ declare class ItemHelper {
* @returns {array} The array of StackSlotItems * @returns {array} The array of StackSlotItems
*/ */
generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[];
/**
* Get cloned copy of all item data from items.json
* @returns array of ITemplateItem objects
*/
getItems(): ITemplateItem[];
/** /**
* Gets item data from items.json * Gets item data from items.json
* @param tpl items template id to look up * @param tpl items template id to look up
@ -196,6 +196,22 @@ declare class ItemHelper {
* @returns ItemSize object (width and height) * @returns ItemSize object (width and height)
*/ */
getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize;
/**
* Get a random cartridge from an items Filter property
* @param item
* @returns
*/
getRandomCompatibleCaliberTemplateId(item: ITemplateItem): string;
createRandomMagCartridges(magTemplate: ITemplateItem, parentId: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, caliber?: string): Item;
protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
createCartidges(parentId: string, ammoTpl: string, stackCount: number): Item;
/**
* Get the size of a stack, return 1 if no stack object count property found
* @param item Item to get stack size of
* @returns size of stack
*/
getItemStackSize(item: Item): number;
} }
declare namespace ItemHelper { declare namespace ItemHelper {
interface ItemSize { interface ItemSize {

View File

@ -2,24 +2,41 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { Stats } from "../models/eft/common/tables/IBotBase"; import { Stats } from "../models/eft/common/tables/IBotBase";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { Watermark } from "../utils/Watermark"; import { Watermark } from "../utils/Watermark";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
export declare class ProfileHelper { export declare class ProfileHelper {
protected logger: ILogger;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected watermark: Watermark; protected watermark: Watermark;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected profileSnapshotService: ProfileSnapshotService;
protected fenceService: FenceService; protected fenceService: FenceService;
constructor(jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, fenceService: FenceService); constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
resetProfileQuestCondition(sessionID: string, conditionId: string): void; resetProfileQuestCondition(sessionID: string, conditionId: string): void;
getCompleteProfile(sessionID: string): IPmcData[]; getCompleteProfile(sessionID: string): IPmcData[];
/**
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen
* Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using
* the now updated profile values as a base, meaning it shows x2 xp gained
* Instead, clone the post-raid profile (so we dont alter its values), apply the pre-raid xp values to the cloned objects and return
* Delete snapshot of pre-raid profile prior to returning profile data
* @param sessionId Session id
* @param output pmc and scav profiles array
* @param pmcProfile post-raid pmc profile
* @param scavProfile post-raid scav profile
* @returns updated profile array
*/
protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
/** /**
* Add experience to a PMC inside the players profile * Add experience to a PMC inside the players profile

View File

@ -36,13 +36,30 @@ export declare class QuestHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
questStatus(pmcData: IPmcData, questID: string): QuestStatus;
/** /**
* returns true is the condition is satisfied * Get status of a quest by quest id
* @param pmcData Profile to search
* @param questID Quest id to look up
* @returns QuestStauts enum
*/ */
evaluateLevel(pmcProfile: IPmcData, cond: AvailableForConditions): boolean; getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
/**
* returns true is the level condition is satisfied
* @param playerLevel Players level
* @param condition Quest condition
* @returns true if player level is greater than or equal to quest
*/
doesPlayerLevelFulfilCondition(playerLevel: number, condition: AvailableForConditions): boolean;
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[]; getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progress: number): void; /**
* Increase skill points of a skill on player profile
* @param sessionID Session id
* @param pmcData Player profile
* @param output output object to send back to client
* @param skillName Name of skill to increase skill points of
* @param progressAmount Amount of skill points to add to skill
*/
rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void;
getQuestLocale(questId: string): any; getQuestLocale(questId: string): any;
/** /**
* Debug Routine for showing some information on the * Debug Routine for showing some information on the

View File

@ -22,12 +22,14 @@ import { ProfileHelper } from "./ProfileHelper";
import { RagfairHelper } from "./RagfairHelper"; import { RagfairHelper } from "./RagfairHelper";
import { RagfairServerHelper } from "./RagfairServerHelper"; import { RagfairServerHelper } from "./RagfairServerHelper";
import { RagfairSortHelper } from "./RagfairSortHelper"; import { RagfairSortHelper } from "./RagfairSortHelper";
import { TraderHelper } from "./TraderHelper";
export declare class RagfairOfferHelper { export declare class RagfairOfferHelper {
protected logger: ILogger; protected logger: ILogger;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemEventRouter: ItemEventRouter; protected itemEventRouter: ItemEventRouter;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected dialogueHelper: DialogueHelper; protected dialogueHelper: DialogueHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
@ -43,10 +45,10 @@ export declare class RagfairOfferHelper {
protected static goodSoldTemplate: string; protected static goodSoldTemplate: string;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[]; getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
processOffers(sessionID: string): boolean; processOffersOnProfile(sessionID: string): boolean;
protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected getProfileOffers(sessionID: string): IRagfairOffer[];
protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;

View File

@ -11,6 +11,12 @@ export declare class RagfairSellHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
calculateSellChance(baseChance: number, offerPrice: number, requirementsPriceInRub: number): number; calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number;
rollForSale(sellChance: number, count: number): SellResult[]; /**
* Determine if the offer being listed will be sold
* @param sellChancePercent chance item will sell
* @param itemSellCount count of items to sell
* @returns Array of purchases of item(s) lsited
*/
rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[];
} }

View File

@ -6,6 +6,7 @@ import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocaleService } from "../services/LocaleService"; import { LocaleService } from "../services/LocaleService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -13,6 +14,9 @@ import { RandomUtil } from "../utils/RandomUtil";
import { DialogueHelper } from "./DialogueHelper"; import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { ProfileHelper } from "./ProfileHelper"; import { ProfileHelper } from "./ProfileHelper";
/**
* Helper class for common ragfair server actions
*/
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
@ -23,11 +27,12 @@ export declare class RagfairServerHelper {
protected localeService: LocaleService; protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper; protected dialogueHelper: DialogueHelper;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer); constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails

View File

@ -14,8 +14,17 @@ export declare class RepairHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected repairConfig: IRepairConfig; protected repairConfig: IRepairConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit?: boolean, applyRandomDegradation?: boolean): Item; /**
protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number): number; *
protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, armorMax: number): number; * @param itemToRepair item to update durability details
* @param itemToRepairDetails db details of item to repair
* @param isArmor Is item being repaired a piece of armor
* @param amountToRepair how many unit of durability to repair
* @param useRepairKit Is item being repaired with a repair kit
* @param applyMaxDurabilityDegradation should item have max durability reduced
*/
updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void;
protected getRandomisedArmorRepairDegredationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
protected getRandomisedWeaponRepairDegredationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
isWeaponTemplate(tpl: string): boolean; isWeaponTemplate(tpl: string): boolean;
} }

View File

@ -39,6 +39,12 @@ export declare class TradeHelper {
* @returns * @returns
*/ */
sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse; sellItem(pmcData: IPmcData, body: IProcessSellTradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Increment the assorts buy count by number of items purchased
* Show error on screen if player attepts to buy more than what the buy max allows
* @param assortBeingPurchased assort being bought
* @param itemsPurchasedCount number of items being bought
*/
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void; protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void; protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
} }

View File

@ -1,7 +1,7 @@
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator"; import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
@ -10,13 +10,16 @@ import { FenceService } from "../services/FenceService";
import { TraderAssortService } from "../services/TraderAssortService"; import { TraderAssortService } from "../services/TraderAssortService";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil"; import { MathUtil } from "../utils/MathUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { AssortHelper } from "./AssortHelper"; import { AssortHelper } from "./AssortHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
import { ProfileHelper } from "./ProfileHelper"; import { ProfileHelper } from "./ProfileHelper";
import { TraderHelper } from "./TraderHelper";
export declare class TraderAssortHelper { export declare class TraderAssortHelper {
protected logger: ILogger; protected logger: ILogger;
protected jsonUtil: JsonUtil; protected jsonUtil: JsonUtil;
protected mathUtil: MathUtil; protected mathUtil: MathUtil;
protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected assortHelper: AssortHelper; protected assortHelper: AssortHelper;
@ -24,18 +27,32 @@ export declare class TraderAssortHelper {
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
protected ragfairOfferGenerator: RagfairOfferGenerator; protected ragfairOfferGenerator: RagfairOfferGenerator;
protected traderAssortService: TraderAssortService; protected traderAssortService: TraderAssortService;
protected traderHelper: TraderHelper;
protected fenceService: FenceService; protected fenceService: FenceService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, fenceService: FenceService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
/** /**
* Get a traders assorts * Get a traders assorts
* Can be used for returning ragfair / fence assorts * Can be used for returning ragfair / fence assorts
* Filter out assorts not unlocked due to level OR quest completion
* @param sessionId session id * @param sessionId session id
* @param traderId trader id * @param traderId traders id
* @returns a traders assorts * @returns a traders' assorts
*/ */
getAssort(sessionId: string, traderId: string): ITraderAssort; getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;
/**
* Reset a traders assorts and move nextResupply value to future
* Flag trader as needing a flea offer reset to be picked up by flea update() function
* @param trader trader details to alter
*/
resetExpiredTrader(trader: ITrader): void;
/**
* Does the supplied trader need its assorts refreshed
* @param traderID Trader to check
* @returns true they need refreshing
*/
traderAssortsHaveExpired(traderID: string): boolean;
/** /**
* Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config * Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config
* @param traderAssort Assorts to multiple price of * @param traderAssort Assorts to multiple price of

View File

@ -9,6 +9,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService"; import { FenceService } from "../services/FenceService";
import { PlayerService } from "../services/PlayerService"; import { PlayerService } from "../services/PlayerService";
import { TimeUtil } from "../utils/TimeUtil";
import { HandbookHelper } from "./HandbookHelper"; import { HandbookHelper } from "./HandbookHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
@ -23,9 +24,10 @@ export declare class TraderHelper {
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected playerService: PlayerService; protected playerService: PlayerService;
protected fenceService: FenceService; protected fenceService: FenceService;
protected timeUtil: TimeUtil;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected traderConfig: ITraderConfig; protected traderConfig: ITraderConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
getTrader(traderID: string, sessionID: string): ITraderBase; getTrader(traderID: string, sessionID: string): ITraderBase;
getTraderAssortsById(traderId: string): ITraderAssort; getTraderAssortsById(traderId: string): ITraderAssort;
/** /**
@ -63,7 +65,7 @@ export declare class TraderHelper {
* @param item * @param item
* @returns boolean * @returns boolean
*/ */
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean; protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean;
/** /**
* Get the price of an item and all of its attached children * Get the price of an item and all of its attached children
* Take into account bonuses/adjsutments e.g. discounts * Take into account bonuses/adjsutments e.g. discounts
@ -97,6 +99,17 @@ export declare class TraderHelper {
* @param sessionID session id * @param sessionID session id
*/ */
lvlUp(traderID: string, sessionID: string): void; lvlUp(traderID: string, sessionID: string): void;
/**
* Get the next update timestamp for a trader
* @param traderID Trader to look up update value for
* @returns future timestamp
*/
getNextUpdateTimestamp(traderID: string): number;
/**
* Get the reset time between trader assort refreshes in seconds
* @param traderId Trader to look up
* @returns Time in seconds
*/
getTraderUpdateSeconds(traderId: string): number; getTraderUpdateSeconds(traderId: string): number;
/** /**
* check if an item is allowed to be sold to a trader * check if an item is allowed to be sold to a trader

View File

@ -33,9 +33,20 @@ export declare class PreAkiModLoader implements IModLoader {
protected importClass(name: string, filepath: string, container: DependencyContainer): void; protected importClass(name: string, filepath: string, container: DependencyContainer): void;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
/** /**
* * Check for duplciate mods loaded, show error if duplicate mod found
* @param mods Get an array of broken/invalid mods by name * @param modPackageData dictionary of mod package.json data
* @returns Mod names array */
protected checkForDuplicateMods(modPackageData: Record<string, IPackageJsonData>): void;
/**
* Check for and return duplicate strings inside an array
* @param stringArray Array to check for duplicates
* @returns string array of duplicates, empty if none found
*/
protected getDuplicates(stringArray: string[]): string[];
/**
* Get an array of mods with errors that prevent them from working with SPT
* @param mods mods to validate
* @returns Mod names as array
*/ */
protected getBrokenMods(mods: string[]): string[]; protected getBrokenMods(mods: string[]): string[];
/** /**
@ -57,7 +68,12 @@ export declare class PreAkiModLoader implements IModLoader {
protected addMod(mod: string): Promise<void>; protected addMod(mod: string): Promise<void>;
protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean; protected areModDependenciesFulfilled(pkg: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
protected isModCompatible(mod: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean; protected isModCompatible(mod: IPackageJsonData, loadedMods: Record<string, IPackageJsonData>): boolean;
protected validMod(mod: string): boolean; /**
* Validate a mod passes a number of checks
* @param modName name of mod in /mods/ to validate
* @returns true if valid
*/
protected validMod(modName: string): boolean;
protected getLoadOrderRecursive(mod: string, result: Record<string, string>, visited: Record<string, string>): void; protected getLoadOrderRecursive(mod: string, result: Record<string, string>, visited: Record<string, string>): void;
protected getLoadOrder(mods: Record<string, ModLoader.IMod>): Record<string, string>; protected getLoadOrder(mods: Record<string, ModLoader.IMod>): Record<string, string>;
getContainer(): DependencyContainer; getContainer(): DependencyContainer;

View File

@ -1175,5 +1175,6 @@ export interface Preset {
_name: string; _name: string;
_parent: string; _parent: string;
_items: Item[]; _items: Item[];
/** Default presets have this property */
_encyclopedia?: string; _encyclopedia?: string;
} }

View File

@ -137,7 +137,7 @@ export interface BotLocationModifier {
VisibleDistance: number; VisibleDistance: number;
} }
export interface MinMaxBot { export interface MinMaxBot {
WildSpawnType: string; WildSpawnType: WildSpawnType;
max: number; max: number;
min: number; min: number;
} }
@ -195,7 +195,7 @@ export interface Wave {
BotPreset: string; BotPreset: string;
BotSide: string; BotSide: string;
SpawnPoints: string; SpawnPoints: string;
WildSpawnType: string; WildSpawnType: WildSpawnType;
isPlayers: boolean; isPlayers: boolean;
number: number; number: number;
slots_max: number; slots_max: number;
@ -203,3 +203,7 @@ export interface Wave {
time_max: number; time_max: number;
time_min: number; time_min: number;
} }
export declare enum WildSpawnType {
ASSAULT = "assault",
MARKSMAN = "marksman"
}

View File

@ -28,6 +28,8 @@ export interface IBotBase {
CarExtractCounts: CarExtractCounts; CarExtractCounts: CarExtractCounts;
SurvivorClass: SurvivorClass; SurvivorClass: SurvivorClass;
WishList: string[]; WishList: string[];
/** SPT specific property used during bot generation in raid */
sptIsPmc?: boolean;
} }
export interface Info { export interface Info {
EntryPoint: string; EntryPoint: string;
@ -66,13 +68,13 @@ export interface IBan {
dateTime: number; dateTime: number;
} }
export declare enum BanType { export declare enum BanType {
Chat = 0, CHAT = 0,
RagFair = 1, RAGFAIR = 1,
Voip = 2, VOIP = 2,
Trading = 3, TRADING = 3,
Online = 4, ONLINE = 4,
Friends = 5, FRIENDS = 5,
ChangeNickname = 6 CHANGE_NICKNAME = 6
} }
export interface Customization { export interface Customization {
Head: string; Head: string;
@ -312,11 +314,11 @@ export interface Notes {
export interface CarExtractCounts { export interface CarExtractCounts {
} }
export declare enum SurvivorClass { export declare enum SurvivorClass {
Unknown = 0, UNKNOWN = 0,
Neutralizer = 1, NEUTRALIZER = 1,
Marauder = 2, MARAUDER = 2,
Paramedic = 3, PARAMEDIC = 3,
Survivor = 4 SURVIVOR = 4
} }
export interface Quest { export interface Quest {
qid: string; qid: string;

View File

@ -34,6 +34,7 @@ export interface Props {
LootExperience?: number; LootExperience?: number;
ExamineExperience?: number; ExamineExperience?: number;
HideEntrails?: boolean; HideEntrails?: boolean;
InsuranceDisabled?: boolean;
RepairCost?: number; RepairCost?: number;
RepairSpeed?: number; RepairSpeed?: number;
ExtraSizeLeft?: number; ExtraSizeLeft?: number;
@ -79,7 +80,7 @@ export interface Props {
HasShoulderContact?: boolean; HasShoulderContact?: boolean;
SightingRange?: number; SightingRange?: number;
DoubleActionAccuracyPenaltyMult?: number; DoubleActionAccuracyPenaltyMult?: number;
ModesCount: any; ModesCount?: any;
DurabilityBurnModificator?: number; DurabilityBurnModificator?: number;
HeatFactor?: number; HeatFactor?: number;
CoolFactor?: number; CoolFactor?: number;
@ -155,7 +156,7 @@ export interface Props {
RigLayoutName?: string; RigLayoutName?: string;
MaxDurability?: number; MaxDurability?: number;
armorZone?: string[]; armorZone?: string[];
armorClass: any; armorClass?: any;
mousePenalty?: number; mousePenalty?: number;
weaponErgonomicPenalty?: number; weaponErgonomicPenalty?: number;
BluntThroughput?: number; BluntThroughput?: number;
@ -206,6 +207,7 @@ export interface Props {
IsOneoff?: boolean; IsOneoff?: boolean;
MustBoltBeOpennedForExternalReload?: boolean; MustBoltBeOpennedForExternalReload?: boolean;
MustBoltBeOpennedForInternalReload?: boolean; MustBoltBeOpennedForInternalReload?: boolean;
NoFiremodeOnBoltcatch?: boolean;
BoltAction?: boolean; BoltAction?: boolean;
HipAccuracyRestorationDelay?: number; HipAccuracyRestorationDelay?: number;
HipAccuracyRestorationSpeed?: number; HipAccuracyRestorationSpeed?: number;
@ -252,8 +254,8 @@ export interface Props {
foodUseTime?: number; foodUseTime?: number;
foodEffectType?: string; foodEffectType?: string;
StimulatorBuffs?: string; StimulatorBuffs?: string;
effects_health: any; effects_health?: any;
effects_damage: any; effects_damage?: any;
MaximumNumberOfUsage?: number; MaximumNumberOfUsage?: number;
knifeHitDelay?: number; knifeHitDelay?: number;
knifeHitSlashRate?: number; knifeHitSlashRate?: number;

View File

@ -7,7 +7,7 @@ export interface ITrader {
suits?: ISuit[]; suits?: ISuit[];
} }
export interface ITraderBase { export interface ITraderBase {
refreshAssort: boolean; refreshTraderRagfairOffers: boolean;
_id: string; _id: string;
avatar: string; avatar: string;
balance_dol: number; balance_dol: number;
@ -58,7 +58,7 @@ export interface Repair {
quality: string; quality: string;
} }
export interface ITraderAssort { export interface ITraderAssort {
nextResupply?: number; nextResupply: number;
items: Item[]; items: Item[];
barter_scheme: Record<string, IBarterScheme[][]>; barter_scheme: Record<string, IBarterScheme[][]>;
loyal_level_items: Record<string, number>; loyal_level_items: Record<string, number>;
@ -67,6 +67,7 @@ export interface IBarterScheme {
count: number; count: number;
_tpl: string; _tpl: string;
onlyFunctional?: boolean; onlyFunctional?: boolean;
sptQuestLocked?: boolean;
} }
export interface ISuit { export interface ISuit {
_id: string; _id: string;

View File

@ -1,5 +1,5 @@
export declare enum Effect { export declare enum Effect {
Fracture = "Fracture", FRACTURE = "Fracture",
LightBleeding = "LightBleeding", LIGHT_BLEEDING = "LightBleeding",
HeavyBleeding = "HeavyBleeding" HEAVY_BLEEDING = "HeavyBleeding"
} }

View File

@ -7,12 +7,12 @@ export interface IOffraidHealRequestData extends IBaseInteractionRequestData {
time: number; time: number;
} }
export declare enum BodyPart { export declare enum BodyPart {
Head = 0, HEAD = "Head",
Chest = 1, CHEST = "Chest",
Stomach = 2, STOMACH = "Stomach",
LeftArm = 3, LEFT_ARM = "LeftArm",
RightArm = 4, RIGHT_ARM = "RightArm",
LeftLeg = 5, LEFT_LEG = "LeftLeg",
RightLeg = 6, RIGHT_LEG = "RightLeg",
Common = 7 COMMON = "Common"
} }

View File

@ -1,9 +1,9 @@
export interface INotifierChannel { export interface INotifierChannel {
"server": string; server: string;
"channel_id": string; channel_id: string;
"url": string; url: string;
"notifierServer": string; notifierServer: string;
"ws": string; ws: string;
} }
import { Message } from "../profile/IAkiProfile"; import { Message } from "../profile/IAkiProfile";
export interface INotification { export interface INotification {

View File

@ -15,6 +15,8 @@ export interface IRagfairOffer {
name?: string; name?: string;
shortName?: string; shortName?: string;
loyaltyLevel: number; loyaltyLevel: number;
buyRestrictionMax?: number;
buyRestrictionCurrent?: number;
locked: boolean; locked: boolean;
unlimitedCount: boolean; unlimitedCount: boolean;
summaryCost: number; summaryCost: number;

View File

@ -23,7 +23,7 @@ export declare enum Ammo762x54 {
BT_GZH = "5e023d34e8a400319a28ed44", BT_GZH = "5e023d34e8a400319a28ed44",
BS_GZH = "5e023d48186a883be655e551" BS_GZH = "5e023d48186a883be655e551"
} }
export declare enum Ammo338Lapua { export declare enum Ammo86x70 {
TAC_X = "5fc382b6d6fa9c00c571bbc3", TAC_X = "5fc382b6d6fa9c00c571bbc3",
UCW = "5fc382c1016cce60e8341b20", UCW = "5fc382c1016cce60e8341b20",
AP = "5fc382a9d724d907e2077dab", AP = "5fc382a9d724d907e2077dab",
@ -85,13 +85,13 @@ export declare enum Ammo9x21 {
PE_GZH = "5a26ac06c4a282000c5a90a8", PE_GZH = "5a26ac06c4a282000c5a90a8",
BT_GZH = "5a26ac0ec4a28200741e1e18" BT_GZH = "5a26ac0ec4a28200741e1e18"
} }
export declare enum Ammo357Mag { export declare enum Ammo9x33R {
FMJ = "62330b3ed4dc74626d570b95", FMJ = "62330b3ed4dc74626d570b95",
HOLLOW_POINT = "62330bfadc5883093563729b", HOLLOW_POINT = "62330bfadc5883093563729b",
SOFT_POINT = "62330c40bdd19b369e1e53d1", SOFT_POINT = "62330c40bdd19b369e1e53d1",
JACKET_HP = "62330c18744e5e31df12f516" JACKET_HP = "62330c18744e5e31df12f516"
} }
export declare enum Ammo45ACP { export declare enum Ammo1143x23ACP {
MATCH_FMJ = "5e81f423763d9f754677bf2e", MATCH_FMJ = "5e81f423763d9f754677bf2e",
HYDRA_SHOK = "5efb0fc6aeb21837e749c801", HYDRA_SHOK = "5efb0fc6aeb21837e749c801",
LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3", LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3",
@ -126,7 +126,7 @@ export declare enum Ammo556x45 {
MK_318_MOD_0_SOST = "60194943740c5d77f6705eea", MK_318_MOD_0_SOST = "60194943740c5d77f6705eea",
SSA_AP = "601949593ae8f707c4608daa" SSA_AP = "601949593ae8f707c4608daa"
} }
export declare enum Ammo300Blackout { export declare enum Ammo762x35 {
M62_TRACER = "619636be6db0f2477964e710", M62_TRACER = "619636be6db0f2477964e710",
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82", BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
AP = "5fd20ff893a8961fc660a954", AP = "5fd20ff893a8961fc660a954",

View File

@ -25,6 +25,7 @@ export declare enum BaseClasses {
SIGHTS = "5448fe7a4bdc2d6f028b456b", SIGHTS = "5448fe7a4bdc2d6f028b456b",
MEDS = "543be5664bdc2dd4348b4569", MEDS = "543be5664bdc2dd4348b4569",
MONEY = "543be5dd4bdc2deb348b4569", MONEY = "543be5dd4bdc2deb348b4569",
NIGHTVISION = "5a2c3a9486f774688b05e574",
KEY = "543be5e94bdc2df1348b4568", KEY = "543be5e94bdc2df1348b4568",
KEY_MECHANICAL = "5c99f98d86f7745c314214b3", KEY_MECHANICAL = "5c99f98d86f7745c314214b3",
KEYCARD = "5c164d2286f774194c5e69fa", KEYCARD = "5c164d2286f774194c5e69fa",
@ -66,8 +67,8 @@ export declare enum BaseClasses {
LUBRICANT = "57864e4c24597754843f8723", LUBRICANT = "57864e4c24597754843f8723",
BATTERY = "57864ee62459775490116fc1", BATTERY = "57864ee62459775490116fc1",
ASSAULT_SCOPE = "55818add4bdc2d5b648b456f", ASSAULT_SCOPE = "55818add4bdc2d5b648b456f",
REFLEX_SIGHT = "55818ad54bdc2ddc698b4569",
TACTICAL_COMBO = "55818b164bdc2ddc698b456c", TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
FLASHLIGHT = "55818b084bdc2d5b648b4571",
MAGAZINE = "5448bc234bdc2d3c308b4569", MAGAZINE = "5448bc234bdc2d3c308b4569",
LIGHT_LASER = "55818b0e4bdc2dde698b456e", LIGHT_LASER = "55818b0e4bdc2dde698b456e",
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b", FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",

View File

@ -1,7 +1,7 @@
export declare enum BotAmount { export declare enum BotAmount {
AsOnline = "AsOnline", AS_ONLINE = "AsOnline",
Low = "Low", LOW = "Low",
Medium = "Medium", MEDIUM = "Medium",
High = "High", HIGH = "High",
Horde = "Horde" HORDE = "Horde"
} }

View File

@ -1,8 +1,8 @@
export declare enum BotDifficulty { export declare enum BotDifficulty {
AsOnline = "AsOnline", AS_ONLINE = "AsOnline",
Easy = "Easy", EASY = "Easy",
Medium = "Medium", MEDIUM = "Medium",
Hard = "Hard", HARD = "Hard",
Impossible = "Impossible", IMPOSSIBLE = "Impossible",
Random = "Random" RANDOM = "Random"
} }

View File

@ -8,6 +8,7 @@ export declare enum ConfigTypes {
IN_RAID = "aki-inraid", IN_RAID = "aki-inraid",
INSURANCE = "aki-insurance", INSURANCE = "aki-insurance",
INVENTORY = "aki-inventory", INVENTORY = "aki-inventory",
ITEM = "aki-item",
LOCALE = "aki-locale", LOCALE = "aki-locale",
LOCATION = "aki-location", LOCATION = "aki-location",
MATCH = "aki-match", MATCH = "aki-match",

View File

@ -1,5 +1,6 @@
export declare enum ELocationName { export declare enum ELocationName {
FACTORY_DAY = "factory4_day", FACTORY_DAY = "factory4_day",
FACTORY_NIGHT = "factory4_night",
BIGMAP = "bigmap", BIGMAP = "bigmap",
WOODS = "Woods", WOODS = "Woods",
SHORELINE = "Shoreline", SHORELINE = "Shoreline",

View File

@ -1,13 +1,13 @@
export declare enum MemberCategory { export declare enum MemberCategory {
Default = 0, DEFAULT = 0,
Developer = 1, DEVELOPER = 1,
UniqueId = 2, UNIQUE_ID = 2,
Trader = 4, TRADER = 4,
Group = 8, GROUP = 8,
System = 16, SYSTEM = 16,
ChatModerator = 32, CHAT_MODERATOR = 32,
ChatModeratorWithPermanentBan = 64, CHAT_MODERATOR_WITH_PERMANENT_BAN = 64,
UnitTest = 128, UNIT_TEST = 128,
Sherpa = 256, SHERPA = 256,
Emissary = 512 EMISSARY = 512
} }

View File

@ -1,8 +1,8 @@
export declare enum QuestRewardType { export declare enum QuestRewardType {
Skill = "Skill", SKILL = "Skill",
Experience = "Experience", EXPERIENCE = "Experience",
TraderStanding = "TraderStanding", TRADER_STANDING = "TraderStanding",
TraderUnlock = "TraderUnlock", TRADER_UNLOCK = "TraderUnlock",
Item = "Item", ITEM = "Item",
AssortmentUnlock = "AssortmentUnlock" ASSORTMENT_UNLOCK = "AssortmentUnlock"
} }

View File

@ -1,5 +1,5 @@
export declare enum RaidMode { export declare enum RaidMode {
Online = "Online", ONLINE = "Online",
Local = "Local", LOCAL = "Local",
Coop = "Coop" COOP = "Coop"
} }

View File

@ -0,0 +1,151 @@
export declare enum Weapons127x55 {
ASH_12 = "5cadfbf7ae92152ac412eeef"
}
export declare enum Weapons86x70 {
MK_18 = "5fc22d7c187fea44d52eda44",
AXMC = "627e14b21713922ded6f2c15"
}
export declare enum Weapons9x39 {
AS_VAL = "57c44b372459772d2b39b8ce",
VSS_VINTOREZ = "57838ad32459774a17445cd2"
}
export declare enum Weapons762x54R {
SVDS = "5c46fbd72e2216398b5a8c9c",
MP_18 = "61f7c9e189e6fb1a5e3ea78d",
MOSIN_INFANTRY = "5bfd297f0db834001a669119",
MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1",
SV_98 = "55801eed4bdc2d89578b4588"
}
export declare enum Weapons762x51 {
VPO_101 = "5c501a4d2e221602b412b540",
DT_MDR_762 = "5dcbd56fdbd3d91b3e5468d5",
SA_58 = "5b0bbe4e5acfc40dc528a72d",
SCARH_BLACK = "6183afd850224f204c1da514",
SCARH_FDE = "6165ac306ef05c2ce828ef74",
HK_G28 = "6176aca650224f204c1da3fb",
M1A = "5aafa857e5b5b00018480968",
RFB = "5f2a9575926fd9352339381f",
RSASS = "5a367e5dc4a282000e49738f",
SR_25 = "5df8ce05b11454561e39243b",
DVL_10 = "588892092459774ac91d4b11",
M700 = "5bfea6e90db834001b7347f3",
T5000M = "5df24cf80dee1b22f862e9bc"
}
export declare enum Weapons366TKM {
VPO_209 = "59e6687d86f77411d949b251",
VPO_215 = "5de652c31b7e3716273428be"
}
export declare enum Weapons762x39 {
OP_SKS = "587e02ff24597743df3deaeb",
SKS = "574d967124597745970e7c94",
AK_103 = "5ac66d2e5acfc43b321d4b53",
AK_104 = "5ac66d725acfc43b321d4b60",
AKM = "59d6088586f774275f37482f",
AKMN = "5a0ec13bfcdbcb00165aa685",
AKMS = "59ff346386f77477562ff5e2",
AKMSN = "5abcbc27d8ce8700182eceeb",
MK47_MUTANT = "606587252535c57a13424cfd",
RD_704 = "628a60ae6b1d481ff772e9c8",
VPO_136 = "59e6152586f77473dc057aa1"
}
export declare enum Weapons762x35 {
MCX = "5fbcc1d9016cce60e8341ab3"
}
export declare enum Weapons556x45 {
ADAR_2_15 = "5c07c60e0db834002330051f",
AK_101 = "5ac66cb05acfc40198510a10",
AK_102 = "5ac66d015acfc400180ae6e4",
DT_MDR_556 = "5c488a752e221602b412af63",
HK_416A5 = "5bb2475ed4351e00853264e3",
HK_G36 = "623063e994fc3f7b302a9696",
M4A1 = "5447a9cd4bdc2dbd208b4567",
SCARL_BLACK = "6184055050224f204c1da540",
SCARL_FDE = "618428466ef05c2ce828f218",
TX15_DML = "5d43021ca4b9362eab4b5e25"
}
export declare enum Weapons545x39 {
AK_105 = "5ac66d9b5acfc4001633997a",
AK_74 = "5bf3e03b0db834001d2c4a9c",
AK_74M = "5ac4cd105acfc40016339859",
AK_74N = "5644bd2b4bdc2d3b4c8b4572",
AKS_74 = "5bf3e0490db83400196199af",
AKS_74N = "5ab8e9fcd8ce870019439434",
AKS_74U = "57dc2fa62459775949412633",
AKS_74UB = "5839a40f24597726f856b511",
AKS_74UN = "583990e32459771419544dd2",
SAG_AK = "628b5638ad252a16da6dd245",
SAG_AK_SHORT = "628b9c37a733087d0d7fe84b",
RPK_16 = "5beed0f50db834001c062b12"
}
export declare enum Weapons57x28FN {
FN_57_BLACK = "5d3eb3b0a4b93615055e84d2",
FN_57_FDE = "5d67abc1a4b93614ec50137f",
FN_P90 = "5cc82d76e24e8d00134b4b83"
}
export declare enum Weapons46x30HK {
MP7A1 = "5ba26383d4351e00334c93d9",
MP7A2 = "5bd70322209c4d00d7167b8f"
}
export declare enum Weapons1143x23 {
M1911A1 = "5e81c3cbac2bb513793cdc75",
M45A1 = "5f36a0e5fbf956000b716b65",
USP45 = "6193a720f8ee7e52e42109ed",
UMP45 = "5fc3e272f8b6a877a729eac5",
VECTOR45 = "5fb64bc92b1b027b1f50bcf2"
}
export declare enum Weapons9x33R {
CR_50DS = "61a4c8884f95bc3b2c5dc96f"
}
export declare enum Weapons9x21 {
SR_1MP = "59f98b4986f7746f546d2cef"
}
export declare enum Weapons9x19 {
GLOCK_17 = "5a7ae0c351dfba0017554310",
GLOCK_18C = "5b1fa9b25acfc40018633c01",
M9A3 = "5cadc190ae921500103bb3b6",
MP_443 = "576a581d2459771e7b1bc4f1",
P226R = "56d59856d2720bd8418b456a",
PL_15 = "602a9740da11d6478d5a06dc",
CR_200DS = "624c2e8614da335f1e034d8c",
MP5 = "5926bb2186f7744b1c6c6e60",
MP5K = "5d2f0d8048f0356c925bc3b0",
MP9 = "5e00903ae9dc277128008b87",
MP9_N = "5de7bd7bfd6b4e6e2276dc25",
MPX = "58948c8e86f77409493f7266",
PP_19_01 = "59984ab886f7743e98271174",
SAIGA_9 = "59f9cabd86f7743a10721f46",
STM_9 = "60339954d62c9b14ed777c06",
VECTOR_9MM = "5fc3f2d5900b1d5091531e57"
}
export declare enum Weapons9x18 {
APB = "5abccb7dd8ce87001773e277",
APS = "5a17f98cfcdbcb0980087290",
PB_SILENCED = "56e0598dd2720bb5668b45a6",
PM = "5448bd6b4bdc2dfc2f8b4569",
PM_T = "579204f224597773d619e051",
PP9_KLIN = "57f4c844245977379d5c14d1",
PP91_KEDR = "57d14d2524597714373db789",
PP91_KEDRB = "57f3c6bd24597738e730fa2f"
}
export declare enum Weapons762x25 {
TT = "571a12c42459771f627b58a0",
TT_GOLD = "5b3b713c5acfc4330140bd8d",
PPSH_41 = "5ea03f7400685063ec28bfa8"
}
export declare enum Weapons12Gauge {
M3_SUPER90 = "6259b864ebedf17603599e88",
M590A1 = "5e870397991fd70db46995c8",
M870 = "5a7828548dc32e5a9c28b516",
MP_133 = "54491c4f4bdc2db1078b4568",
MP_153 = "56dee2bdd2720bc8328b4567",
MP_155 = "606dae0ab0e443224b421bb7",
MP_43_1C = "5580223e4bdc2d1c128b457f",
MTS_255_12 = "60db29ce99594040e04c4a27",
SAIGA_12GA = "576165642459773c7a400233"
}
export declare enum Weapons20Gauge {
TOZ_106 = "5a38e6bac4a2826c6e06d79b"
}
export declare enum Weapons23x75 {
KS_23M = "5e848cc2988a8701445df1e8"
}

View File

@ -11,13 +11,13 @@ export declare class BotLootCache {
grenadeItems: ITemplateItem[]; grenadeItems: ITemplateItem[];
} }
export declare enum LootCacheType { export declare enum LootCacheType {
Special = "Special", SPECIAL = "Special",
Backpack = "Backpack", BACKPACK = "Backpack",
Pocket = "Pocket", POCKET = "Pocket",
Vest = "Vest", VEST = "Vest",
Combined = "Combined", COMBINED = "Combined",
HealingItems = "HealingItems", HEALING_ITEMS = "HealingItems",
DrugItems = "DrugItems", DRUG_ITEMS = "DrugItems",
StimItems = "StimItems", STIM_ITEMS = "StimItems",
GrenadeItems = "GrenadeItems" GRENADE_ITEMS = "GrenadeItems"
} }

View File

@ -1,14 +1,14 @@
import { MinMax } from "../../common/MinMax";
import { IBaseConfig } from "./IBaseConfig"; import { IBaseConfig } from "./IBaseConfig";
export interface IAirdropConfig extends IBaseConfig { export interface IAirdropConfig extends IBaseConfig {
kind: "aki-airdrop"; kind: "aki-airdrop";
airdropChancePercent: AirdropChancePercent; airdropChancePercent: AirdropChancePercent;
airdropMinOpenHeight: number;
airdropMaxOpenHeight: number;
planeMinFlyHeight: number; planeMinFlyHeight: number;
planeMaxFlyHeight: number; planeMaxFlyHeight: number;
planeVolume: number; planeVolume: number;
airdropMinStartTimeSeconds: number; airdropMinStartTimeSeconds: number;
airdropMaxStartTimeSeconds: number; airdropMaxStartTimeSeconds: number;
loot: AirdropLoot;
} }
export interface AirdropChancePercent { export interface AirdropChancePercent {
bigmap: number; bigmap: number;
@ -18,3 +18,13 @@ export interface AirdropChancePercent {
interchange: number; interchange: number;
reserve: number; reserve: number;
} }
export interface AirdropLoot {
presetCount: MinMax;
itemCount: MinMax;
itemBlacklist: string[];
itemTypeWhitelist: string[];
/** key: item base type: value: max count */
itemLimits: Record<string, number>;
armorLevelWhitelist: number[];
moneyStackLimits: Record<string, MinMax>;
}

View File

@ -1,17 +1,31 @@
import { MinMax } from "../../common/MinMax"; import { MinMax } from "../../common/MinMax";
import { IBaseConfig } from "./IBaseConfig"; import { IBaseConfig } from "./IBaseConfig";
import { IBotDurability } from "./IBotDurability";
import { IPmcConfig } from "./IPmcConfig";
export interface IBotConfig extends IBaseConfig { export interface IBotConfig extends IBaseConfig {
kind: "aki-bot"; kind: "aki-bot";
/** How many variants of each bot should be generated on raid start */
presetBatch: PresetBatch; presetBatch: PresetBatch;
/** What bot types should be classified as bosses */
bosses: string[]; bosses: string[];
durability: Durability; /** Control weapon/armor durability min/max values for each bot type */
durability: IBotDurability;
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
lootNValue: LootNvalue; lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
revenge: Record<string, string[]>; revenge: Record<string, string[]>;
pmc: PmcConfig; /** PMC bot specific config settings */
pmc: IPmcConfig;
/** Control how many items are allowed to spawn on a bot
* key: bottype, value: <key: itemTpl: value: max item count> */
itemSpawnLimits: Record<string, Record<string, number>>; itemSpawnLimits: Record<string, Record<string, number>>;
equipment: Record<string, Equipment>; /** Blacklist/whitelist items on a bot */
equipment: Record<string, EquipmentFilters>;
/** Show a bots botType value after their name */
showTypeInNickname: boolean; showTypeInNickname: boolean;
maxBotCap: number; /** Max number of bots that can be spawned in a raid at any one time */
maxBotCap: Record<string, number>;
/** How many stacks of secret ammo should a bot have in its bot secure container */
secureContainerAmmoStackCount: number; secureContainerAmmoStackCount: number;
} }
export interface PresetBatch { export interface PresetBatch {
@ -44,79 +58,23 @@ export interface PresetBatch {
test: number; test: number;
exUsec: number; exUsec: number;
} }
export interface Durability {
default: DefaultDurability;
pmc: PmcDurability;
boss: BotDurability;
follower: BotDurability;
assault: BotDurability;
cursedassault: BotDurability;
marksman: BotDurability;
pmcbot: BotDurability;
exusec: BotDurability;
sectantpriest: BotDurability;
sectantwarrior: BotDurability;
}
export interface DefaultDurability {
armor: DefaultArmor;
weapon: WeaponDurability;
}
export interface DefaultArmor {
maxDelta: number;
minDelta: number;
}
export interface WeaponDurability {
lowestMax: number;
highestMax: number;
maxDelta: number;
minDelta: number;
}
export interface PmcDurability {
armor: PmcDurabilityArmor;
weapon: WeaponDurability;
}
export interface PmcDurabilityArmor {
lowestMaxPercent: number;
highestMaxPercent: number;
maxDelta: number;
minDelta: number;
}
export interface BotDurability {
armor: ArmorDurability;
weapon: WeaponDurability;
}
export interface ArmorDurability {
maxDelta: number;
minDelta: number;
}
export interface LootNvalue { export interface LootNvalue {
scav: number; scav: number;
pmc: number; pmc: number;
} }
export interface PmcConfig { export interface EquipmentFilters {
dynamicLoot: PmcDynamicLoot; weaponModLimits: ModLimits;
difficulty: string; randomisedWeaponModSlots?: string[];
looseWeaponInBackpackChancePercent: number; randomisedArmorSlots?: string[];
looseWeaponInBackpackLootMinMax: MinMax;
isUsec: number;
chanceSameSideIsHostilePercent: number;
usecType: string;
bearType: string;
maxBackpackLootTotalRub: number;
maxPocketLootTotalRub: number;
maxVestLootTotalRub: number;
convertIntoPmcChance: Record<string, MinMax>;
enemyTypes: string[];
}
export interface PmcDynamicLoot {
whitelist: string[];
blacklist: string[];
moneyStackLimits: Record<string, number>;
}
export interface Equipment {
blacklist: EquipmentFilterDetails[]; blacklist: EquipmentFilterDetails[];
whitelist: EquipmentFilterDetails[]; whitelist: EquipmentFilterDetails[];
} }
export interface ModLimits {
/** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */
scopeLimit?: number;
/** How many lasers or lights are allowed on a weapon - hard coded to work with TACTICAL_COMBO, and FLASHLIGHT */
lightLaserLimit?: number;
}
export interface EquipmentFilterDetails { export interface EquipmentFilterDetails {
levelRange: MinMax; levelRange: MinMax;
equipment: Record<string, string[]>; equipment: Record<string, string[]>;

View File

@ -0,0 +1,47 @@
export interface IBotDurability {
default: DefaultDurability;
pmc: PmcDurability;
boss: BotDurability;
follower: BotDurability;
assault: BotDurability;
cursedassault: BotDurability;
marksman: BotDurability;
pmcbot: BotDurability;
exusec: BotDurability;
gifter: BotDurability;
sectantpriest: BotDurability;
sectantwarrior: BotDurability;
}
/** Durability values to be used when a more specific bot type cant be found */
export interface DefaultDurability {
armor: DefaultArmor;
weapon: WeaponDurability;
}
export interface DefaultArmor {
maxDelta: number;
minDelta: number;
}
export interface WeaponDurability {
lowestMax: number;
highestMax: number;
maxDelta: number;
minDelta: number;
}
export interface PmcDurability {
armor: PmcDurabilityArmor;
weapon: WeaponDurability;
}
export interface PmcDurabilityArmor {
lowestMaxPercent: number;
highestMaxPercent: number;
maxDelta: number;
minDelta: number;
}
export interface BotDurability {
armor: ArmorDurability;
weapon: WeaponDurability;
}
export interface ArmorDurability {
maxDelta: number;
minDelta: number;
}

View File

@ -2,6 +2,10 @@ import { IBaseConfig } from "./IBaseConfig";
export interface IHideoutConfig extends IBaseConfig { export interface IHideoutConfig extends IBaseConfig {
kind: "aki-hideout"; kind: "aki-hideout";
runIntervalSeconds: number; runIntervalSeconds: number;
fuelDrainRateMultipler: number;
hoursForSkillCrafting: number; hoursForSkillCrafting: number;
generatorSpeedWithoutFuel: number;
generatorFuelFlowRate: number;
airFilterUnitFlowRate: number;
/** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */
gpuBoostRate: number;
} }

View File

@ -0,0 +1,5 @@
import { IBaseConfig } from "./IBaseConfig";
export interface IItemConfig extends IBaseConfig {
kind: "aki-item";
blacklist: string[];
}

View File

@ -0,0 +1,26 @@
import { MinMax } from "../../common/MinMax";
export interface IPmcConfig {
dynamicLoot: DynamicLoot;
useDifficultyOverride: boolean;
difficulty: string;
looseWeaponInBackpackChancePercent: number;
looseWeaponInBackpackLootMinMax: MinMax;
isUsec: number;
chanceSameSideIsHostilePercent: number;
/** key: location, value: type for usec/bear */
pmcType: Record<string, PmcTypes>;
maxBackpackLootTotalRub: number;
maxPocketLootTotalRub: number;
maxVestLootTotalRub: number;
convertIntoPmcChance: Record<string, MinMax>;
enemyTypes: string[];
}
export interface PmcTypes {
usec: string;
bear: string;
}
export interface DynamicLoot {
whitelist: string[];
blacklist: string[];
moneyStackLimits: Record<string, number>;
}

View File

@ -4,6 +4,8 @@ export interface IQuestConfig extends IBaseConfig {
kind: "aki-quest"; kind: "aki-quest";
redeemTime: number; redeemTime: number;
repeatableQuests: IRepeatableQuestConfig[]; repeatableQuests: IRepeatableQuestConfig[];
bearOnlyQuests: string[];
usecOnlyQuests: string[];
} }
export interface IRepeatableQuestConfig { export interface IRepeatableQuestConfig {
name: string; name: string;
@ -15,6 +17,10 @@ export interface IRepeatableQuestConfig {
locations: Record<ELocationName, string[]>; locations: Record<ELocationName, string[]>;
traderWhitelist: ITraderWhitelist[]; traderWhitelist: ITraderWhitelist[];
questConfig: IQuestConfig; questConfig: IQuestConfig;
/** Item base types to block when generating rewards */
rewardBaseTypeBlacklist: string[];
/** Item tplIds to ignore when generating rewards */
rewardBlacklist: string[];
} }
export interface IRewardScaling { export interface IRewardScaling {
levels: number[]; levels: number[];

View File

@ -12,6 +12,7 @@ export interface Sell {
chance: Chance; chance: Chance;
time: Time; time: Time;
reputation: Reputation; reputation: Reputation;
simulatedSellHours: number;
} }
export interface Chance { export interface Chance {
base: number; base: number;
@ -27,11 +28,18 @@ export interface Reputation {
gain: number; gain: number;
loss: number; loss: number;
} }
export declare class OfferAdjustment {
maxPriceDifferenceBelowHandbookPercent: number;
handbookPriceMultipier: number;
priceThreshholdRub: number;
}
export interface Dynamic { export interface Dynamic {
offerAdjustment: OfferAdjustment;
expiredOfferThreshold: number; expiredOfferThreshold: number;
offerItemCount: MinMax; offerItemCount: MinMax;
price: MinMax; price: MinMax;
presetPrice: MinMax; presetPrice: MinMax;
showDefaultPresetsOnly: boolean;
endTimeSeconds: MinMax; endTimeSeconds: MinMax;
condition: Condition; condition: Condition;
stackablePercent: MinMax; stackablePercent: MinMax;

View File

@ -12,8 +12,10 @@ export interface UpdateTime {
seconds: number; seconds: number;
} }
export interface FenceConfig { export interface FenceConfig {
partialRefreshTimeSeconds: number;
partialRefreshChangePercent: number;
assortSize: number; assortSize: number;
maxPresetsCount: number; maxPresetsPercent: number;
presetPriceMult: number; presetPriceMult: number;
blacklist: string[]; blacklist: string[];
} }

View File

@ -0,0 +1,6 @@
export declare class AirDropLootItem {
id: string;
tpl: string;
isPreset: boolean;
stackCount: number;
}

View File

@ -1,11 +1,11 @@
export declare enum LogBackgroundColor { export declare enum LogBackgroundColor {
default = "", DEFAULT = "",
black = "blackBG", BLACK = "blackBG",
red = "redBG", RED = "redBG",
green = "greenBG", GREEN = "greenBG",
yellow = "yellowBG", YELLOW = "yellowBG",
blue = "blueBG", BLUE = "blueBG",
magenta = "magentaBG", MAGENTA = "magentaBG",
cyan = "cyanBG", CYAN = "cyanBG",
white = "whiteBG" WHITE = "whiteBG"
} }

View File

@ -1,11 +1,11 @@
export declare enum LogTextColor { export declare enum LogTextColor {
black = "black", BLACK = "black",
red = "red", RED = "red",
green = "green", GREEN = "green",
yellow = "yellow", YELLOW = "yellow",
blue = "blue", BLUE = "blue",
magenta = "magenta", MAGENTA = "magenta",
cyan = "cyan", CYAN = "cyan",
white = "white", WHITE = "white",
gray = "" GRAY = ""
} }

View File

@ -13,10 +13,10 @@ export interface ILocaleGlobalBase {
season: Record<string, string>; season: Record<string, string>;
customization: Record<string, ILocaleProps>; customization: Record<string, ILocaleProps>;
repeatableQuest: Record<string, string>; repeatableQuest: Record<string, string>;
templates: ILocaleTemplateBase; templates: Record<string, ILocaleProps>;
locations: ILocaleLocationsBase; locations: Record<string, ILocaleProps>;
banners: ILocaleBannersBase; banners: Record<string, ILocaleProps>;
trading: ILocaleTradingBase; trading: Record<string, ILocaleTradingProps>;
} }
export interface ILocaleQuest { export interface ILocaleQuest {
name: string; name: string;
@ -31,23 +31,11 @@ export interface ILocaleQuest {
export interface ILocalePreset { export interface ILocalePreset {
Name: string; Name: string;
} }
export interface ILocaleTemplateBase {
templates: Record<string, ILocaleProps>;
}
export interface ILocaleLocationsBase {
locations: Record<string, ILocaleProps>;
}
export interface ILocaleBannersBase {
locations: Record<string, ILocaleProps>;
}
export interface ILocaleProps { export interface ILocaleProps {
Name: string; Name: string;
ShortName: string; ShortName: string;
Description: string; Description: string;
} }
export interface ILocaleTradingBase {
locations: Record<string, ILocaleTradingProps>;
}
export interface ILocaleTradingProps { export interface ILocaleTradingProps {
FullName: string; FullName: string;
FirstName: string; FirstName: string;

View File

@ -0,0 +1,6 @@
export declare class LootItem {
id?: string;
tpl: string;
isPreset: boolean;
stackCount: number;
}

View File

@ -0,0 +1,11 @@
import { MinMax } from "../../common/MinMax";
export declare class LootRequest {
presetCount: MinMax;
itemCount: MinMax;
itemBlacklist: string[];
itemTypeWhitelist: string[];
/** key: item base type: value: max count */
itemLimits: Record<string, number>;
armorLevelWhitelist: number[];
moneyStackLimits: Record<string, MinMax>;
}

View File

@ -2,5 +2,5 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
export declare class DatabaseServer { export declare class DatabaseServer {
protected tableData: IDatabaseTables; protected tableData: IDatabaseTables;
getTables(): IDatabaseTables; getTables(): IDatabaseTables;
setTables(any: any): void; setTables(tableData: IDatabaseTables): void;
} }

View File

@ -1,4 +1,6 @@
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator"; import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
@ -12,11 +14,18 @@ export declare class RagfairServer {
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected ragfairCategoriesService: RagfairCategoriesService; protected ragfairCategoriesService: RagfairCategoriesService;
protected ragfairRequiredItemsService: RagfairRequiredItemsService; protected ragfairRequiredItemsService: RagfairRequiredItemsService;
protected traderHelper: TraderHelper;
protected traderAssortHelper: TraderAssortHelper;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, configServer: ConfigServer); constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer);
load(): void; load(): void;
update(): void; update(): void;
/**
* Get traders who need to be periodically refreshed
* @returns string array of traders
*/
protected getUpdateableTraders(): string[];
getAllCategories(): Record<string, number>; getAllCategories(): Record<string, number>;
getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>; getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>;
/** /**

View File

@ -1,12 +1,12 @@
import { IBotType } from "../models/eft/common/tables/IBotType"; import { IBotType } from "../models/eft/common/tables/IBotType";
import { Equipment, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig"; import { EquipmentFilters, EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
export declare class BotEquipmentFilterService { export declare class BotEquipmentFilterService {
protected logger: ILogger; protected logger: ILogger;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected botEquipmentFilterlists: Record<string, Equipment>; protected botEquipmentFilterlists: Record<string, EquipmentFilters>;
constructor(logger: ILogger, configServer: ConfigServer); constructor(logger: ILogger, configServer: ConfigServer);
/** /**
* Filter a bots data to exclude equipment and cartridges defines in the botConfig * Filter a bots data to exclude equipment and cartridges defines in the botConfig
@ -22,7 +22,7 @@ export declare class BotEquipmentFilterService {
* @param playerLevel Level of the player * @param playerLevel Level of the player
* @returns EquipmentBlacklistDetails object * @returns EquipmentBlacklistDetails object
*/ */
protected getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails; getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails;
/** /**
* Get the whitelist for a specific bot type that's within the players level * Get the whitelist for a specific bot type that's within the players level
* @param botRole Bot type * @param botRole Bot type

Some files were not shown because too many files have changed in this diff Show More