Update types

This commit is contained in:
Dev 2024-05-24 15:33:36 +01:00
parent 4f0739b138
commit 0c3131a43d
987 changed files with 26876 additions and 1311 deletions

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

View File

@ -0,0 +1,27 @@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
export interface IModToSpawnRequest {
/** Slot mod will fit into */
modSlot: string;
/** Will generate a randomised mod pool if true */
isRandomisableSlot: boolean;
/** Parent slot the item will be a part of */
botWeaponSightWhitelist: Record<string, string[]>;
/** Blacklist to prevent mods from being picked */
botEquipBlacklist: EquipmentFilterDetails;
/** Pool of items to pick from */
itemModPool: Record<string, string[]>;
/** Array with only weapon tpl in it, ready for mods to be added */
weapon: Item[];
/** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */
ammoTpl: string;
/** Parent item the mod will go into */
parentTemplate: ITemplateItem;
/** Should mod be spawned/skipped/use default */
modSpawnResult: ModSpawn;
/** Weapon stats for weapon being generated */
weaponStats: IWeaponStats;
}

View File

@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
walletLoot: IWalletLootSettings; walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */ /** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>; currencyStackSize: Record<string, Record<string, Record<string, number>>>;
/** Tpls for low profile gas blocks */
lowProfileGasBlockTpls: string[];
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {

View File

@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
commit?: string; commit?: string;
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
/** Server locale keys that will be added to the bottom of the startup watermark */
customWatermarkLocaleKeys?: string[];
} }
export interface IBsgLogging { export interface IBsgLogging {
/** /**

View File

@ -28,6 +28,7 @@ export interface Config {
WeaponOverlapDistanceCulling: number; WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean; WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView; NetworkStateView: INetworkStateView;
WsReconnectionDelays: string[];
} }
export interface FramerateLimit { export interface FramerateLimit {
MaxFramerateGameLimit: number; MaxFramerateGameLimit: number;

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

View File

@ -0,0 +1,27 @@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
export interface IModToSpawnRequest {
/** Slot mod will fit into */
modSlot: string;
/** Will generate a randomised mod pool if true */
isRandomisableSlot: boolean;
/** Parent slot the item will be a part of */
botWeaponSightWhitelist: Record<string, string[]>;
/** Blacklist to prevent mods from being picked */
botEquipBlacklist: EquipmentFilterDetails;
/** Pool of items to pick from */
itemModPool: Record<string, string[]>;
/** Array with only weapon tpl in it, ready for mods to be added */
weapon: Item[];
/** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */
ammoTpl: string;
/** Parent item the mod will go into */
parentTemplate: ITemplateItem;
/** Should mod be spawned/skipped/use default */
modSpawnResult: ModSpawn;
/** Weapon stats for weapon being generated */
weaponStats: IWeaponStats;
}

View File

@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
walletLoot: IWalletLootSettings; walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */ /** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>; currencyStackSize: Record<string, Record<string, Record<string, number>>>;
/** Tpls for low profile gas blocks */
lowProfileGasBlockTpls: string[];
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {

View File

@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
commit?: string; commit?: string;
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
/** Server locale keys that will be added to the bottom of the startup watermark */
customWatermarkLocaleKeys?: string[];
} }
export interface IBsgLogging { export interface IBsgLogging {
/** /**

View File

@ -28,6 +28,7 @@ export interface Config {
WeaponOverlapDistanceCulling: number; WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean; WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView; NetworkStateView: INetworkStateView;
WsReconnectionDelays: string[];
} }
export interface FramerateLimit { export interface FramerateLimit {
MaxFramerateGameLimit: number; MaxFramerateGameLimit: number;

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

View File

@ -0,0 +1,27 @@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
export interface IModToSpawnRequest {
/** Slot mod will fit into */
modSlot: string;
/** Will generate a randomised mod pool if true */
isRandomisableSlot: boolean;
/** Parent slot the item will be a part of */
botWeaponSightWhitelist: Record<string, string[]>;
/** Blacklist to prevent mods from being picked */
botEquipBlacklist: EquipmentFilterDetails;
/** Pool of items to pick from */
itemModPool: Record<string, string[]>;
/** Array with only weapon tpl in it, ready for mods to be added */
weapon: Item[];
/** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */
ammoTpl: string;
/** Parent item the mod will go into */
parentTemplate: ITemplateItem;
/** Should mod be spawned/skipped/use default */
modSpawnResult: ModSpawn;
/** Weapon stats for weapon being generated */
weaponStats: IWeaponStats;
}

View File

@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
walletLoot: IWalletLootSettings; walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */ /** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>; currencyStackSize: Record<string, Record<string, Record<string, number>>>;
/** Tpls for low profile gas blocks */
lowProfileGasBlockTpls: string[];
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {

View File

@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
commit?: string; commit?: string;
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
/** Server locale keys that will be added to the bottom of the startup watermark */
customWatermarkLocaleKeys?: string[];
} }
export interface IBsgLogging { export interface IBsgLogging {
/** /**

View File

@ -28,6 +28,7 @@ export interface Config {
WeaponOverlapDistanceCulling: number; WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean; WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView; NetworkStateView: INetworkStateView;
WsReconnectionDelays: string[];
} }
export interface FramerateLimit { export interface FramerateLimit {
MaxFramerateGameLimit: number; MaxFramerateGameLimit: number;

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

View File

@ -0,0 +1,27 @@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
export interface IModToSpawnRequest {
/** Slot mod will fit into */
modSlot: string;
/** Will generate a randomised mod pool if true */
isRandomisableSlot: boolean;
/** Parent slot the item will be a part of */
botWeaponSightWhitelist: Record<string, string[]>;
/** Blacklist to prevent mods from being picked */
botEquipBlacklist: EquipmentFilterDetails;
/** Pool of items to pick from */
itemModPool: Record<string, string[]>;
/** Array with only weapon tpl in it, ready for mods to be added */
weapon: Item[];
/** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */
ammoTpl: string;
/** Parent item the mod will go into */
parentTemplate: ITemplateItem;
/** Should mod be spawned/skipped/use default */
modSpawnResult: ModSpawn;
/** Weapon stats for weapon being generated */
weaponStats: IWeaponStats;
}

View File

@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
walletLoot: IWalletLootSettings; walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */ /** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>; currencyStackSize: Record<string, Record<string, Record<string, number>>>;
/** Tpls for low profile gas blocks */
lowProfileGasBlockTpls: string[];
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {

View File

@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
commit?: string; commit?: string;
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
/** Server locale keys that will be added to the bottom of the startup watermark */
customWatermarkLocaleKeys?: string[];
} }
export interface IBsgLogging { export interface IBsgLogging {
/** /**

View File

@ -28,6 +28,7 @@ export interface Config {
WeaponOverlapDistanceCulling: number; WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean; WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView; NetworkStateView: INetworkStateView;
WsReconnectionDelays: string[];
} }
export interface FramerateLimit { export interface FramerateLimit {
MaxFramerateGameLimit: number; MaxFramerateGameLimit: number;

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

View File

@ -0,0 +1,27 @@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
export interface IModToSpawnRequest {
/** Slot mod will fit into */
modSlot: string;
/** Will generate a randomised mod pool if true */
isRandomisableSlot: boolean;
/** Parent slot the item will be a part of */
botWeaponSightWhitelist: Record<string, string[]>;
/** Blacklist to prevent mods from being picked */
botEquipBlacklist: EquipmentFilterDetails;
/** Pool of items to pick from */
itemModPool: Record<string, string[]>;
/** Array with only weapon tpl in it, ready for mods to be added */
weapon: Item[];
/** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */
ammoTpl: string;
/** Parent item the mod will go into */
parentTemplate: ITemplateItem;
/** Should mod be spawned/skipped/use default */
modSpawnResult: ModSpawn;
/** Weapon stats for weapon being generated */
weaponStats: IWeaponStats;
}

View File

@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
walletLoot: IWalletLootSettings; walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */ /** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>; currencyStackSize: Record<string, Record<string, Record<string, number>>>;
/** Tpls for low profile gas blocks */
lowProfileGasBlockTpls: string[];
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {

View File

@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
commit?: string; commit?: string;
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
/** Server locale keys that will be added to the bottom of the startup watermark */
customWatermarkLocaleKeys?: string[];
} }
export interface IBsgLogging { export interface IBsgLogging {
/** /**

View File

@ -28,6 +28,7 @@ export interface Config {
WeaponOverlapDistanceCulling: number; WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean; WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView; NetworkStateView: INetworkStateView;
WsReconnectionDelays: string[];
} }
export interface FramerateLimit { export interface FramerateLimit {
MaxFramerateGameLimit: number; MaxFramerateGameLimit: number;

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

View File

@ -0,0 +1,27 @@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
export interface IModToSpawnRequest {
/** Slot mod will fit into */
modSlot: string;
/** Will generate a randomised mod pool if true */
isRandomisableSlot: boolean;
/** Parent slot the item will be a part of */
botWeaponSightWhitelist: Record<string, string[]>;
/** Blacklist to prevent mods from being picked */
botEquipBlacklist: EquipmentFilterDetails;
/** Pool of items to pick from */
itemModPool: Record<string, string[]>;
/** Array with only weapon tpl in it, ready for mods to be added */
weapon: Item[];
/** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */
ammoTpl: string;
/** Parent item the mod will go into */
parentTemplate: ITemplateItem;
/** Should mod be spawned/skipped/use default */
modSpawnResult: ModSpawn;
/** Weapon stats for weapon being generated */
weaponStats: IWeaponStats;
}

View File

@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
walletLoot: IWalletLootSettings; walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */ /** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>; currencyStackSize: Record<string, Record<string, Record<string, number>>>;
/** Tpls for low profile gas blocks */
lowProfileGasBlockTpls: string[];
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {

View File

@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
commit?: string; commit?: string;
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
/** Server locale keys that will be added to the bottom of the startup watermark */
customWatermarkLocaleKeys?: string[];
} }
export interface IBsgLogging { export interface IBsgLogging {
/** /**

View File

@ -28,6 +28,7 @@ export interface Config {
WeaponOverlapDistanceCulling: number; WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean; WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView; NetworkStateView: INetworkStateView;
WsReconnectionDelays: string[];
} }
export interface FramerateLimit { export interface FramerateLimit {
MaxFramerateGameLimit: number; MaxFramerateGameLimit: number;

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

View File

@ -0,0 +1,27 @@
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig";
export interface IModToSpawnRequest {
/** Slot mod will fit into */
modSlot: string;
/** Will generate a randomised mod pool if true */
isRandomisableSlot: boolean;
/** Parent slot the item will be a part of */
botWeaponSightWhitelist: Record<string, string[]>;
/** Blacklist to prevent mods from being picked */
botEquipBlacklist: EquipmentFilterDetails;
/** Pool of items to pick from */
itemModPool: Record<string, string[]>;
/** Array with only weapon tpl in it, ready for mods to be added */
weapon: Item[];
/** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */
ammoTpl: string;
/** Parent item the mod will go into */
parentTemplate: ITemplateItem;
/** Should mod be spawned/skipped/use default */
modSpawnResult: ModSpawn;
/** Weapon stats for weapon being generated */
weaponStats: IWeaponStats;
}

View File

@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
walletLoot: IWalletLootSettings; walletLoot: IWalletLootSettings;
/** Currency weights, Keyed by botrole / currency */ /** Currency weights, Keyed by botrole / currency */
currencyStackSize: Record<string, Record<string, Record<string, number>>>; currencyStackSize: Record<string, Record<string, Record<string, number>>>;
/** Tpls for low profile gas blocks */
lowProfileGasBlockTpls: string[];
} }
/** Number of bots to generate and store in cache on raid start per bot type */ /** Number of bots to generate and store in cache on raid start per bot type */
export interface PresetBatch { export interface PresetBatch {

View File

@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
commit?: string; commit?: string;
/** Timestamp of server build */ /** Timestamp of server build */
buildTime?: string; buildTime?: string;
/** Server locale keys that will be added to the bottom of the startup watermark */
customWatermarkLocaleKeys?: string[];
} }
export interface IBsgLogging { export interface IBsgLogging {
/** /**

View File

@ -28,6 +28,7 @@ export interface Config {
WeaponOverlapDistanceCulling: number; WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean; WebDiagnosticsEnabled: boolean;
NetworkStateView: INetworkStateView; NetworkStateView: INetworkStateView;
WsReconnectionDelays: string[];
} }
export interface FramerateLimit { export interface FramerateLimit {
MaxFramerateGameLimit: number; MaxFramerateGameLimit: number;

View File

@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { ModSpawn } from "@spt/models/enums/ModSpawn";
import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult";
import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest";
import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest";
import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService"; import { BotWeaponModLimitService } from "@spt/services/BotWeaponModLimitService";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocalisationService } from "@spt/services/LocalisationService"; import { LocalisationService } from "@spt/services/LocalisationService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
@ -69,20 +71,11 @@ export declare class BotEquipmentModGenerator {
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult; protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/** /**
* Add mods to a weapon using the provided mod pool * Add mods to a weapon using the provided mod pool
* @param sessionId session id * @param sessionId Session id
* @param weapon Weapon to add mods to * @param request Data used to generate the weapon
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponId parentId of weapon
* @param parentTemplate 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
* @param botLevel Level of the bot weapon is being generated for
* @param modLimits limits placed on certain mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
*/ */
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
/** /**
* @param modSlot Slot mod will fit into * Choose a mod to fit into the desired slot
* @param isRandomisableSlot Will generate a randomised mod pool if true * @param request Data used to choose an appropriate mod with
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @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 Parent item the mod will go into
* @returns itemHelper.getItem() result * @returns itemHelper.getItem() result
*/ */
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem, modSpawnResult: ModSpawn): [boolean, ITemplateItem]; protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem];
protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult; protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, modSpawnResult: ModSpawn, weapon: Item[], modSlotname: string): IChooseRandomCompatibleModResult;
/** /**
* Filter mod pool down based on various criteria: * Filter mod pool down based on various criteria:

View File

@ -1,13 +1,15 @@
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator"; import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
import { BotHelper } from "@spt/helpers/BotHelper";
import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { HandbookHelper } from "@spt/helpers/HandbookHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer";
import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected ragfairServerHelper: RagfairServerHelper; protected ragfairServerHelper: RagfairServerHelper;
protected profileHelper: ProfileHelper;
protected handbookHelper: HandbookHelper; protected handbookHelper: HandbookHelper;
protected botHelper: BotHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected ragfairAssortGenerator: RagfairAssortGenerator; protected ragfairAssortGenerator: RagfairAssortGenerator;
@ -47,7 +51,7 @@ export declare class RagfairOfferGenerator {
}[]; }[];
/** Internal counter to ensure each offer created has a unique value for its intId property */ /** Internal counter to ensure each offer created has a unique value for its intId property */
protected offerCounter: number; protected offerCounter: number;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, botHelper: BotHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner);
/** /**
* 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 userID Owner of the offer
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Flags sellInOnePiece to be true * @param sellInOnePiece Flags sellInOnePiece to be true
* @returns IRagfairOffer * @returns Created flea offer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/**
* Create the user object stored inside each flea offer object
* @param userID user creating the offer
* @param isTrader Is the user creating the offer a trader
* @returns IRagfairOfferUser
*/
createUserDataForFleaOffer(userID: string, isTrader: boolean): IRagfairOfferUser;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer

