This commit is contained in:
Chomp 2022-08-23 21:56:08 +01:00
parent 8c9fad5dc0
commit 129b6eb52a
66 changed files with 374 additions and 133 deletions

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"author": "Chomp",
"license": "MIT",
"main": "src/mod.js",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"isBundleMod": true,
"scripts": {
"setup:environment": "npm i",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Shirito",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -20,7 +20,22 @@ export declare class ProfileCallbacks {
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>;
/**
* 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;
/**
* 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>;
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;

View File

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

View File

@ -92,7 +92,11 @@ export declare class InventoryController {
*/
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;
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -9,6 +9,7 @@ import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -33,6 +34,9 @@ import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
* Handle RagfairCallback events
*/
export declare class RagfairController {
protected logger: ILogger;
protected timeUtil: TimeUtil;
@ -52,14 +56,20 @@ export declare class RagfairController {
protected handbookHelper: HandbookHelper;
protected paymentHelper: PaymentHelper;
protected inventoryHelper: InventoryHelper;
protected traderHelper: TraderHelper;
protected ragfairHelper: RagfairHelper;
protected ragfairOfferService: RagfairOfferService;
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
protected ragfairOfferGenerator: RagfairOfferGenerator;
protected configServer: ConfigServer;
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;
/**
* 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 isRequiredSearch(info: ISearchRequestData): boolean;
update(): void;

View File

@ -7,6 +7,7 @@ import { Exit } from "../models/eft/common/ILocationBase";
import { IPmcData } from "../models/eft/common/IPmcData";
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 { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
import { ELocationName } from "../models/enums/ELocationName";
@ -15,6 +16,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { PaymentService } from "../services/PaymentService";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { JsonUtil } from "../utils/JsonUtil";
@ -64,9 +66,10 @@ export declare class RepeatableQuestController {
protected itemEventRouter: ItemEventRouter;
protected paymentService: PaymentService;
protected objectId: ObjectId;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
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
* 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;
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
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

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

View File

@ -40,7 +40,7 @@ export declare class BotGenerator {
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
* @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
@ -58,7 +58,7 @@ export declare class BotGenerator {
* @returns IBotBase object
*/
protected getCloneOfBotBase(): IBotBase;
protected generateBot(bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase;
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
*/

View File

@ -18,7 +18,7 @@ export declare class BotInventoryGenerator {
protected botGeneratorHelper: BotGeneratorHelper;
protected weightedRandomHelper: WeightedRandomHelper;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper);
generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
generateInventory(sessionId: string, templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void;
protected generateInventoryBase(): PmcInventory;
}

View File

@ -24,7 +24,7 @@ export declare class BotLootGenerator {
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, 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;
/**
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
@ -47,7 +47,7 @@ export declare class BotLootGenerator {
* @param botRole bots role, .e.g. pmcBot
* @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
* @param pool pool of items to pick an item from

View File

@ -28,7 +28,18 @@ export declare class BotWeaponGenerator {
protected botConfig: IBotConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer);
/**
* 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 botTemplateInventory e.g. assault.json
* @returns weapon tpl
@ -39,43 +50,24 @@ export declare class BotWeaponGenerator {
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
* @param equipmentSlot slot to fit into, primary/secondary/holster
* @param botTemplateInventory e.g. assault.json
* @param weaponParentId
* @param modChances
* @param botRole
* @param weaponParentId ParentId of the weapon being generated
* @param modChances Dictionary of item types and % chance weapon will have that mod
* @param botRole e.g. assault/exusec
* @param isPmc
* @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
* @param equipmentSlot Primary/secondary/holster
* @param botTemplateInventory e.g. assault.json
* @param weaponParentId
* @param modChances
* @param botRole
* @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
* Create array with weapon base as only element and
* add additional properties based on weapon type
* @param weaponTpl Weapon tpl to create item with
* @param weaponParentId Weapons parent id
* @param equipmentSlot e.g. primary/secondary/holster
* @param weaponItemTemplate db template for weapon
* @param botRole for durability values
* @returns
* @returns Base weapon item in array
*/
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
* @param weaponTpl weapon to find preset for
@ -84,20 +76,32 @@ export declare class BotWeaponGenerator {
* @returns array of weapon mods
*/
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;
/**
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
* Additionally, adds extra bullets to SecuredContainer
* @param weaponMods
* @param weaponTemplate
* @param magCounts
* @param ammoTpl
* @param inventory
* @param weaponMods mods to attach to weapon
* @param weaponTemplate db template for weapon
* @param magCounts magazine count to add to inventory
* @param ammoTpl ammo templateId to add to magazines
* @param inventory inventory to add magazines to
* @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(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void;
/**
* 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
*/
protected createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
/**
* Get a randomised number of bullets for a specific magazine
* @param magCounts min and max count of magazines
@ -138,10 +142,9 @@ export declare class BotWeaponGenerator {
* 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 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
*/
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
* @param weaponTemplate Weapon to look up caliber of

View File

@ -1,15 +1,21 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ConfigServer } from "../servers/ConfigServer";
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 {
protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer;
protected configServer: ConfigServer;
protected itemFilterService: ItemFilterService;
protected pocketLootPool: string[];
protected backpackLootPool: string[];
protected botConfig: IBotConfig;
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService);
generatePMCPocketLootPool(): string[];
generatePMCBackpackLootPool(): string[];
}

View File

@ -8,9 +8,13 @@ import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../mo
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
/**
* Handle the creation of randomised scav case rewards
*/
export declare class ScavCaseRewardGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
@ -18,9 +22,10 @@ export declare class ScavCaseRewardGenerator {
protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
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
* @param body client request

View File

@ -17,7 +17,7 @@ export declare class AssortHelper {
* @param assort assort items from a trader
* @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
* @param pmcProfile player profile
@ -32,5 +32,5 @@ export declare class AssortHelper {
* @param itemID item id to remove from asort
* @returns Modified assort
*/
removeItemFromAssort(assort: ITraderAssort, itemID: string): ITraderAssort;
removeItemFromAssort(assort: ITraderAssort, itemID: string, flea?: boolean): ITraderAssort;
}

View File

@ -3,10 +3,12 @@ import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { Grid, 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 { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { ItemFilterService } from "../services/ItemFilterService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
@ -14,6 +16,7 @@ import { ContainerHelper } from "./ContainerHelper";
import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper";
import { ProbabilityHelper } from "./ProbabilityHelper";
import { ProfileHelper } from "./ProfileHelper";
export declare class BotGeneratorHelper {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
@ -25,10 +28,75 @@ export declare class BotGeneratorHelper {
protected itemHelper: ItemHelper;
protected inventoryHelper: InventoryHelper;
protected containerHelper: ContainerHelper;
protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper;
protected configServer: ConfigServer;
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);
generateModsForItem(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
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, configServer: ConfigServer);
/**
* TODO - very similar to generateModsForWeapon
* Check mods are compatible and add to array
* @param equipment Equipment item to add mods to
* @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
*/
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances): Item[];
/**
* TODO - very similar to generateModsForEquipment
* @param sessionId session id
* @param weapon Weapon to add mods to
* @param modPool pool of compatible mods to attach to gun
* @param weaponParentId parentId of weapon
* @param parentTemplate
* @param modSpawnChances
* @param ammoTpl ammo tpl to use when generating magazines/cartridges
* @param botRole role of bot weapon is generated for
* @returns Weapon with mods array
*/
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string): Item[];
/**
* 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 generateDynamicModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record<string, string[]>): void;
/**
* Check if the specific item type on the weapon has reached the set limit
* @param modTpl item to check is limited
* @param currentCount current number of this item on gun
* @param botRole role of bot we're checking weapon of
* @returns true if at limit
*/
protected weaponModLimitReached(modTpl: string, currentCount: {
count: number;
}, baseTypes: string[], maxLimit: number, botRole: string): boolean;
/**
* log errors if mod is not valid for a slot
* @param modTpl
* @param found
* @param itemSlot
* @param modTemplate
* @param modSlot
* @param parentTemplate
* @returns true if valid
*/
protected isModValidForSlot(modTpl: string, found: boolean, itemSlot: Slot, modTemplate: ITemplateItem, 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;
/**
* Is this magazine cylinder related (revolvers and grenade launchers)
* @param magazineParentName the name of the magazines parent
@ -62,11 +130,11 @@ export declare class BotGeneratorHelper {
* 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.
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
*
* @param {object} items The items where the CylinderMagazine's camora are appended to
* @param {object} modPool modPool which should include available cartrigdes
* @param {string} parentId The CylinderMagazine's UID
* @param {object} parentTemplate The CylinderMagazine's template
* @param items The items where the CylinderMagazine's camora are appended to
* @param modPool modPool which should include available cartrigdes
* @param parentId The CylinderMagazine's UID
* @param parentTemplate The CylinderMagazine's template
* @returns
*/
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
/**
@ -75,6 +143,13 @@ export declare class BotGeneratorHelper {
* @returns string array of shells fro luitple camora sources
*/
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): {
upd?: Upd;
};
@ -93,12 +168,6 @@ export declare class BotGeneratorHelper {
*/
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
* @param unsortedModArray String array to sort
* @returns Sorted string array
*/
protected sortModArray(unsortedModArray: string[]): string[];
/**
* Can an item be added to an item without issue
* @param items
@ -117,8 +186,15 @@ export declare class BotGeneratorHelper {
* @returns a `boolean` indicating item was added
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: PmcInventory): 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;
}
/** TODO - move into own class */
export declare class ExhaustableArray<T> {
private itemPool;
private randomUtil;

View File

@ -49,6 +49,15 @@ export declare class HideoutHelper {
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): HideoutArea;
/**
*
* Filters are deleted when reaching 0 resourceValue
* @param waterFilterArea
* @param pwProd
* @param isGeneratorOn
* @param pmcData
* @returns
*/
protected updateWaterFilters(waterFilterArea: HideoutArea, pwProd: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): HideoutArea;

View File

@ -18,18 +18,6 @@ declare class ItemHelper {
* @returns boolean; true for items that may be in player posession and not quest items
*/
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
*

View File

@ -24,6 +24,19 @@ export declare class ProfileHelper {
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;
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
*/
postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
/**
* Add experience to a PMC inside the players profile

View File

@ -46,7 +46,7 @@ export declare class RagfairOfferHelper {
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);
getValidOffers(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 deleteOfferByOfferId(sessionID: string, offerId: string): void;
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;

View File

@ -11,6 +11,12 @@ export declare class RagfairSellHelper {
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
calculateSellChance(baseChance: number, offerPrice: number, requirementsPriceInRub: number): number;
rollForSale(sellChance: number, count: number): SellResult[];
calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number;
/**
* 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 { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocaleService } from "../services/LocaleService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
@ -13,6 +14,9 @@ import { RandomUtil } from "../utils/RandomUtil";
import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper";
import { ProfileHelper } from "./ProfileHelper";
/**
* Helper class for common ragfair server actions
*/
export declare class RagfairServerHelper {
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
@ -23,11 +27,12 @@ export declare class RagfairServerHelper {
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected jsonUtil: JsonUtil;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig;
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
* @param itemDetails

View File

@ -39,6 +39,12 @@ export declare class TradeHelper {
* @returns
*/
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 checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
}

View File

@ -41,7 +41,7 @@ export declare class TraderAssortHelper {
* @param traderId traders id
* @returns a traders' assorts
*/
getAssort(sessionId: string, traderId: string): ITraderAssort;
getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;
/**
* if the fence assorts have expired, re-generate them
* @param pmcProfile Players profile

View File

@ -34,6 +34,7 @@ export interface Props {
LootExperience?: number;
ExamineExperience?: number;
HideEntrails?: boolean;
InsuranceDisabled?: boolean;
RepairCost?: number;
RepairSpeed?: number;
ExtraSizeLeft?: number;
@ -206,6 +207,7 @@ export interface Props {
IsOneoff?: boolean;
MustBoltBeOpennedForExternalReload?: boolean;
MustBoltBeOpennedForInternalReload?: boolean;
NoFiremodeOnBoltcatch?: boolean;
BoltAction?: boolean;
HipAccuracyRestorationDelay?: number;
HipAccuracyRestorationSpeed?: number;

View File

@ -67,6 +67,7 @@ export interface IBarterScheme {
count: number;
_tpl: string;
onlyFunctional?: boolean;
sptQuestLocked?: boolean;
}
export interface ISuit {
_id: string;

View File

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

View File

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

View File

@ -68,6 +68,7 @@ export declare enum BaseClasses {
ASSAULT_SCOPE = "55818add4bdc2d5b648b456f",
REFLEX_SIGHT = "55818ad54bdc2ddc698b4569",
TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
FLASHLIGHT = "55818b084bdc2d5b648b4571",
MAGAZINE = "5448bc234bdc2d3c308b4569",
LIGHT_LASER = "55818b0e4bdc2dde698b456e",
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",

View File

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

View File

@ -114,9 +114,16 @@ export interface PmcDynamicLoot {
moneyStackLimits: Record<string, number>;
}
export interface Equipment {
/** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */
weaponModLimits: ModLimits;
randomisedWeaponModSlots?: string[];
blacklist: EquipmentFilterDetails[];
whitelist: EquipmentFilterDetails[];
}
export interface ModLimits {
scopeLimit?: number;
lightLaserLimit?: number;
}
export interface EquipmentFilterDetails {
levelRange: MinMax;
equipment: Record<string, string[]>;

View File

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

View File

@ -15,6 +15,10 @@ export interface IRepeatableQuestConfig {
locations: Record<ELocationName, string[]>;
traderWhitelist: ITraderWhitelist[];
questConfig: IQuestConfig;
/** Item base types to block when generating rewards */
rewardBaseTypeBlacklist: string[];
/** Item tplIds to ignore when generating rewards */
rewardBlacklist: string[];
}
export interface IRewardScaling {
levels: number[];

View File

@ -12,6 +12,7 @@ export interface Sell {
chance: Chance;
time: Time;
reputation: Reputation;
simulatedSellHours: number;
}
export interface Chance {
base: number;

View File

@ -22,7 +22,7 @@ export declare class BotEquipmentFilterService {
* @param playerLevel Level of the player
* @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
* @param botRole Bot type

View File

@ -12,6 +12,11 @@ import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { ItemFilterService } from "./ItemFilterService";
/**
* Handle actions surrounding Fence
* e.g. generating or refreshing assorts / get next refresh time
*/
export declare class FenceService {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -22,10 +27,11 @@ export declare class FenceService {
protected handbookHelper: HandbookHelper;
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
protected fenceAssort: ITraderAssort;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, configServer: ConfigServer);
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
protected setFenceAssort(fenceAssort: ITraderAssort): void;
getFenceAssorts(): ITraderAssort;
/**

View File

@ -0,0 +1,24 @@
import { IItemConfig } from "../models/spt/config/IItemConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
/** Centralise the handling of blacklisting items, uses blacklist found in config/item.json */
export declare class ItemFilterService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected configServer: ConfigServer;
protected blacklist: string[];
protected itemConfig: IItemConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer);
/**
* Check if the provided template id is blacklisted in config/item.json
* @param tpl template id
* @returns true if blacklisted
*/
isItemBlacklisted(tpl: string): boolean;
/**
* Return every template id blacklisted in config/item.json
* @returns string array of blacklisted tempalte ids
*/
getBlacklistedItems(): string[];
}

View File

@ -45,6 +45,11 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to find and remove slots from
*/
protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void;
/**
* Hideout slots need to be in a specific order, locationIndex in ascending order
* @param pmcProfile profile to edit
*/
protected reorderHideoutAreasWithResouceInputs(pmcProfile: IPmcData): void;
/**
* add in objects equal to the number of slots
* @param areaType area to check

View File

@ -150,4 +150,10 @@ export declare class RandomUtil {
*/
drawRandomFromDict(dict: any, count?: number, replacement?: boolean): any[];
getBiasedRandomNumber(min: number, max: number, shift: number, n: number): number;
/**
* Fisher-Yates shuffle an array
* @param array Array to shuffle
* @returns Shuffled array
*/
shuffle<T>(array: Array<T>): Array<T>;
}

View File

@ -1,3 +1,6 @@
/**
* Utility class to handle time related problems
*/
export declare class TimeUtil {
static readonly oneHourAsSeconds = 3600;
formatTime(date: Date): string;
@ -19,4 +22,10 @@ export declare class TimeUtil {
* @returns current date in format: 00.00.0000 (dd.mm.yyyy)
*/
getDateMailFormat(): string;
/**
* Convert hours into seconds
* @param hours hours to convert to seconds
* @returns number
*/
getHoursAsSeconds(hours: number): number;
}

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",

View File

@ -13,7 +13,7 @@ A system reboot may be needed after install.
## **IDE:**
The second step is having an IDE ready. For the currect purpose we've setup a VSCodium workspace file.
The second step is having an IDE ready. We've setup a VSCodium workspace file to help with this.
You CAN use Visual Studio Code if you so desire, just keep in mind that our dev tests on the mod files was done using VSCodium.
@ -21,7 +21,7 @@ You can get VSCodium here: https://vscodium.com/#install
## **Workspace:**
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Worspace from File...).
Once you have NodeJS and VSCodium ready, open the mod.code-workspace file with VSCodium (File->Open Workspace from File...).
Once the project loads into VSCodium you will be recommended to install the ESLint plugin. This is HIGHLY recommended.

View File

@ -4,7 +4,7 @@
"main": "src/mod.js",
"license": "MIT",
"author": "Chomp",
"akiVersion": "3.2.1",
"akiVersion": "3.2.2",
"scripts": {
"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",