Updated types
This commit is contained in:
parent
e2790c4e34
commit
d9c9041264
@ -1,7 +1,7 @@
|
||||
import { DialogueController } from "@spt-aki/controllers/DialogueController";
|
||||
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
|
||||
@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate {
|
||||
* Handle client/friend/request/send
|
||||
*/
|
||||
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||
/**
|
||||
* Handle client/friend/request/accept-all
|
||||
*/
|
||||
acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/friend/request/accept
|
||||
*/
|
||||
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/decline
|
||||
*/
|
||||
declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/cancel
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ export declare class BotLootGenerator {
|
||||
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @param isPmc Is bot being generated for a pmc
|
||||
*/
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
|
||||
protected createWalletLoot(walletId: string): Item[][];
|
||||
/**
|
||||
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||
@ -101,7 +101,7 @@ export declare class BotLootGenerator {
|
||||
* @param botRole bots role .e.g. pmcBot
|
||||
* @param isPmc are we generating for a pmc
|
||||
*/
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
|
||||
/**
|
||||
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||
* All values are set to 0
|
||||
|
@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -22,8 +23,9 @@ export declare class FenceBaseAssortGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceService: FenceService;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService);
|
||||
/**
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
@ -40,8 +42,6 @@ export declare class FenceBaseAssortGenerator {
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Add soft inserts + armor plates to an armor
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -92,7 +92,7 @@ export declare class BotGeneratorHelper {
|
||||
* @param inventory Inventory to add item+children into
|
||||
* @returns ItemAddedResult result object
|
||||
*/
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set<string>): ItemAddedResult;
|
||||
/**
|
||||
* Is the provided item allowed inside a container
|
||||
* @param slotGrid Items sub-grid we want to place item inside
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -19,6 +20,7 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
@ -29,8 +31,8 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
protected savedCommand: Map<string, SavedCommand>;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
@ -0,0 +1,38 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class ProfileSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt profile level 20
|
||||
* spt profile skill metabolism 10
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent;
|
||||
protected handleLevelCommand(level: number): IProfileChangeEvent;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class TraderSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt trader prapor rep 100
|
||||
* spt trader mechanic spend 1000000
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { CompareUtil } from "@spt-aki/utils/CompareUtil";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||
@ -28,8 +29,33 @@ export declare class ItemHelper {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected localeService: LocaleService;
|
||||
protected compareUtil: CompareUtil;
|
||||
protected readonly defaultInvalidBaseTypes: string[];
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil);
|
||||
/**
|
||||
* This method will compare two items (with all its children) and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item with all its children to compare
|
||||
* @param item2 second item with all its children to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItems(item1: Item[], item2: Item[], compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* This method will compare two items and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item to compare
|
||||
* @param item2 second item to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItem(item1: Item, item2: Item, compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* Helper method to generate a Upd based on a template
|
||||
* @param itemTemplate the item template to generate a Upd for
|
||||
* @returns A Upd with all the default properties set
|
||||
*/
|
||||
generateUpdForItem(itemTemplate: ITemplateItem): Upd;
|
||||
/**
|
||||
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||
* @param {string} tpl the template id / tpl
|
||||
|
@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface ICancelFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
request_id: string;
|
||||
export interface IDeclineFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
profileId: string;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export interface IFriendRequestSendResponse {
|
||||
status: number;
|
||||
requestid: string;
|
||||
requestId: string;
|
||||
retryAfter: number;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../common/tables/IItem";
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
export interface IGetOtherProfileResponse {
|
||||
id: string;
|
||||
aid: number;
|
||||
|
@ -1,9 +1,11 @@
|
||||
export interface ISearchFriendResponse {
|
||||
_id: string;
|
||||
aid: number;
|
||||
Info: Info;
|
||||
}
|
||||
export interface Info {
|
||||
Nickname: string;
|
||||
Side: string;
|
||||
Level: number;
|
||||
MemberCategory: number;
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig {
|
||||
/** Force a number of healing items into PMCs secure container to ensure they can heal */
|
||||
forceHealingItemsIntoSecure: boolean;
|
||||
allPMCsHavePlayerNameWithRandomPrefixChance: number;
|
||||
/** Should secure container loot from usec.json/bear.json be added to pmc bots secure */
|
||||
addSecureContainerLootFromBotConfig: boolean;
|
||||
}
|
||||
export interface PmcTypes {
|
||||
usec: string;
|
||||
|
@ -30,7 +30,15 @@ export interface ISendMessageDetails {
|
||||
}
|
||||
export interface IProfileChangeEvent {
|
||||
_id: string;
|
||||
Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader";
|
||||
Type: ProfileChangeEventType;
|
||||
value: number;
|
||||
entity?: string;
|
||||
}
|
||||
export declare enum ProfileChangeEventType {
|
||||
TRADER_SALES_SUM = "TraderSalesSum",
|
||||
TRADER_STANDING = "TraderStanding",
|
||||
PROFILE_LEVEL = "ProfileLevel",
|
||||
SKILL_POINTS = "SkillPoints",
|
||||
EXAMINE_ALL_ITEMS = "ExamineAllItems",
|
||||
UNLOCK_TRADER = "UnlockTrader"
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ export declare class FenceService {
|
||||
protected fenceDiscountAssort: ITraderAssort;
|
||||
/** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
protected desiredAssortCounts: IFenceAssortGenerationValues;
|
||||
protected fenceItemUpdCompareProperties: Set<string>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Replace main fence assort with new assort
|
||||
@ -73,6 +74,26 @@ export declare class FenceService {
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
|
||||
/**
|
||||
* Adds to fence assort a single item (with its children)
|
||||
* @param items the items to add with all its childrens
|
||||
* @param mainItem the most parent item of the array
|
||||
*/
|
||||
addItemsToFenceAssort(items: Item[], mainItem: Item): void;
|
||||
/**
|
||||
* Calculates the overall price for an item (with all its children)
|
||||
* @param itemTpl the item tpl to calculate the fence price for
|
||||
* @param items the items (with its children) to calculate fence price for
|
||||
* @returns the fence price of the item
|
||||
*/
|
||||
getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
/**
|
||||
* Calculate the overall price for an ammo box, where only one item is
|
||||
* the ammo box itself and every other items are the bullets in that box
|
||||
* @param items the ammo box (and all its children ammo items)
|
||||
* @returns the price of the ammo box
|
||||
*/
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Adjust all items contained inside an assort by a multiplier
|
||||
* @param assort (clone)Assort that contains items with prices to adjust
|
||||
|
@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
||||
import { Traders } from "@spt-aki/models/enums/Traders";
|
||||
import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
@ -55,7 +55,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void;
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void;
|
||||
/**
|
||||
* Send a message from SYSTEM to the player with or without items with localised text
|
||||
* @param sessionId The session ID to send the message to
|
||||
@ -63,7 +63,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void;
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void;
|
||||
/**
|
||||
* Send a USER message to a player with or without items
|
||||
* @param sessionId The session ID to send the message to
|
||||
|
11
TypeScript/10ScopesAndTypes/types/utils/CompareUtil.d.ts
vendored
Normal file
11
TypeScript/10ScopesAndTypes/types/utils/CompareUtil.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare class CompareUtil {
|
||||
private static typesToCheckAgainst;
|
||||
/**
|
||||
* This function does an object comparison, equivalent to applying reflections
|
||||
* and scanning for all possible properties including arrays.
|
||||
* @param v1 value 1 to compare
|
||||
* @param v2 value 2 to compare
|
||||
* @returns true if equal, false if not
|
||||
*/
|
||||
recursiveCompare(v1: any, v2: any): boolean;
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||
export declare class RagfairOfferHolder {
|
||||
protected maxOffersPerTemplate: number;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected offersById: Map<string, IRagfairOffer>;
|
||||
protected offersByTemplate: Map<string, Map<string, IRagfairOffer>>;
|
||||
protected offersByTrader: Map<string, Map<string, IRagfairOffer>>;
|
||||
constructor();
|
||||
constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper);
|
||||
getOfferById(id: string): IRagfairOffer;
|
||||
getOffersByTemplate(templateId: string): Array<IRagfairOffer>;
|
||||
getOffersByTrader(traderId: string): Array<IRagfairOffer>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DialogueController } from "@spt-aki/controllers/DialogueController";
|
||||
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
|
||||
@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate {
|
||||
* Handle client/friend/request/send
|
||||
*/
|
||||
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||
/**
|
||||
* Handle client/friend/request/accept-all
|
||||
*/
|
||||
acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/friend/request/accept
|
||||
*/
|
||||
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/decline
|
||||
*/
|
||||
declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/cancel
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ export declare class BotLootGenerator {
|
||||
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @param isPmc Is bot being generated for a pmc
|
||||
*/
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
|
||||
protected createWalletLoot(walletId: string): Item[][];
|
||||
/**
|
||||
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||
@ -101,7 +101,7 @@ export declare class BotLootGenerator {
|
||||
* @param botRole bots role .e.g. pmcBot
|
||||
* @param isPmc are we generating for a pmc
|
||||
*/
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
|
||||
/**
|
||||
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||
* All values are set to 0
|
||||
|
@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -22,8 +23,9 @@ export declare class FenceBaseAssortGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceService: FenceService;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService);
|
||||
/**
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
@ -40,8 +42,6 @@ export declare class FenceBaseAssortGenerator {
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Add soft inserts + armor plates to an armor
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -92,7 +92,7 @@ export declare class BotGeneratorHelper {
|
||||
* @param inventory Inventory to add item+children into
|
||||
* @returns ItemAddedResult result object
|
||||
*/
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set<string>): ItemAddedResult;
|
||||
/**
|
||||
* Is the provided item allowed inside a container
|
||||
* @param slotGrid Items sub-grid we want to place item inside
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -19,6 +20,7 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
@ -29,8 +31,8 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
protected savedCommand: Map<string, SavedCommand>;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
@ -0,0 +1,38 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class ProfileSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt profile level 20
|
||||
* spt profile skill metabolism 10
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent;
|
||||
protected handleLevelCommand(level: number): IProfileChangeEvent;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class TraderSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt trader prapor rep 100
|
||||
* spt trader mechanic spend 1000000
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { CompareUtil } from "@spt-aki/utils/CompareUtil";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||
@ -28,8 +29,33 @@ export declare class ItemHelper {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected localeService: LocaleService;
|
||||
protected compareUtil: CompareUtil;
|
||||
protected readonly defaultInvalidBaseTypes: string[];
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil);
|
||||
/**
|
||||
* This method will compare two items (with all its children) and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item with all its children to compare
|
||||
* @param item2 second item with all its children to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItems(item1: Item[], item2: Item[], compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* This method will compare two items and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item to compare
|
||||
* @param item2 second item to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItem(item1: Item, item2: Item, compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* Helper method to generate a Upd based on a template
|
||||
* @param itemTemplate the item template to generate a Upd for
|
||||
* @returns A Upd with all the default properties set
|
||||
*/
|
||||
generateUpdForItem(itemTemplate: ITemplateItem): Upd;
|
||||
/**
|
||||
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||
* @param {string} tpl the template id / tpl
|
||||
|
@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface ICancelFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
request_id: string;
|
||||
export interface IDeclineFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
profileId: string;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export interface IFriendRequestSendResponse {
|
||||
status: number;
|
||||
requestid: string;
|
||||
requestId: string;
|
||||
retryAfter: number;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../common/tables/IItem";
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
export interface IGetOtherProfileResponse {
|
||||
id: string;
|
||||
aid: number;
|
||||
|
@ -1,9 +1,11 @@
|
||||
export interface ISearchFriendResponse {
|
||||
_id: string;
|
||||
aid: number;
|
||||
Info: Info;
|
||||
}
|
||||
export interface Info {
|
||||
Nickname: string;
|
||||
Side: string;
|
||||
Level: number;
|
||||
MemberCategory: number;
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig {
|
||||
/** Force a number of healing items into PMCs secure container to ensure they can heal */
|
||||
forceHealingItemsIntoSecure: boolean;
|
||||
allPMCsHavePlayerNameWithRandomPrefixChance: number;
|
||||
/** Should secure container loot from usec.json/bear.json be added to pmc bots secure */
|
||||
addSecureContainerLootFromBotConfig: boolean;
|
||||
}
|
||||
export interface PmcTypes {
|
||||
usec: string;
|
||||
|
@ -30,7 +30,15 @@ export interface ISendMessageDetails {
|
||||
}
|
||||
export interface IProfileChangeEvent {
|
||||
_id: string;
|
||||
Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader";
|
||||
Type: ProfileChangeEventType;
|
||||
value: number;
|
||||
entity?: string;
|
||||
}
|
||||
export declare enum ProfileChangeEventType {
|
||||
TRADER_SALES_SUM = "TraderSalesSum",
|
||||
TRADER_STANDING = "TraderStanding",
|
||||
PROFILE_LEVEL = "ProfileLevel",
|
||||
SKILL_POINTS = "SkillPoints",
|
||||
EXAMINE_ALL_ITEMS = "ExamineAllItems",
|
||||
UNLOCK_TRADER = "UnlockTrader"
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ export declare class FenceService {
|
||||
protected fenceDiscountAssort: ITraderAssort;
|
||||
/** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
protected desiredAssortCounts: IFenceAssortGenerationValues;
|
||||
protected fenceItemUpdCompareProperties: Set<string>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Replace main fence assort with new assort
|
||||
@ -73,6 +74,26 @@ export declare class FenceService {
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
|
||||
/**
|
||||
* Adds to fence assort a single item (with its children)
|
||||
* @param items the items to add with all its childrens
|
||||
* @param mainItem the most parent item of the array
|
||||
*/
|
||||
addItemsToFenceAssort(items: Item[], mainItem: Item): void;
|
||||
/**
|
||||
* Calculates the overall price for an item (with all its children)
|
||||
* @param itemTpl the item tpl to calculate the fence price for
|
||||
* @param items the items (with its children) to calculate fence price for
|
||||
* @returns the fence price of the item
|
||||
*/
|
||||
getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
/**
|
||||
* Calculate the overall price for an ammo box, where only one item is
|
||||
* the ammo box itself and every other items are the bullets in that box
|
||||
* @param items the ammo box (and all its children ammo items)
|
||||
* @returns the price of the ammo box
|
||||
*/
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Adjust all items contained inside an assort by a multiplier
|
||||
* @param assort (clone)Assort that contains items with prices to adjust
|
||||
|
@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
||||
import { Traders } from "@spt-aki/models/enums/Traders";
|
||||
import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
@ -55,7 +55,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void;
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void;
|
||||
/**
|
||||
* Send a message from SYSTEM to the player with or without items with localised text
|
||||
* @param sessionId The session ID to send the message to
|
||||
@ -63,7 +63,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void;
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void;
|
||||
/**
|
||||
* Send a USER message to a player with or without items
|
||||
* @param sessionId The session ID to send the message to
|
||||
|
11
TypeScript/11BundleLoadingSample/types/utils/CompareUtil.d.ts
vendored
Normal file
11
TypeScript/11BundleLoadingSample/types/utils/CompareUtil.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare class CompareUtil {
|
||||
private static typesToCheckAgainst;
|
||||
/**
|
||||
* This function does an object comparison, equivalent to applying reflections
|
||||
* and scanning for all possible properties including arrays.
|
||||
* @param v1 value 1 to compare
|
||||
* @param v2 value 2 to compare
|
||||
* @returns true if equal, false if not
|
||||
*/
|
||||
recursiveCompare(v1: any, v2: any): boolean;
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||
export declare class RagfairOfferHolder {
|
||||
protected maxOffersPerTemplate: number;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected offersById: Map<string, IRagfairOffer>;
|
||||
protected offersByTemplate: Map<string, Map<string, IRagfairOffer>>;
|
||||
protected offersByTrader: Map<string, Map<string, IRagfairOffer>>;
|
||||
constructor();
|
||||
constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper);
|
||||
getOfferById(id: string): IRagfairOffer;
|
||||
getOffersByTemplate(templateId: string): Array<IRagfairOffer>;
|
||||
getOffersByTrader(traderId: string): Array<IRagfairOffer>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DialogueController } from "@spt-aki/controllers/DialogueController";
|
||||
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
|
||||
@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate {
|
||||
* Handle client/friend/request/send
|
||||
*/
|
||||
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||
/**
|
||||
* Handle client/friend/request/accept-all
|
||||
*/
|
||||
acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/friend/request/accept
|
||||
*/
|
||||
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/decline
|
||||
*/
|
||||
declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/cancel
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ export declare class BotLootGenerator {
|
||||
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @param isPmc Is bot being generated for a pmc
|
||||
*/
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
|
||||
protected createWalletLoot(walletId: string): Item[][];
|
||||
/**
|
||||
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||
@ -101,7 +101,7 @@ export declare class BotLootGenerator {
|
||||
* @param botRole bots role .e.g. pmcBot
|
||||
* @param isPmc are we generating for a pmc
|
||||
*/
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
|
||||
/**
|
||||
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||
* All values are set to 0
|
||||
|
@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -22,8 +23,9 @@ export declare class FenceBaseAssortGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceService: FenceService;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService);
|
||||
/**
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
@ -40,8 +42,6 @@ export declare class FenceBaseAssortGenerator {
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Add soft inserts + armor plates to an armor
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -92,7 +92,7 @@ export declare class BotGeneratorHelper {
|
||||
* @param inventory Inventory to add item+children into
|
||||
* @returns ItemAddedResult result object
|
||||
*/
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set<string>): ItemAddedResult;
|
||||
/**
|
||||
* Is the provided item allowed inside a container
|
||||
* @param slotGrid Items sub-grid we want to place item inside
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -19,6 +20,7 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
@ -29,8 +31,8 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
protected savedCommand: Map<string, SavedCommand>;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
@ -0,0 +1,38 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class ProfileSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt profile level 20
|
||||
* spt profile skill metabolism 10
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent;
|
||||
protected handleLevelCommand(level: number): IProfileChangeEvent;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class TraderSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt trader prapor rep 100
|
||||
* spt trader mechanic spend 1000000
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { CompareUtil } from "@spt-aki/utils/CompareUtil";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||
@ -28,8 +29,33 @@ export declare class ItemHelper {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected localeService: LocaleService;
|
||||
protected compareUtil: CompareUtil;
|
||||
protected readonly defaultInvalidBaseTypes: string[];
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil);
|
||||
/**
|
||||
* This method will compare two items (with all its children) and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item with all its children to compare
|
||||
* @param item2 second item with all its children to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItems(item1: Item[], item2: Item[], compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* This method will compare two items and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item to compare
|
||||
* @param item2 second item to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItem(item1: Item, item2: Item, compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* Helper method to generate a Upd based on a template
|
||||
* @param itemTemplate the item template to generate a Upd for
|
||||
* @returns A Upd with all the default properties set
|
||||
*/
|
||||
generateUpdForItem(itemTemplate: ITemplateItem): Upd;
|
||||
/**
|
||||
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||
* @param {string} tpl the template id / tpl
|
||||
|
@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface ICancelFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
request_id: string;
|
||||
export interface IDeclineFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
profileId: string;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export interface IFriendRequestSendResponse {
|
||||
status: number;
|
||||
requestid: string;
|
||||
requestId: string;
|
||||
retryAfter: number;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../common/tables/IItem";
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
export interface IGetOtherProfileResponse {
|
||||
id: string;
|
||||
aid: number;
|
||||
|
@ -1,9 +1,11 @@
|
||||
export interface ISearchFriendResponse {
|
||||
_id: string;
|
||||
aid: number;
|
||||
Info: Info;
|
||||
}
|
||||
export interface Info {
|
||||
Nickname: string;
|
||||
Side: string;
|
||||
Level: number;
|
||||
MemberCategory: number;
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig {
|
||||
/** Force a number of healing items into PMCs secure container to ensure they can heal */
|
||||
forceHealingItemsIntoSecure: boolean;
|
||||
allPMCsHavePlayerNameWithRandomPrefixChance: number;
|
||||
/** Should secure container loot from usec.json/bear.json be added to pmc bots secure */
|
||||
addSecureContainerLootFromBotConfig: boolean;
|
||||
}
|
||||
export interface PmcTypes {
|
||||
usec: string;
|
||||
|
@ -30,7 +30,15 @@ export interface ISendMessageDetails {
|
||||
}
|
||||
export interface IProfileChangeEvent {
|
||||
_id: string;
|
||||
Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader";
|
||||
Type: ProfileChangeEventType;
|
||||
value: number;
|
||||
entity?: string;
|
||||
}
|
||||
export declare enum ProfileChangeEventType {
|
||||
TRADER_SALES_SUM = "TraderSalesSum",
|
||||
TRADER_STANDING = "TraderStanding",
|
||||
PROFILE_LEVEL = "ProfileLevel",
|
||||
SKILL_POINTS = "SkillPoints",
|
||||
EXAMINE_ALL_ITEMS = "ExamineAllItems",
|
||||
UNLOCK_TRADER = "UnlockTrader"
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ export declare class FenceService {
|
||||
protected fenceDiscountAssort: ITraderAssort;
|
||||
/** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
protected desiredAssortCounts: IFenceAssortGenerationValues;
|
||||
protected fenceItemUpdCompareProperties: Set<string>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Replace main fence assort with new assort
|
||||
@ -73,6 +74,26 @@ export declare class FenceService {
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
|
||||
/**
|
||||
* Adds to fence assort a single item (with its children)
|
||||
* @param items the items to add with all its childrens
|
||||
* @param mainItem the most parent item of the array
|
||||
*/
|
||||
addItemsToFenceAssort(items: Item[], mainItem: Item): void;
|
||||
/**
|
||||
* Calculates the overall price for an item (with all its children)
|
||||
* @param itemTpl the item tpl to calculate the fence price for
|
||||
* @param items the items (with its children) to calculate fence price for
|
||||
* @returns the fence price of the item
|
||||
*/
|
||||
getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
/**
|
||||
* Calculate the overall price for an ammo box, where only one item is
|
||||
* the ammo box itself and every other items are the bullets in that box
|
||||
* @param items the ammo box (and all its children ammo items)
|
||||
* @returns the price of the ammo box
|
||||
*/
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Adjust all items contained inside an assort by a multiplier
|
||||
* @param assort (clone)Assort that contains items with prices to adjust
|
||||
|
@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
||||
import { Traders } from "@spt-aki/models/enums/Traders";
|
||||
import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
@ -55,7 +55,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void;
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void;
|
||||
/**
|
||||
* Send a message from SYSTEM to the player with or without items with localised text
|
||||
* @param sessionId The session ID to send the message to
|
||||
@ -63,7 +63,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void;
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void;
|
||||
/**
|
||||
* Send a USER message to a player with or without items
|
||||
* @param sessionId The session ID to send the message to
|
||||
|
11
TypeScript/12ClassExtensionOverride/types/utils/CompareUtil.d.ts
vendored
Normal file
11
TypeScript/12ClassExtensionOverride/types/utils/CompareUtil.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare class CompareUtil {
|
||||
private static typesToCheckAgainst;
|
||||
/**
|
||||
* This function does an object comparison, equivalent to applying reflections
|
||||
* and scanning for all possible properties including arrays.
|
||||
* @param v1 value 1 to compare
|
||||
* @param v2 value 2 to compare
|
||||
* @returns true if equal, false if not
|
||||
*/
|
||||
recursiveCompare(v1: any, v2: any): boolean;
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||
export declare class RagfairOfferHolder {
|
||||
protected maxOffersPerTemplate: number;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected offersById: Map<string, IRagfairOffer>;
|
||||
protected offersByTemplate: Map<string, Map<string, IRagfairOffer>>;
|
||||
protected offersByTrader: Map<string, Map<string, IRagfairOffer>>;
|
||||
constructor();
|
||||
constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper);
|
||||
getOfferById(id: string): IRagfairOffer;
|
||||
getOffersByTemplate(templateId: string): Array<IRagfairOffer>;
|
||||
getOffersByTrader(traderId: string): Array<IRagfairOffer>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DialogueController } from "@spt-aki/controllers/DialogueController";
|
||||
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
|
||||
@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate {
|
||||
* Handle client/friend/request/send
|
||||
*/
|
||||
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||
/**
|
||||
* Handle client/friend/request/accept-all
|
||||
*/
|
||||
acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/friend/request/accept
|
||||
*/
|
||||
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/decline
|
||||
*/
|
||||
declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/cancel
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ export declare class BotLootGenerator {
|
||||
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @param isPmc Is bot being generated for a pmc
|
||||
*/
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
|
||||
protected createWalletLoot(walletId: string): Item[][];
|
||||
/**
|
||||
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||
@ -101,7 +101,7 @@ export declare class BotLootGenerator {
|
||||
* @param botRole bots role .e.g. pmcBot
|
||||
* @param isPmc are we generating for a pmc
|
||||
*/
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
|
||||
/**
|
||||
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||
* All values are set to 0
|
||||
|
@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -22,8 +23,9 @@ export declare class FenceBaseAssortGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceService: FenceService;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService);
|
||||
/**
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
@ -40,8 +42,6 @@ export declare class FenceBaseAssortGenerator {
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Add soft inserts + armor plates to an armor
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -92,7 +92,7 @@ export declare class BotGeneratorHelper {
|
||||
* @param inventory Inventory to add item+children into
|
||||
* @returns ItemAddedResult result object
|
||||
*/
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set<string>): ItemAddedResult;
|
||||
/**
|
||||
* Is the provided item allowed inside a container
|
||||
* @param slotGrid Items sub-grid we want to place item inside
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -19,6 +20,7 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
@ -29,8 +31,8 @@ export declare class GiveSptCommand implements ISptCommand {
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
protected savedCommand: Map<string, SavedCommand>;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
@ -0,0 +1,38 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class ProfileSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt profile level 20
|
||||
* spt profile skill metabolism 10
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent;
|
||||
protected handleLevelCommand(level: number): IProfileChangeEvent;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class TraderSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt trader prapor rep 100
|
||||
* spt trader mechanic spend 1000000
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { CompareUtil } from "@spt-aki/utils/CompareUtil";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||
@ -28,8 +29,33 @@ export declare class ItemHelper {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected localeService: LocaleService;
|
||||
protected compareUtil: CompareUtil;
|
||||
protected readonly defaultInvalidBaseTypes: string[];
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil);
|
||||
/**
|
||||
* This method will compare two items (with all its children) and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item with all its children to compare
|
||||
* @param item2 second item with all its children to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItems(item1: Item[], item2: Item[], compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* This method will compare two items and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item to compare
|
||||
* @param item2 second item to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItem(item1: Item, item2: Item, compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* Helper method to generate a Upd based on a template
|
||||
* @param itemTemplate the item template to generate a Upd for
|
||||
* @returns A Upd with all the default properties set
|
||||
*/
|
||||
generateUpdForItem(itemTemplate: ITemplateItem): Upd;
|
||||
/**
|
||||
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||
* @param {string} tpl the template id / tpl
|
||||
|
@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface ICancelFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
request_id: string;
|
||||
export interface IDeclineFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
profileId: string;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export interface IFriendRequestSendResponse {
|
||||
status: number;
|
||||
requestid: string;
|
||||
requestId: string;
|
||||
retryAfter: number;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../common/tables/IItem";
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
export interface IGetOtherProfileResponse {
|
||||
id: string;
|
||||
aid: number;
|
||||
|
@ -1,9 +1,11 @@
|
||||
export interface ISearchFriendResponse {
|
||||
_id: string;
|
||||
aid: number;
|
||||
Info: Info;
|
||||
}
|
||||
export interface Info {
|
||||
Nickname: string;
|
||||
Side: string;
|
||||
Level: number;
|
||||
MemberCategory: number;
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig {
|
||||
/** Force a number of healing items into PMCs secure container to ensure they can heal */
|
||||
forceHealingItemsIntoSecure: boolean;
|
||||
allPMCsHavePlayerNameWithRandomPrefixChance: number;
|
||||
/** Should secure container loot from usec.json/bear.json be added to pmc bots secure */
|
||||
addSecureContainerLootFromBotConfig: boolean;
|
||||
}
|
||||
export interface PmcTypes {
|
||||
usec: string;
|
||||
|
@ -30,7 +30,15 @@ export interface ISendMessageDetails {
|
||||
}
|
||||
export interface IProfileChangeEvent {
|
||||
_id: string;
|
||||
Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader";
|
||||
Type: ProfileChangeEventType;
|
||||
value: number;
|
||||
entity?: string;
|
||||
}
|
||||
export declare enum ProfileChangeEventType {
|
||||
TRADER_SALES_SUM = "TraderSalesSum",
|
||||
TRADER_STANDING = "TraderStanding",
|
||||
PROFILE_LEVEL = "ProfileLevel",
|
||||
SKILL_POINTS = "SkillPoints",
|
||||
EXAMINE_ALL_ITEMS = "ExamineAllItems",
|
||||
UNLOCK_TRADER = "UnlockTrader"
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ export declare class FenceService {
|
||||
protected fenceDiscountAssort: ITraderAssort;
|
||||
/** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
protected desiredAssortCounts: IFenceAssortGenerationValues;
|
||||
protected fenceItemUpdCompareProperties: Set<string>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Replace main fence assort with new assort
|
||||
@ -73,6 +74,26 @@ export declare class FenceService {
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
|
||||
/**
|
||||
* Adds to fence assort a single item (with its children)
|
||||
* @param items the items to add with all its childrens
|
||||
* @param mainItem the most parent item of the array
|
||||
*/
|
||||
addItemsToFenceAssort(items: Item[], mainItem: Item): void;
|
||||
/**
|
||||
* Calculates the overall price for an item (with all its children)
|
||||
* @param itemTpl the item tpl to calculate the fence price for
|
||||
* @param items the items (with its children) to calculate fence price for
|
||||
* @returns the fence price of the item
|
||||
*/
|
||||
getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
/**
|
||||
* Calculate the overall price for an ammo box, where only one item is
|
||||
* the ammo box itself and every other items are the bullets in that box
|
||||
* @param items the ammo box (and all its children ammo items)
|
||||
* @returns the price of the ammo box
|
||||
*/
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Adjust all items contained inside an assort by a multiplier
|
||||
* @param assort (clone)Assort that contains items with prices to adjust
|
||||
|
@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
||||
import { Traders } from "@spt-aki/models/enums/Traders";
|
||||
import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
@ -55,7 +55,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void;
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void;
|
||||
/**
|
||||
* Send a message from SYSTEM to the player with or without items with localised text
|
||||
* @param sessionId The session ID to send the message to
|
||||
@ -63,7 +63,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void;
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void;
|
||||
/**
|
||||
* Send a USER message to a player with or without items
|
||||
* @param sessionId The session ID to send the message to
|
||||
|
11
TypeScript/13AddTrader/types/utils/CompareUtil.d.ts
vendored
Normal file
11
TypeScript/13AddTrader/types/utils/CompareUtil.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare class CompareUtil {
|
||||
private static typesToCheckAgainst;
|
||||
/**
|
||||
* This function does an object comparison, equivalent to applying reflections
|
||||
* and scanning for all possible properties including arrays.
|
||||
* @param v1 value 1 to compare
|
||||
* @param v2 value 2 to compare
|
||||
* @returns true if equal, false if not
|
||||
*/
|
||||
recursiveCompare(v1: any, v2: any): boolean;
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||
export declare class RagfairOfferHolder {
|
||||
protected maxOffersPerTemplate: number;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected offersById: Map<string, IRagfairOffer>;
|
||||
protected offersByTemplate: Map<string, Map<string, IRagfairOffer>>;
|
||||
protected offersByTrader: Map<string, Map<string, IRagfairOffer>>;
|
||||
constructor();
|
||||
constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper);
|
||||
getOfferById(id: string): IRagfairOffer;
|
||||
getOffersByTemplate(templateId: string): Array<IRagfairOffer>;
|
||||
getOffersByTrader(traderId: string): Array<IRagfairOffer>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DialogueController } from "@spt-aki/controllers/DialogueController";
|
||||
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
|
||||
@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate {
|
||||
* Handle client/friend/request/send
|
||||
*/
|
||||
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||
/**
|
||||
* Handle client/friend/request/accept-all
|
||||
*/
|
||||
acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/friend/request/accept
|
||||
*/
|
||||
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/decline
|
||||
*/
|
||||
declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/cancel
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ export declare class BotLootGenerator {
|
||||
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @param isPmc Is bot being generated for a pmc
|
||||
*/
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
|
||||
protected createWalletLoot(walletId: string): Item[][];
|
||||
/**
|
||||
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||
@ -101,7 +101,7 @@ export declare class BotLootGenerator {
|
||||
* @param botRole bots role .e.g. pmcBot
|
||||
* @param isPmc are we generating for a pmc
|
||||
*/
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
|
||||
/**
|
||||
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||
* All values are set to 0
|
||||
|
@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -22,8 +23,9 @@ export declare class FenceBaseAssortGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceService: FenceService;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService);
|
||||
/**
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
@ -40,8 +42,6 @@ export declare class FenceBaseAssortGenerator {
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Add soft inserts + armor plates to an armor
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -92,7 +92,7 @@ export declare class BotGeneratorHelper {
|
||||
* @param inventory Inventory to add item+children into
|
||||
* @returns ItemAddedResult result object
|
||||
*/
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set<string>): ItemAddedResult;
|
||||
/**
|
||||
* Is the provided item allowed inside a container
|
||||
* @param slotGrid Items sub-grid we want to place item inside
|
||||
|
@ -0,0 +1,39 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class GiveSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
* spt give templateId 5
|
||||
* spt give en "item name in english" 5
|
||||
* spt give es "nombre en español" 5
|
||||
* spt give 5 <== this is the reply when the algo isn't sure about an item
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: Map<string, SavedCommand>;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/SavedCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class GiveSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt give "item name" 5
|
||||
* spt give templateId 5
|
||||
* spt give en "item name in english" 5
|
||||
* spt give es "nombre en español" 5
|
||||
* spt give 5 <== this is the reply when the algo isn't sure about an item
|
||||
*/
|
||||
private static commandRegex;
|
||||
private static maxAllowedDistance;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class ProfileSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt profile level 20
|
||||
* spt profile skill metabolism 10
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent;
|
||||
protected handleLevelCommand(level: number): IProfileChangeEvent;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand";
|
||||
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt-aki/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
export declare class TraderSptCommand implements ISptCommand {
|
||||
protected logger: ILogger;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected localeService: LocaleService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
/**
|
||||
* Regex to account for all these cases:
|
||||
* spt trader prapor rep 100
|
||||
* spt trader mechanic spend 1000000
|
||||
*/
|
||||
private static commandRegex;
|
||||
protected savedCommand: SavedCommand;
|
||||
constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer);
|
||||
getCommand(): string;
|
||||
getCommandHelp(): string;
|
||||
performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase";
|
||||
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { LocaleService } from "@spt-aki/services/LocaleService";
|
||||
import { LocalisationService } from "@spt-aki/services/LocalisationService";
|
||||
import { CompareUtil } from "@spt-aki/utils/CompareUtil";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
|
||||
import { MathUtil } from "@spt-aki/utils/MathUtil";
|
||||
@ -28,8 +29,33 @@ export declare class ItemHelper {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected localeService: LocaleService;
|
||||
protected compareUtil: CompareUtil;
|
||||
protected readonly defaultInvalidBaseTypes: string[];
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil);
|
||||
/**
|
||||
* This method will compare two items (with all its children) and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item with all its children to compare
|
||||
* @param item2 second item with all its children to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItems(item1: Item[], item2: Item[], compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* This method will compare two items and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
* @param item1 first item to compare
|
||||
* @param item2 second item to compare
|
||||
* @param compareUpdProperties Upd properties to compare between the items
|
||||
* @returns true if they are the same, false if they arent
|
||||
*/
|
||||
isSameItem(item1: Item, item2: Item, compareUpdProperties?: Set<string>): boolean;
|
||||
/**
|
||||
* Helper method to generate a Upd based on a template
|
||||
* @param itemTemplate the item template to generate a Upd for
|
||||
* @returns A Upd with all the default properties set
|
||||
*/
|
||||
generateUpdForItem(itemTemplate: ITemplateItem): Upd;
|
||||
/**
|
||||
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
|
||||
* @param {string} tpl the template id / tpl
|
||||
|
@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface ICancelFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
request_id: string;
|
||||
export interface IDeclineFriendRequestData extends IBaseFriendRequest {
|
||||
}
|
||||
export interface IBaseFriendRequest {
|
||||
profileId: string;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export interface IFriendRequestSendResponse {
|
||||
status: number;
|
||||
requestid: string;
|
||||
requestId: string;
|
||||
retryAfter: number;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../common/tables/IItem";
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
export interface IGetOtherProfileResponse {
|
||||
id: string;
|
||||
aid: number;
|
||||
|
@ -1,9 +1,11 @@
|
||||
export interface ISearchFriendResponse {
|
||||
_id: string;
|
||||
aid: number;
|
||||
Info: Info;
|
||||
}
|
||||
export interface Info {
|
||||
Nickname: string;
|
||||
Side: string;
|
||||
Level: number;
|
||||
MemberCategory: number;
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig {
|
||||
/** Force a number of healing items into PMCs secure container to ensure they can heal */
|
||||
forceHealingItemsIntoSecure: boolean;
|
||||
allPMCsHavePlayerNameWithRandomPrefixChance: number;
|
||||
/** Should secure container loot from usec.json/bear.json be added to pmc bots secure */
|
||||
addSecureContainerLootFromBotConfig: boolean;
|
||||
}
|
||||
export interface PmcTypes {
|
||||
usec: string;
|
||||
|
@ -30,7 +30,15 @@ export interface ISendMessageDetails {
|
||||
}
|
||||
export interface IProfileChangeEvent {
|
||||
_id: string;
|
||||
Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader";
|
||||
Type: ProfileChangeEventType;
|
||||
value: number;
|
||||
entity?: string;
|
||||
}
|
||||
export declare enum ProfileChangeEventType {
|
||||
TRADER_SALES_SUM = "TraderSalesSum",
|
||||
TRADER_STANDING = "TraderStanding",
|
||||
PROFILE_LEVEL = "ProfileLevel",
|
||||
SKILL_POINTS = "SkillPoints",
|
||||
EXAMINE_ALL_ITEMS = "ExamineAllItems",
|
||||
UNLOCK_TRADER = "UnlockTrader"
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ export declare class FenceService {
|
||||
protected fenceDiscountAssort: ITraderAssort;
|
||||
/** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */
|
||||
protected desiredAssortCounts: IFenceAssortGenerationValues;
|
||||
protected fenceItemUpdCompareProperties: Set<string>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Replace main fence assort with new assort
|
||||
@ -73,6 +74,26 @@ export declare class FenceService {
|
||||
* @returns ITraderAssort
|
||||
*/
|
||||
getFenceAssorts(pmcProfile: IPmcData): ITraderAssort;
|
||||
/**
|
||||
* Adds to fence assort a single item (with its children)
|
||||
* @param items the items to add with all its childrens
|
||||
* @param mainItem the most parent item of the array
|
||||
*/
|
||||
addItemsToFenceAssort(items: Item[], mainItem: Item): void;
|
||||
/**
|
||||
* Calculates the overall price for an item (with all its children)
|
||||
* @param itemTpl the item tpl to calculate the fence price for
|
||||
* @param items the items (with its children) to calculate fence price for
|
||||
* @returns the fence price of the item
|
||||
*/
|
||||
getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
/**
|
||||
* Calculate the overall price for an ammo box, where only one item is
|
||||
* the ammo box itself and every other items are the bullets in that box
|
||||
* @param items the ammo box (and all its children ammo items)
|
||||
* @returns the price of the ammo box
|
||||
*/
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Adjust all items contained inside an assort by a multiplier
|
||||
* @param assort (clone)Assort that contains items with prices to adjust
|
||||
|
@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
||||
import { Traders } from "@spt-aki/models/enums/Traders";
|
||||
import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
@ -55,7 +55,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: any): void;
|
||||
sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void;
|
||||
/**
|
||||
* Send a message from SYSTEM to the player with or without items with localised text
|
||||
* @param sessionId The session ID to send the message to
|
||||
@ -63,7 +63,7 @@ export declare class MailSendService {
|
||||
* @param items Optional items to send to player
|
||||
* @param maxStorageTimeSeconds Optional time to collect items before they expire
|
||||
*/
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void;
|
||||
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void;
|
||||
/**
|
||||
* Send a USER message to a player with or without items
|
||||
* @param sessionId The session ID to send the message to
|
||||
|
11
TypeScript/14AfterDBLoadHook/types/utils/CompareUtil.d.ts
vendored
Normal file
11
TypeScript/14AfterDBLoadHook/types/utils/CompareUtil.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare class CompareUtil {
|
||||
private static typesToCheckAgainst;
|
||||
/**
|
||||
* This function does an object comparison, equivalent to applying reflections
|
||||
* and scanning for all possible properties including arrays.
|
||||
* @param v1 value 1 to compare
|
||||
* @param v2 value 2 to compare
|
||||
* @returns true if equal, false if not
|
||||
*/
|
||||
recursiveCompare(v1: any, v2: any): boolean;
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper";
|
||||
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
|
||||
export declare class RagfairOfferHolder {
|
||||
protected maxOffersPerTemplate: number;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected offersById: Map<string, IRagfairOffer>;
|
||||
protected offersByTemplate: Map<string, Map<string, IRagfairOffer>>;
|
||||
protected offersByTrader: Map<string, Map<string, IRagfairOffer>>;
|
||||
constructor();
|
||||
constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper);
|
||||
getOfferById(id: string): IRagfairOffer;
|
||||
getOffersByTemplate(templateId: string): Array<IRagfairOffer>;
|
||||
getOffersByTrader(traderId: string): Array<IRagfairOffer>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DialogueController } from "@spt-aki/controllers/DialogueController";
|
||||
import { OnUpdate } from "@spt-aki/di/OnUpdate";
|
||||
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
|
||||
@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate {
|
||||
* Handle client/friend/request/send
|
||||
*/
|
||||
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||
/**
|
||||
* Handle client/friend/request/accept-all
|
||||
*/
|
||||
acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/friend/request/accept
|
||||
*/
|
||||
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/decline
|
||||
*/
|
||||
declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/cancel
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ export declare class BotLootGenerator {
|
||||
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @param isPmc Is bot being generated for a pmc
|
||||
*/
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||
protected addLootFromPool(pool: Record<string, number>, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set<string>): void;
|
||||
protected createWalletLoot(walletId: string): Item[][];
|
||||
/**
|
||||
* Some items need child items to function, add them to the itemToAddChildrenTo array
|
||||
@ -101,7 +101,7 @@ export declare class BotLootGenerator {
|
||||
* @param botRole bots role .e.g. pmcBot
|
||||
* @param isPmc are we generating for a pmc
|
||||
*/
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set<string>): void;
|
||||
/**
|
||||
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||
* All values are set to 0
|
||||
|
@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { FenceService } from "@spt-aki/services/FenceService";
|
||||
import { ItemFilterService } from "@spt-aki/services/ItemFilterService";
|
||||
import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService";
|
||||
import { HashUtil } from "@spt-aki/utils/HashUtil";
|
||||
@ -22,8 +23,9 @@ export declare class FenceBaseAssortGenerator {
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceService: FenceService;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService);
|
||||
/**
|
||||
* Create base fence assorts dynamically and store in memory
|
||||
*/
|
||||
@ -40,8 +42,6 @@ export declare class FenceBaseAssortGenerator {
|
||||
* @returns Penetration power of passed in item, null if it doesnt have a power
|
||||
*/
|
||||
protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number;
|
||||
protected getItemPrice(itemTpl: string, items: Item[]): number;
|
||||
protected getAmmoBoxPrice(items: Item[]): number;
|
||||
/**
|
||||
* Add soft inserts + armor plates to an armor
|
||||
* @param armor Armor item array to add mods into
|
||||
|
@ -92,7 +92,7 @@ export declare class BotGeneratorHelper {
|
||||
* @param inventory Inventory to add item+children into
|
||||
* @returns ItemAddedResult result object
|
||||
*/
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
|
||||
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set<string>): ItemAddedResult;
|
||||
/**
|
||||
* Is the provided item allowed inside a container
|
||||
* @param slotGrid Items sub-grid we want to place item inside
|
||||
|
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