View File

@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
protected cloner: ICloner; protected cloner: ICloner;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner);
/**
* Get a difficulty object modified to handle fighting other PMCs
* @param pmcType 'bear or 'usec'
* @param difficulty easy / normal / hard / impossible
* @param usecType sptUsec
* @param bearType sptBear
* @returns Difficulty object
*/
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
/**
* Add bot types to ENEMY_BOT_TYPES array
* @param difficultySettings Bot settings to alter
* @param typesToAdd Bot types to add to enemy list
* @param typeBeingEdited Bot type to ignore and not add to enemy list
*/
protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void;
/**
* Configure difficulty settings to be hostile to USEC and BEAR
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void;
/** /**
* Get difficulty settings for desired bot type, if not found use assault bot types * Get difficulty settings for desired bot type, if not found use assault bot types
* @param type bot type to retrieve difficulty of * @param type bot type to retrieve difficulty of

View File

@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { LocalisationService } from "@spt/services/LocalisationService";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
export declare class BotHelper { export declare class BotHelper {
protected logger: ILogger; protected logger: ILogger;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, configServer: ConfigServer);
/** /**
* Get a template object for the specified botRole from bots.types db * Get a template object for the specified botRole from bots.types db
* @param role botRole to get template for * @param role botRole to get template for
* @returns IBotType object * @returns IBotType object
*/ */
getBotTemplate(role: string): IBotType; getBotTemplate(role: string): IBotType;
/**
* Randomize the chance the PMC will attack their own side
* Look up value in bot.json/chanceSameSideIsHostilePercent
* @param difficultySettings pmc difficulty settings
*/
randomizePmcHostility(difficultySettings: Difficulty): void;
/** /**
* Is the passed in bot role a PMC (usec/bear/pmc) * Is the passed in bot role a PMC (usec/bear/pmc)
* @param botRole bot role to check * @param botRole bot role to check
@ -42,12 +34,6 @@ export declare class BotHelper {
* @param typeToAdd bot type to add to friendly list * @param typeToAdd bot type to add to friendly list
*/ */
addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void;
/**
* 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 typesToAdd bot type to add to enemy list
*/
addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited: string): void;
/** /**
* Add a bot to the REVENGE_BOT_TYPES array * Add a bot to the REVENGE_BOT_TYPES array
* @param difficultySettings bot settings to alter * @param difficultySettings bot settings to alter
@ -85,4 +71,5 @@ export declare class BotHelper {
* @returns pmc side as string * @returns pmc side as string
*/ */
protected getRandomizedPmcSide(): string; protected getRandomizedPmcSide(): string;
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
} }

