Update types
This commit is contained in:
parent
4f0739b138
commit
0c3131a43d
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/10ScopesAndTypes/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/10ScopesAndTypes/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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;
|
||||
}
|
27
TypeScript/10ScopesAndTypes/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal file
27
TypeScript/10ScopesAndTypes/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal 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;
|
||||
}
|
@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
walletLoot: IWalletLootSettings;
|
||||
/** Currency weights, Keyed by botrole / currency */
|
||||
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 */
|
||||
export interface PresetBatch {
|
||||
|
@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
commit?: string;
|
||||
/** Timestamp of server build */
|
||||
buildTime?: string;
|
||||
/** Server locale keys that will be added to the bottom of the startup watermark */
|
||||
customWatermarkLocaleKeys?: string[];
|
||||
}
|
||||
export interface IBsgLogging {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export interface Config {
|
||||
WeaponOverlapDistanceCulling: number;
|
||||
WebDiagnosticsEnabled: boolean;
|
||||
NetworkStateView: INetworkStateView;
|
||||
WsReconnectionDelays: string[];
|
||||
}
|
||||
export interface FramerateLimit {
|
||||
MaxFramerateGameLimit: number;
|
||||
|
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/11BundleLoadingSample/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/11BundleLoadingSample/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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;
|
||||
}
|
27
TypeScript/11BundleLoadingSample/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal file
27
TypeScript/11BundleLoadingSample/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal 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;
|
||||
}
|
@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
walletLoot: IWalletLootSettings;
|
||||
/** Currency weights, Keyed by botrole / currency */
|
||||
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 */
|
||||
export interface PresetBatch {
|
||||
|
@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
commit?: string;
|
||||
/** Timestamp of server build */
|
||||
buildTime?: string;
|
||||
/** Server locale keys that will be added to the bottom of the startup watermark */
|
||||
customWatermarkLocaleKeys?: string[];
|
||||
}
|
||||
export interface IBsgLogging {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export interface Config {
|
||||
WeaponOverlapDistanceCulling: number;
|
||||
WebDiagnosticsEnabled: boolean;
|
||||
NetworkStateView: INetworkStateView;
|
||||
WsReconnectionDelays: string[];
|
||||
}
|
||||
export interface FramerateLimit {
|
||||
MaxFramerateGameLimit: number;
|
||||
|
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/12ClassExtensionOverride/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/12ClassExtensionOverride/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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;
|
||||
}
|
27
TypeScript/12ClassExtensionOverride/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal file
27
TypeScript/12ClassExtensionOverride/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal 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;
|
||||
}
|
@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
walletLoot: IWalletLootSettings;
|
||||
/** Currency weights, Keyed by botrole / currency */
|
||||
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 */
|
||||
export interface PresetBatch {
|
||||
|
@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
commit?: string;
|
||||
/** Timestamp of server build */
|
||||
buildTime?: string;
|
||||
/** Server locale keys that will be added to the bottom of the startup watermark */
|
||||
customWatermarkLocaleKeys?: string[];
|
||||
}
|
||||
export interface IBsgLogging {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export interface Config {
|
||||
WeaponOverlapDistanceCulling: number;
|
||||
WebDiagnosticsEnabled: boolean;
|
||||
NetworkStateView: INetworkStateView;
|
||||
WsReconnectionDelays: string[];
|
||||
}
|
||||
export interface FramerateLimit {
|
||||
MaxFramerateGameLimit: number;
|
||||
|
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/13AddTrader/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/13AddTrader/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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;
|
||||
}
|
27
TypeScript/13AddTrader/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal file
27
TypeScript/13AddTrader/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal 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;
|
||||
}
|
@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
walletLoot: IWalletLootSettings;
|
||||
/** Currency weights, Keyed by botrole / currency */
|
||||
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 */
|
||||
export interface PresetBatch {
|
||||
|
@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
commit?: string;
|
||||
/** Timestamp of server build */
|
||||
buildTime?: string;
|
||||
/** Server locale keys that will be added to the bottom of the startup watermark */
|
||||
customWatermarkLocaleKeys?: string[];
|
||||
}
|
||||
export interface IBsgLogging {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export interface Config {
|
||||
WeaponOverlapDistanceCulling: number;
|
||||
WebDiagnosticsEnabled: boolean;
|
||||
NetworkStateView: INetworkStateView;
|
||||
WsReconnectionDelays: string[];
|
||||
}
|
||||
export interface FramerateLimit {
|
||||
MaxFramerateGameLimit: number;
|
||||
|
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/14AfterDBLoadHook/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/14AfterDBLoadHook/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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;
|
||||
}
|
27
TypeScript/14AfterDBLoadHook/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal file
27
TypeScript/14AfterDBLoadHook/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal 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;
|
||||
}
|
@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
walletLoot: IWalletLootSettings;
|
||||
/** Currency weights, Keyed by botrole / currency */
|
||||
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 */
|
||||
export interface PresetBatch {
|
||||
|
@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
commit?: string;
|
||||
/** Timestamp of server build */
|
||||
buildTime?: string;
|
||||
/** Server locale keys that will be added to the bottom of the startup watermark */
|
||||
customWatermarkLocaleKeys?: string[];
|
||||
}
|
||||
export interface IBsgLogging {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export interface Config {
|
||||
WeaponOverlapDistanceCulling: number;
|
||||
WebDiagnosticsEnabled: boolean;
|
||||
NetworkStateView: INetworkStateView;
|
||||
WsReconnectionDelays: string[];
|
||||
}
|
||||
export interface FramerateLimit {
|
||||
MaxFramerateGameLimit: number;
|
||||
|
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/15HttpListenerExample/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/15HttpListenerExample/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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;
|
||||
}
|
27
TypeScript/15HttpListenerExample/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal file
27
TypeScript/15HttpListenerExample/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal 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;
|
||||
}
|
@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
walletLoot: IWalletLootSettings;
|
||||
/** Currency weights, Keyed by botrole / currency */
|
||||
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 */
|
||||
export interface PresetBatch {
|
||||
|
@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
commit?: string;
|
||||
/** Timestamp of server build */
|
||||
buildTime?: string;
|
||||
/** Server locale keys that will be added to the bottom of the startup watermark */
|
||||
customWatermarkLocaleKeys?: string[];
|
||||
}
|
||||
export interface IBsgLogging {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export interface Config {
|
||||
WeaponOverlapDistanceCulling: number;
|
||||
WebDiagnosticsEnabled: boolean;
|
||||
NetworkStateView: INetworkStateView;
|
||||
WsReconnectionDelays: string[];
|
||||
}
|
||||
export interface FramerateLimit {
|
||||
MaxFramerateGameLimit: number;
|
||||
|
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/16ImporterUtil/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/16ImporterUtil/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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;
|
||||
}
|
27
TypeScript/16ImporterUtil/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal file
27
TypeScript/16ImporterUtil/types/models/spt/bots/IModToSpawnRequest.d.ts
vendored
Normal 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;
|
||||
}
|
@ -39,6 +39,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
walletLoot: IWalletLootSettings;
|
||||
/** Currency weights, Keyed by botrole / currency */
|
||||
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 */
|
||||
export interface PresetBatch {
|
||||
|
@ -16,6 +16,8 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
commit?: string;
|
||||
/** Timestamp of server build */
|
||||
buildTime?: string;
|
||||
/** Server locale keys that will be added to the bottom of the startup watermark */
|
||||
customWatermarkLocaleKeys?: string[];
|
||||
}
|
||||
export interface IBsgLogging {
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ export interface Config {
|
||||
WeaponOverlapDistanceCulling: number;
|
||||
WebDiagnosticsEnabled: boolean;
|
||||
NetworkStateView: INetworkStateView;
|
||||
WsReconnectionDelays: string[];
|
||||
}
|
||||
export interface FramerateLimit {
|
||||
MaxFramerateGameLimit: number;
|
||||
|
@ -12,13 +12,15 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ModSpawn } from "@spt/models/enums/ModSpawn";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService";
|
||||
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 { LocalisationService } from "@spt/services/LocalisationService";
|
||||
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;
|
||||
/**
|
||||
* Add mods to a weapon using the provided mod pool
|
||||
* @param sessionId session id
|
||||
* @param weapon Weapon to add mods to
|
||||
* @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
|
||||
* @param sessionId Session id
|
||||
* @param request Data used to generate the weapon
|
||||
* @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
|
||||
* @param modSlot Slot to check
|
||||
@ -120,17 +113,11 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn;
|
||||
/**
|
||||
* @param modSlot Slot mod will fit into
|
||||
* @param isRandomisableSlot Will generate a randomised mod pool if true
|
||||
* @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
|
||||
* Choose a mod to fit into the desired slot
|
||||
* @param request Data used to choose an appropriate mod with
|
||||
* @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;
|
||||
/**
|
||||
* Filter mod pool down based on various criteria:
|
||||
|
@ -1,13 +1,15 @@
|
||||
import { RagfairAssortGenerator } from "@spt/generators/RagfairAssortGenerator";
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { HandbookHelper } from "@spt/helpers/HandbookHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
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 { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -28,7 +30,9 @@ export declare class RagfairOfferGenerator {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
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 */
|
||||
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
|
||||
* @param userID Owner of the offer
|
||||
@ -56,9 +60,9 @@ export declare class RagfairOfferGenerator {
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @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()
|
||||
* @param userID Owner of the offer
|
||||
@ -70,6 +74,13 @@ export declare class RagfairOfferGenerator {
|
||||
* @returns 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
|
||||
* @param offerRequirements barter requirements for offer
|
||||
|
@ -17,7 +17,28 @@ export declare class BotDifficultyHelper {
|
||||
protected cloner: ICloner;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
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;
|
||||
/**
|
||||
* 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
|
||||
* @param type bot type to retrieve difficulty of
|
||||
|
@ -5,29 +5,21 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
export declare class BotHelper {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
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
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
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)
|
||||
* @param botRole bot role to check
|
||||
@ -42,12 +34,6 @@ export declare class BotHelper {
|
||||
* @param typeToAdd bot type to add to friendly list
|
||||
*/
|
||||
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
|
||||
* @param difficultySettings bot settings to alter
|
||||
@ -85,4 +71,5 @@ export declare class BotHelper {
|
||||
* @returns pmc side as string
|
||||
*/
|
||||
protected getRandomizedPmcSide(): string;
|
||||
getPmcNicknameOfMaxLength(userId: string, maxLength: number): string;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { BotHelper } from "@spt/helpers/BotHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PaymentHelper } from "@spt/helpers/PaymentHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
@ -37,6 +38,7 @@ export declare class RagfairOfferHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -53,7 +55,7 @@ export declare class RagfairOfferHelper {
|
||||
protected static goodSoldTemplate: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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
|
||||
* @param searchRequest Data from client
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { DialogueHelper } from "@spt/helpers/DialogueHelper";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { TraderHelper } from "@spt/helpers/TraderHelper";
|
||||
import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
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 { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
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 { SaveServer } from "@spt/servers/SaveServer";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt/services/LocaleService";
|
||||
import { MailSendService } from "@spt/services/MailSendService";
|
||||
import { ICloner } from "@spt/utils/cloners/ICloner";
|
||||
import { HashUtil } from "@spt/utils/HashUtil";
|
||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
/**
|
||||
@ -24,14 +20,11 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export declare class RagfairServerHelper {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
@ -40,7 +33,7 @@ export declare class RagfairServerHelper {
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
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
|
||||
* @param itemDetails
|
||||
@ -83,13 +76,6 @@ export declare class RagfairServerHelper {
|
||||
* @returns currency tpl
|
||||
*/
|
||||
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
|
||||
* @param item Preset item
|
||||
|
@ -3,4 +3,5 @@ export interface IInsuredItemsData {
|
||||
durability?: number;
|
||||
maxDurability?: number;
|
||||
hits?: number;
|
||||
usedInQuest: boolean;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ export interface IRagfairOfferUser {
|
||||
memberType: MemberCategory;
|
||||
avatar?: string;
|
||||
isRatingGrowing?: boolean;
|
||||
aid?: number;
|
||||
}
|
||||
export interface SellResult {
|
||||
sellTime: number;
|
||||
|
37
TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal file
37
TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IGenerateWeaponRequest.d.ts
vendored
Normal 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
Loading…
x
Reference in New Issue
Block a user