View File

@ -1,3 +1,4 @@
import { BotHelper } from "@spt/helpers/BotHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper";
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botHelper: BotHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -53,7 +55,7 @@ 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, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client

View File

@ -1,10 +1,8 @@
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -12,10 +10,8 @@ import { ConfigServer } from "@spt/servers/ConfigServer";
import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer";
import { SaveServer } from "@spt/servers/SaveServer"; import { SaveServer } from "@spt/servers/SaveServer";
import { ItemFilterService } from "@spt/services/ItemFilterService"; import { ItemFilterService } from "@spt/services/ItemFilterService";
import { LocaleService } from "@spt/services/LocaleService";
import { MailSendService } from "@spt/services/MailSendService"; import { MailSendService } from "@spt/services/MailSendService";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
/** /**
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class RagfairServerHelper { export declare class RagfairServerHelper {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil; protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localeService: LocaleService;
protected dialogueHelper: DialogueHelper;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string; protected static goodsReturnedTemplate: string;
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, traderHelper: TraderHelper, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner);
/** /**
* Is item valid / on blacklist / quest item * Is item valid / on blacklist / quest item
* @param itemDetails * @param itemDetails
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
* @returns currency tpl * @returns currency tpl
*/ */
getDynamicOfferCurrency(): string; getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
/** /**
* Given a preset id from globals.json, return an array of items[] with unique ids * Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item * @param item Preset item

View File

@ -3,4 +3,5 @@ export interface IInsuredItemsData {
durability?: number; durability?: number;
maxDurability?: number; maxDurability?: number;
hits?: number; hits?: number;
usedInQuest: boolean;
} }

View File

@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
memberType: MemberCategory; memberType: MemberCategory;
avatar?: string; avatar?: string;
isRatingGrowing?: boolean; isRatingGrowing?: boolean;
aid?: number;
} }
export interface SellResult { export interface SellResult {
sellTime: number; sellTime: number;

View File

@ -0,0 +1,37 @@
import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType";
import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
import { BotModLimits } from "@spt/services/BotWeaponModLimitService";
export interface IGenerateWeaponRequest {
/** Weapon to add mods to / result that is returned */
weapon: Item[];
/** Pool of compatible mods to attach to weapon */
modPool: Mods;
/** ParentId of weapon */
weaponId: string;
/** Weapon which mods will be generated on */
parentTemplate: ITemplateItem;
/** Chance values mod will be added */
modSpawnChances: ModsChances;
/** Ammo tpl to use when generating magazines/cartridges */
ammoTpl: string;
/** Bot-specific properties */
botData: IBotData;
/** limits placed on certain mod types per gun */
modLimits: BotModLimits;
/** Info related to the weapon being generated */
weaponStats: IWeaponStats;
}
export interface IBotData {
/** Role of bot weapon is generated for */
role: string;
/** Level of the bot weapon is being generated for */
level: number;
/** role of bot when accessing bot.json equipment config settings */
equipmentRole: string;
}
export interface IWeaponStats {
hasOptic?: boolean;
hasFrontIronSight?: boolean;
hasRearIronSight?: boolean;
}

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