Merge pull request '375' (#21) from 375 into master

Reviewed-on: #21
This commit is contained in:
chomp 2023-12-17 19:40:38 +00:00
commit 3e96b37c39
779 changed files with 3660 additions and 2248 deletions

View File

@ -1,4 +1,4 @@
# Mod examples for v3.7.4
# Mod examples for v3.7.5
A collection of example mods that perform typical actions in SPT

View File

@ -12,7 +12,7 @@ export declare class BundleCallbacks {
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
/**
* Handle singleplayer/bundles
*/

View File

@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
declare class GameCallbacks implements OnLoad {
export declare class GameCallbacks implements OnLoad {
protected httpResponse: HttpResponseUtil;
protected watermark: Watermark;
protected saveServer: SaveServer;
@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad {
*/
getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any;
}
export { GameCallbacks };

View File

@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
export declare class InventoryCallbacks {
protected inventoryController: InventoryController;
@ -46,4 +47,5 @@ export declare class InventoryCallbacks {
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle OpenRandomLootContainer */
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
}

View File

@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
declare class LauncherCallbacks {
export declare class LauncherCallbacks {
protected httpResponse: HttpResponseUtil;
protected launcherController: LauncherController;
protected saveServer: SaveServer;
@ -27,4 +27,3 @@ declare class LauncherCallbacks {
getLoadedServerMods(): string;
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
}
export { LauncherCallbacks };

View File

@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
declare class ModCallbacks implements OnLoad {
export declare class ModCallbacks implements OnLoad {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad {
onLoad(): Promise<void>;
getRoute(): string;
}
export { ModCallbacks };

View File

@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PlayerService } from "@spt-aki/services/PlayerService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
@ -49,10 +51,11 @@ export declare class InventoryController {
protected profileHelper: ProfileHelper;
protected paymentHelper: PaymentHelper;
protected localisationService: LocalisationService;
protected playerService: PlayerService;
protected lootGenerator: LootGenerator;
protected eventOutputHolder: EventOutputHolder;
protected httpResponseUtil: HttpResponseUtil;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
/**
* Move Item
* change location of item with parentId and slotId
@ -162,6 +165,7 @@ export declare class InventoryController {
* @returns response
*/
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void;
/**
* Get the tplid of an item from the examine request object
* @param body response request
@ -217,4 +221,5 @@ export declare class InventoryController {
* @returns IItemEventRouterResponse
*/
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
}

View File

@ -84,7 +84,7 @@ export declare class RagfairController {
* @param offers ragfair offers to get categories for
* @returns record with tpls + counts
*/
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Add Required offers to offers result
* @param searchRequest Client search request data

View File

@ -61,7 +61,9 @@ export declare class RepeatableQuestController {
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
* The new quests generated are again persisted in profile.RepeatableQuests
*
* @param {string} sessionId Player's session id
* @param {string} _info Request from client
* @param {string} sessionID Player's session id
*
* @returns {array} array of "repeatableQuestObjects" as descibed above
*/
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];

View File

@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
declare class TradeController {
export declare class TradeController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper;
@ -63,4 +63,3 @@ declare class TradeController {
protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
}
export { TradeController };

View File

@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator {
protected ragfairPriceService: RagfairPriceService;
protected localisationService: LocalisationService;
protected paymentHelper: PaymentHelper;
protected ragfairCategoriesService: RagfairCategoriesService;
protected fenceService: FenceService;
protected itemHelper: ItemHelper;
protected configServer: ConfigServer;
@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator {
tpl: string;
price: number;
}[];
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
/**
* Create a flea offer and store it in the Ragfair server offers array
* @param userID Owner of the offer

View File

@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper {
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
/**
* is the provided item allowed inside a container
* @param slot location item wants to be placed in
* @param itemTpl item being placed
* @returns true if allowed
* Is the provided item allowed inside a container
* @param slotGrid Items sub-grid we want to place item inside
* @param itemTpl Item tpl being placed
* @returns True if allowed
*/
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean;
}

View File

@ -1,3 +1,4 @@
import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
declare class LookupItem<T, I> {
@ -59,5 +60,6 @@ export declare class HandbookHelper {
* @returns currency count in desired type
*/
fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number;
getCategoryById(handbookId: string): Category;
}
export {};

View File

@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
import { ProfileHelper } from "./ProfileHelper";
export declare class InRaidHelper {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected saveServer: SaveServer;
protected jsonUtil: JsonUtil;
protected itemHelper: ItemHelper;
@ -31,7 +33,7 @@ export declare class InRaidHelper {
protected configServer: ConfigServer;
protected lostOnDeathConfig: ILostOnDeathConfig;
protected inRaidConfig: IInRaidConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer);
/**
* Lookup quest item loss from lostOnDeath config
* @returns True if items should be removed from inventory
@ -60,7 +62,6 @@ export declare class InRaidHelper {
* Reset a profile to a baseline, used post-raid
* Reset points earned during session property
* Increment exp
* Remove Labs keycard
* @param profileData Profile to update
* @param saveProgressRequest post raid save data request data
* @param sessionID Session id
@ -89,13 +90,13 @@ export declare class InRaidHelper {
*/
updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void;
/**
* Look for quests with status = fail that were not failed pre-raid and run the failQuest() function
* Look for quests with a status different from what it began the raid with
* @param sessionId Player id
* @param pmcData Player profile
* @param preRaidQuests Quests prior to starting raid
* @param postRaidProfile Profile sent by client
* @param postRaidProfile Profile sent by client with post-raid quests
*/
protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void;
protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void;
/**
* Take body part effects from client profile and apply to server profile
* @param saveProgressRequest post-raid request

View File

@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
declare class ItemHelper {
export declare class ItemHelper {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected jsonUtil: JsonUtil;
@ -355,4 +355,4 @@ declare namespace ItemHelper {
height: number;
}
}
export { ItemHelper };
export {};

View File

@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -30,14 +29,19 @@ export declare class RagfairHelper {
* @returns string
*/
getCurrencyTag(currency: string): string;
filterCategories(sessionID: string, info: ISearchRequestData): string[];
filterCategories(sessionID: string, request: ISearchRequestData): string[];
getDisplayableAssorts(sessionID: string): Record<string, ITraderAssort>;
protected getCategoryList(handbookId: string): string[];
countCategories(result: IGetOffersResult): void;
/**
* Merges Root Items
* Ragfair allows abnormally large stacks.
*/
mergeStackable(items: Item[]): Item[];
/**
* Return the symbol for a currency
* e.g. 5449016a4bdc2d6f028b456f return
* @param currencyTpl currency to get symbol for
* @returns symbol of currency
*/
getCurrencySymbol(currencyTpl: string): string;
}

View File

@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class RagfairSellHelper {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
/**
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price
* @param averageOfferPriceRub Price of average offer in roubles
@ -19,13 +21,6 @@ export declare class RagfairSellHelper {
* @returns percent value
*/
calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number;
/**
* Get percent chance to sell an item when price is below items average listing price
* @param playerListedPriceRub Price player listed item for in roubles
* @param averageOfferPriceRub Price of average offer in roubles
* @returns percent value
*/
protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number;
/**
* Get array of item count and sell time (empty array = no sell)
* @param sellChancePercent chance item will sell

View File

@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil";
* Helper class for common ragfair server actions
*/
export declare class RagfairServerHelper {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil;
@ -38,7 +40,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string;
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* Is item valid / on blacklist / quest item
* @param itemDetails
@ -76,14 +78,29 @@ export declare class RagfairServerHelper {
*/
getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
getPresetItems(item: any): Item[];
/**
* Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item
* @returns Array of weapon and its children
*/
getPresetItems(item: Item): Item[];
/**
* Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json
* @param item Preset item
* @returns
*/
getPresetItemsByTpl(item: Item): Item[];
/**
* Generate new unique ids for the children while preserving hierarchy
* @param item base item
* @param preset
* Generate new unique ids for child items while preserving hierarchy
* @param rootItem Base/primary item of preset
* @param preset Primary item + children of primary item
* @returns Item array with new IDs
*/
reparentPresets(item: Item, preset: Item[]): Item[];
reparentPresets(rootItem: Item, preset: Item[]): Item[];
}

View File

@ -25,12 +25,22 @@ export declare class RepairHelper {
* @param applyMaxDurabilityDegradation should item have max durability reduced
*/
updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void;
protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
/**
* Is the supplied tpl a weapon
* @param tpl tplId to check is a weapon
* @returns true if tpl is a weapon
* Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material
* @param armorMaterial What material is the armor being repaired made of
* @param isRepairKit Was a repair kit used
* @param armorMax Max amount of durability item can have
* @param traderQualityMultipler Different traders produce different loss values
* @returns Amount to reduce max durability by
*/
isWeaponTemplate(tpl: string): boolean;
protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
/**
* Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount
* @param itemProps Weapon properties
* @param isRepairKit Was a repair kit used
* @param weaponMax ax amount of durability item can have
* @param traderQualityMultipler Different traders produce different loss values
* @returns Amount to reduce max durability by
*/
protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
}

View File

@ -9,5 +9,10 @@ export interface OwnerInventoryItems {
export declare class SecureContainerHelper {
protected itemHelper: ItemHelper;
constructor(itemHelper: ItemHelper);
/**
* Get an array of the item IDs (NOT tpls) inside a secure container
* @param items Inventory items to look for secure container in
* @returns Array of ids
*/
getSecureContainerItems(items: Item[]): string[];
}

View File

@ -53,5 +53,11 @@ export declare class TradeHelper {
* @param itemsPurchasedCount number of items being bought
*/
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
/**
* Traders allow a limited number of purchases per refresh cycle (default 60 mins)
* @param assortBeingPurchased the item from trader being bought
* @param assortId Id of assort being purchased
* @param count How many are being bought
*/
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
}

View File

@ -44,6 +44,7 @@ export declare class TraderAssortHelper {
* Filter out assorts not unlocked due to level OR quest completion
* @param sessionId session id
* @param traderId traders id
* @param flea Should assorts player hasn't unlocked be returned - default false
* @returns a traders' assorts
*/
getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;

View File

@ -63,6 +63,12 @@ export declare class TraderHelper {
* @param traderID trader id to reset
*/
resetTrader(sessionID: string, traderID: string): void;
/**
* Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc)
* @param traderId Trader id to get standing for
* @param rawProfileTemplate Raw profile from profiles.json to look up standing from
* @returns Standing value
*/
protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number;
/**
* Alter a traders unlocked status

View File

@ -8,6 +8,11 @@ export declare class WeightedRandomHelper {
getWeightedInventoryItem(itemArray: {
[tplId: string]: unknown;
} | ArrayLike<unknown>): string;
/**
* Choos an item from the passed in array based on the weightings of each
* @param itemArray Items and weights to use
* @returns Chosen item from array
*/
getWeightedValue<T>(itemArray: {
[key: string]: unknown;
} | ArrayLike<unknown>): T;

View File

@ -0,0 +1,9 @@
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData {
Action: "RedeemProfileReward";
events: IRedeemProfileRequestEvent[];
}
export interface IRedeemProfileRequestEvent {
MessageId: string;
EventId: string;
}

View File

@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType";
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
import { MessageType } from "@spt-aki/models/enums/MessageType";
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
export interface IAkiProfile {
info: Info;
characters: Characters;
@ -95,7 +96,7 @@ export interface Message {
items?: MessageItems;
maxStorageTime?: number;
systemData?: ISystemData;
profileChangeEvents?: any[];
profileChangeEvents?: IProfileChangeEvent[];
}
export interface MessagePreview {
uid: string;

View File

@ -21,7 +21,10 @@ export declare enum Ammo762x54 {
PS_GZH = "59e77a2386f7742ee578960a",
T46M_GZH = "5e023cf8186a883be655e54f",
BT_GZH = "5e023d34e8a400319a28ed44",
BS_GZH = "5e023d48186a883be655e551"
BS_GZH = "5e023d48186a883be655e551",
FMJ = "64b8f7968532cf95ee0a0dbf",
SP_BT = "64b8f7b5389d7ffd620ccba2",
HP_BT = "64b8f7c241772715af0f9c3d"
}
export declare enum Ammo86x70 {
TAC_X = "5fc382b6d6fa9c00c571bbc3",
@ -33,7 +36,8 @@ export declare enum Ammo46x30 {
AP_SX = "5ba26835d4351e0035628ff5",
ACTION_SX = "5ba26812d4351e003201fef1",
FMJ_SX = "5ba2678ad4351e44f824b344",
SUBSONIC_SX = "5ba26844d4351e00334c9475"
SUBSONIC_SX = "5ba26844d4351e00334c9475",
JSP_SX = "64b6979341772715af0f9c39"
}
export declare enum Ammo57x28 {
SS198LF = "5cc80f79e4a949033c7343b2",
@ -77,7 +81,8 @@ export declare enum Ammo9x19 {
AP_63 = "5c925fa22e221601da359b7b",
LUGER_CCI = "5a3c16fe86f77452b62de32a",
PBP_GZH = "5efb0da7a29a85116f6ea05f",
QUAKEMAKER = "5efb0e16aeb21837e749c7ff"
QUAKEMAKER = "5efb0e16aeb21837e749c7ff",
FMJ_M882 = "64b7bbb74b75259c590fa897"
}
export declare enum Ammo9x21 {
P_GZH = "5a26abfac4a28232980eabff",
@ -131,7 +136,8 @@ export declare enum Ammo762x35 {
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
AP = "5fd20ff893a8961fc660a954",
V_MAX = "6196364158ef8c428c287d9f",
WHISPER = "6196365d58ef8c428c287da1"
WHISPER = "6196365d58ef8c428c287da1",
CBJ = "64b8725c4b75259c590fa899"
}
export declare enum Ammo762x39 {
PS_GZH = "5656d7c34bdc2d9d198b4587",
@ -139,7 +145,10 @@ export declare enum Ammo762x39 {
US_GZH = "59e4d24686f7741776641ac7",
T45M1_GZH = "59e4cf5286f7741778269d8a",
BP_GZH = "59e0d99486f7744a32234762",
MAI_AP = "601aa3d2b2bcb34913271e6d"
MAI_AP = "601aa3d2b2bcb34913271e6d",
PP_GZH = "64b7af434b75259c590fa893",
SP = "64b7af734b75259c590fa895",
FMJ = "64b7af5a8532cf95ee0a0dbd"
}
export declare enum Ammo9x39 {
SP5_GS = "57a0dfb82459774d3078b56c",
@ -175,7 +184,8 @@ export declare enum Ammo12Gauge {
GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde",
SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845",
COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5",
LEAD_SLUG = "58820d1224597753c90aeb13"
LEAD_SLUG = "58820d1224597753c90aeb13",
PIRANHA = "64b8ee384b75259c590fa89b"
}
export declare enum Ammo20Gauge {
BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b",

View File

@ -2,5 +2,6 @@ export declare enum ItemAddedResult {
UNKNOWN = -1,
SUCCESS = 1,
NO_SPACE = 2,
NO_CONTAINERS = 3
NO_CONTAINERS = 3,
INCOMPATIBLE_ITEM = 4
}

View File

@ -22,5 +22,6 @@ export declare enum ItemEventActions {
REMOVE_WEAPON_BUILD = "RemoveWeaponBuild",
REMOVE_BUILD = "RemoveBuild",
SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild",
REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild"
REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild",
REDEEM_PROFILE_REWARD = "RedeemProfileReward"
}

View File

@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType";
import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType";
import { Traders } from "@spt-aki/models/enums/Traders";
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig";
import { IProfileChangeEvent } from "../dialog/ISendMessageDetails";
export interface IGiftsConfig extends IBaseConfig {
kind: "aki-gifts";
gifts: Record<string, Gift>;
@ -25,4 +26,6 @@ export interface Gift {
timestampToSend?: number;
associatedEvent: SeasonalEventType;
collectionTimeHours: number;
/** Optional, can be used to change profile settings like level/skills */
profileChangeEvents?: IProfileChangeEvent[];
}

View File

@ -19,15 +19,18 @@ export interface Sell {
time: Time;
/** Player offer reputation gain/loss settings */
reputation: Reputation;
/** How many hours are simulated to figure out if player offer was sold */
simulatedSellHours: number;
/**Seconds from clicking remove to remove offer from market */
expireSeconds: number;
}
export interface Chance {
/** Base chance percent to sell an item */
base: number;
overpriced: number;
underpriced: number;
/** Value to multiply the sell chance by */
sellMultiplier: number;
/** Max possible sell chance % for a player listed offer */
maxSellChancePercent: number;
/** Min possible sell chance % for a player listed offer */
minSellChancePercent: number;
}
export interface Time extends MinMax {
base: number;
@ -129,7 +132,7 @@ export interface Blacklist {
enableBsgList: boolean;
/** Should quest items be blacklisted from flea */
enableQuestList: boolean;
/** Should trader items that are blacklisted by bsg */
/** Should trader items that are blacklisted by bsg be listed on flea */
traderItems: boolean;
}
export interface IUnreasonableModPrices {

View File

@ -25,6 +25,12 @@ export interface ISendMessageDetails {
systemData?: ISystemData;
/** Optional - Used by ragfair messages */
ragfairDetails?: MessageContentRagfair;
/** Optional - Usage not known, unsure of purpose, even dumps dont have it */
profileChangeEvents?: any[];
/** OPTIONAL - allows modification of profile settings via mail */
profileChangeEvents?: IProfileChangeEvent[];
}
export interface IProfileChangeEvent {
_id: string;
Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader";
value: number;
entity?: string;
}

View File

@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator
import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
@ -27,9 +28,8 @@ export declare class RagfairServer {
* Get traders who need to be periodically refreshed
* @returns string array of traders
*/
protected getUpdateableTraders(): string[];
getAllCategories(): Record<string, number>;
getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>;
getUpdateableTraders(): string[];
getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Disable/Hide an offer from flea
* @param offerId

View File

@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
export declare class WebSocketServer {
protected logger: ILogger;
protected randomUtil: RandomUtil;
@ -16,7 +17,8 @@ export declare class WebSocketServer {
protected localisationService: LocalisationService;
protected jsonUtil: JsonUtil;
protected httpServerHelper: HttpServerHelper;
constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper);
protected profileHelper: ProfileHelper;
constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper);
protected httpConfig: IHttpConfig;
protected defaultNotification: INotification;
protected webSockets: Record<string, WebSocket.WebSocket>;

View File

@ -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[], maxStorageTimeSeconds?: any): void;
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void;
/**
* Send a USER message to a player with or without items
* @param sessionId The session ID to send the message to

View File

@ -1,40 +1,17 @@
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
export declare class RagfairCategoriesService {
protected logger: ILogger;
protected categories: Record<string, number>;
constructor(logger: ILogger);
protected paymentHelper: PaymentHelper;
constructor(logger: ILogger, paymentHelper: PaymentHelper);
/**
* Get all flea categories and their count of offers
* @returns item categories and count
* Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy
* @param offers All offers in flea
* @param searchRequestData Search criteria requested
* @param fleaUnlocked Can player see full flea yet (level 15 by default)
* @returns KVP of item tpls + count of offers
*/
getAllCategories(): Record<string, number>;
/**
* With the supplied items, get custom categories
* @returns a custom list of categories
*/
getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>;
/**
* Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count
* @param offers ragfair offers
* @returns categories and count
*/
protected processOffersIntoCategories(offers: IRagfairOffer[]): Record<string, number>;
/**
* Increment or decrement a category array
* @param offer Offer to process
* @param categories Categories to update
* @param increment (Optional) Should item be incremented or decremented
*/
protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record<string, number>, increment?: boolean): void;
/**
* Increase category count by 1
* @param offer
*/
incrementCategory(offer: IRagfairOffer): void;
/**
* Reduce category count by 1
* @param offer
*/
decrementCategory(offer: IRagfairOffer): void;
getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record<string, number>;
}

View File

@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
@ -20,7 +19,6 @@ export declare class RagfairOfferService {
protected databaseServer: DatabaseServer;
protected saveServer: SaveServer;
protected ragfairServerHelper: RagfairServerHelper;
protected ragfairCategoriesService: RagfairCategoriesService;
protected profileHelper: ProfileHelper;
protected eventOutputHolder: EventOutputHolder;
protected httpResponse: HttpResponseUtil;
@ -30,7 +28,7 @@ export declare class RagfairOfferService {
protected expiredOffers: Record<string, IRagfairOffer>;
protected ragfairConfig: IRagfairConfig;
protected ragfairOfferHandler: RagfairOfferHolder;
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all offers
* @returns IRagfairOffer array

View File

@ -56,6 +56,7 @@ export declare class RepairService {
* @param pmcData Profile to add points to
*/
addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void;
protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number;
/**
* Return an appromixation of the amount of skill points live would return for the given repairDetails
* @param repairDetails the repair details to calculate skill points for

View File

@ -12,7 +12,7 @@ export declare class BundleCallbacks {
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
/**
* Handle singleplayer/bundles
*/

View File

@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
declare class GameCallbacks implements OnLoad {
export declare class GameCallbacks implements OnLoad {
protected httpResponse: HttpResponseUtil;
protected watermark: Watermark;
protected saveServer: SaveServer;
@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad {
*/
getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any;
}
export { GameCallbacks };

View File

@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
export declare class InventoryCallbacks {
protected inventoryController: InventoryController;
@ -46,4 +47,5 @@ export declare class InventoryCallbacks {
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle OpenRandomLootContainer */
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
}

View File

@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
declare class LauncherCallbacks {
export declare class LauncherCallbacks {
protected httpResponse: HttpResponseUtil;
protected launcherController: LauncherController;
protected saveServer: SaveServer;
@ -27,4 +27,3 @@ declare class LauncherCallbacks {
getLoadedServerMods(): string;
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
}
export { LauncherCallbacks };

View File

@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
declare class ModCallbacks implements OnLoad {
export declare class ModCallbacks implements OnLoad {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad {
onLoad(): Promise<void>;
getRoute(): string;
}
export { ModCallbacks };

View File

@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PlayerService } from "@spt-aki/services/PlayerService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
@ -49,10 +51,11 @@ export declare class InventoryController {
protected profileHelper: ProfileHelper;
protected paymentHelper: PaymentHelper;
protected localisationService: LocalisationService;
protected playerService: PlayerService;
protected lootGenerator: LootGenerator;
protected eventOutputHolder: EventOutputHolder;
protected httpResponseUtil: HttpResponseUtil;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
/**
* Move Item
* change location of item with parentId and slotId
@ -162,6 +165,7 @@ export declare class InventoryController {
* @returns response
*/
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void;
/**
* Get the tplid of an item from the examine request object
* @param body response request
@ -217,4 +221,5 @@ export declare class InventoryController {
* @returns IItemEventRouterResponse
*/
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
}

View File

@ -84,7 +84,7 @@ export declare class RagfairController {
* @param offers ragfair offers to get categories for
* @returns record with tpls + counts
*/
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Add Required offers to offers result
* @param searchRequest Client search request data

View File

@ -61,7 +61,9 @@ export declare class RepeatableQuestController {
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
* The new quests generated are again persisted in profile.RepeatableQuests
*
* @param {string} sessionId Player's session id
* @param {string} _info Request from client
* @param {string} sessionID Player's session id
*
* @returns {array} array of "repeatableQuestObjects" as descibed above
*/
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];

View File

@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
declare class TradeController {
export declare class TradeController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper;
@ -63,4 +63,3 @@ declare class TradeController {
protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
}
export { TradeController };

View File

@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator {
protected ragfairPriceService: RagfairPriceService;
protected localisationService: LocalisationService;
protected paymentHelper: PaymentHelper;
protected ragfairCategoriesService: RagfairCategoriesService;
protected fenceService: FenceService;
protected itemHelper: ItemHelper;
protected configServer: ConfigServer;
@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator {
tpl: string;
price: number;
}[];
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
/**
* Create a flea offer and store it in the Ragfair server offers array
* @param userID Owner of the offer

View File

@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper {
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
/**
* is the provided item allowed inside a container
* @param slot location item wants to be placed in
* @param itemTpl item being placed
* @returns true if allowed
* Is the provided item allowed inside a container
* @param slotGrid Items sub-grid we want to place item inside
* @param itemTpl Item tpl being placed
* @returns True if allowed
*/
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean;
}

View File

@ -1,3 +1,4 @@
import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
declare class LookupItem<T, I> {
@ -59,5 +60,6 @@ export declare class HandbookHelper {
* @returns currency count in desired type
*/
fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number;
getCategoryById(handbookId: string): Category;
}
export {};

View File

@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
import { ProfileHelper } from "./ProfileHelper";
export declare class InRaidHelper {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected saveServer: SaveServer;
protected jsonUtil: JsonUtil;
protected itemHelper: ItemHelper;
@ -31,7 +33,7 @@ export declare class InRaidHelper {
protected configServer: ConfigServer;
protected lostOnDeathConfig: ILostOnDeathConfig;
protected inRaidConfig: IInRaidConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer);
/**
* Lookup quest item loss from lostOnDeath config
* @returns True if items should be removed from inventory
@ -60,7 +62,6 @@ export declare class InRaidHelper {
* Reset a profile to a baseline, used post-raid
* Reset points earned during session property
* Increment exp
* Remove Labs keycard
* @param profileData Profile to update
* @param saveProgressRequest post raid save data request data
* @param sessionID Session id
@ -89,13 +90,13 @@ export declare class InRaidHelper {
*/
updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void;
/**
* Look for quests with status = fail that were not failed pre-raid and run the failQuest() function
* Look for quests with a status different from what it began the raid with
* @param sessionId Player id
* @param pmcData Player profile
* @param preRaidQuests Quests prior to starting raid
* @param postRaidProfile Profile sent by client
* @param postRaidProfile Profile sent by client with post-raid quests
*/
protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void;
protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void;
/**
* Take body part effects from client profile and apply to server profile
* @param saveProgressRequest post-raid request

View File

@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
declare class ItemHelper {
export declare class ItemHelper {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected jsonUtil: JsonUtil;
@ -355,4 +355,4 @@ declare namespace ItemHelper {
height: number;
}
}
export { ItemHelper };
export {};

View File

@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -30,14 +29,19 @@ export declare class RagfairHelper {
* @returns string
*/
getCurrencyTag(currency: string): string;
filterCategories(sessionID: string, info: ISearchRequestData): string[];
filterCategories(sessionID: string, request: ISearchRequestData): string[];
getDisplayableAssorts(sessionID: string): Record<string, ITraderAssort>;
protected getCategoryList(handbookId: string): string[];
countCategories(result: IGetOffersResult): void;
/**
* Merges Root Items
* Ragfair allows abnormally large stacks.
*/
mergeStackable(items: Item[]): Item[];
/**
* Return the symbol for a currency
* e.g. 5449016a4bdc2d6f028b456f return
* @param currencyTpl currency to get symbol for
* @returns symbol of currency
*/
getCurrencySymbol(currencyTpl: string): string;
}

View File

@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class RagfairSellHelper {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
/**
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price
* @param averageOfferPriceRub Price of average offer in roubles
@ -19,13 +21,6 @@ export declare class RagfairSellHelper {
* @returns percent value
*/
calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number;
/**
* Get percent chance to sell an item when price is below items average listing price
* @param playerListedPriceRub Price player listed item for in roubles
* @param averageOfferPriceRub Price of average offer in roubles
* @returns percent value
*/
protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number;
/**
* Get array of item count and sell time (empty array = no sell)
* @param sellChancePercent chance item will sell

View File

@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil";
* Helper class for common ragfair server actions
*/
export declare class RagfairServerHelper {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil;
@ -38,7 +40,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string;
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* Is item valid / on blacklist / quest item
* @param itemDetails
@ -76,14 +78,29 @@ export declare class RagfairServerHelper {
*/
getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
getPresetItems(item: any): Item[];
/**
* Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item
* @returns Array of weapon and its children
*/
getPresetItems(item: Item): Item[];
/**
* Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json
* @param item Preset item
* @returns
*/
getPresetItemsByTpl(item: Item): Item[];
/**
* Generate new unique ids for the children while preserving hierarchy
* @param item base item
* @param preset
* Generate new unique ids for child items while preserving hierarchy
* @param rootItem Base/primary item of preset
* @param preset Primary item + children of primary item
* @returns Item array with new IDs
*/
reparentPresets(item: Item, preset: Item[]): Item[];
reparentPresets(rootItem: Item, preset: Item[]): Item[];
}

View File

@ -25,12 +25,22 @@ export declare class RepairHelper {
* @param applyMaxDurabilityDegradation should item have max durability reduced
*/
updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void;
protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
/**
* Is the supplied tpl a weapon
* @param tpl tplId to check is a weapon
* @returns true if tpl is a weapon
* Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material
* @param armorMaterial What material is the armor being repaired made of
* @param isRepairKit Was a repair kit used
* @param armorMax Max amount of durability item can have
* @param traderQualityMultipler Different traders produce different loss values
* @returns Amount to reduce max durability by
*/
isWeaponTemplate(tpl: string): boolean;
protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
/**
* Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount
* @param itemProps Weapon properties
* @param isRepairKit Was a repair kit used
* @param weaponMax ax amount of durability item can have
* @param traderQualityMultipler Different traders produce different loss values
* @returns Amount to reduce max durability by
*/
protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
}

View File

@ -9,5 +9,10 @@ export interface OwnerInventoryItems {
export declare class SecureContainerHelper {
protected itemHelper: ItemHelper;
constructor(itemHelper: ItemHelper);
/**
* Get an array of the item IDs (NOT tpls) inside a secure container
* @param items Inventory items to look for secure container in
* @returns Array of ids
*/
getSecureContainerItems(items: Item[]): string[];
}

View File

@ -53,5 +53,11 @@ export declare class TradeHelper {
* @param itemsPurchasedCount number of items being bought
*/
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
/**
* Traders allow a limited number of purchases per refresh cycle (default 60 mins)
* @param assortBeingPurchased the item from trader being bought
* @param assortId Id of assort being purchased
* @param count How many are being bought
*/
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
}

View File

@ -44,6 +44,7 @@ export declare class TraderAssortHelper {
* Filter out assorts not unlocked due to level OR quest completion
* @param sessionId session id
* @param traderId traders id
* @param flea Should assorts player hasn't unlocked be returned - default false
* @returns a traders' assorts
*/
getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;

View File

@ -63,6 +63,12 @@ export declare class TraderHelper {
* @param traderID trader id to reset
*/
resetTrader(sessionID: string, traderID: string): void;
/**
* Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc)
* @param traderId Trader id to get standing for
* @param rawProfileTemplate Raw profile from profiles.json to look up standing from
* @returns Standing value
*/
protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number;
/**
* Alter a traders unlocked status

View File

@ -8,6 +8,11 @@ export declare class WeightedRandomHelper {
getWeightedInventoryItem(itemArray: {
[tplId: string]: unknown;
} | ArrayLike<unknown>): string;
/**
* Choos an item from the passed in array based on the weightings of each
* @param itemArray Items and weights to use
* @returns Chosen item from array
*/
getWeightedValue<T>(itemArray: {
[key: string]: unknown;
} | ArrayLike<unknown>): T;

View File

@ -0,0 +1,9 @@
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData {
Action: "RedeemProfileReward";
events: IRedeemProfileRequestEvent[];
}
export interface IRedeemProfileRequestEvent {
MessageId: string;
EventId: string;
}

View File

@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType";
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
import { MessageType } from "@spt-aki/models/enums/MessageType";
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
export interface IAkiProfile {
info: Info;
characters: Characters;
@ -95,7 +96,7 @@ export interface Message {
items?: MessageItems;
maxStorageTime?: number;
systemData?: ISystemData;
profileChangeEvents?: any[];
profileChangeEvents?: IProfileChangeEvent[];
}
export interface MessagePreview {
uid: string;

View File

@ -21,7 +21,10 @@ export declare enum Ammo762x54 {
PS_GZH = "59e77a2386f7742ee578960a",
T46M_GZH = "5e023cf8186a883be655e54f",
BT_GZH = "5e023d34e8a400319a28ed44",
BS_GZH = "5e023d48186a883be655e551"
BS_GZH = "5e023d48186a883be655e551",
FMJ = "64b8f7968532cf95ee0a0dbf",
SP_BT = "64b8f7b5389d7ffd620ccba2",
HP_BT = "64b8f7c241772715af0f9c3d"
}
export declare enum Ammo86x70 {
TAC_X = "5fc382b6d6fa9c00c571bbc3",
@ -33,7 +36,8 @@ export declare enum Ammo46x30 {
AP_SX = "5ba26835d4351e0035628ff5",
ACTION_SX = "5ba26812d4351e003201fef1",
FMJ_SX = "5ba2678ad4351e44f824b344",
SUBSONIC_SX = "5ba26844d4351e00334c9475"
SUBSONIC_SX = "5ba26844d4351e00334c9475",
JSP_SX = "64b6979341772715af0f9c39"
}
export declare enum Ammo57x28 {
SS198LF = "5cc80f79e4a949033c7343b2",
@ -77,7 +81,8 @@ export declare enum Ammo9x19 {
AP_63 = "5c925fa22e221601da359b7b",
LUGER_CCI = "5a3c16fe86f77452b62de32a",
PBP_GZH = "5efb0da7a29a85116f6ea05f",
QUAKEMAKER = "5efb0e16aeb21837e749c7ff"
QUAKEMAKER = "5efb0e16aeb21837e749c7ff",
FMJ_M882 = "64b7bbb74b75259c590fa897"
}
export declare enum Ammo9x21 {
P_GZH = "5a26abfac4a28232980eabff",
@ -131,7 +136,8 @@ export declare enum Ammo762x35 {
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
AP = "5fd20ff893a8961fc660a954",
V_MAX = "6196364158ef8c428c287d9f",
WHISPER = "6196365d58ef8c428c287da1"
WHISPER = "6196365d58ef8c428c287da1",
CBJ = "64b8725c4b75259c590fa899"
}
export declare enum Ammo762x39 {
PS_GZH = "5656d7c34bdc2d9d198b4587",
@ -139,7 +145,10 @@ export declare enum Ammo762x39 {
US_GZH = "59e4d24686f7741776641ac7",
T45M1_GZH = "59e4cf5286f7741778269d8a",
BP_GZH = "59e0d99486f7744a32234762",
MAI_AP = "601aa3d2b2bcb34913271e6d"
MAI_AP = "601aa3d2b2bcb34913271e6d",
PP_GZH = "64b7af434b75259c590fa893",
SP = "64b7af734b75259c590fa895",
FMJ = "64b7af5a8532cf95ee0a0dbd"
}
export declare enum Ammo9x39 {
SP5_GS = "57a0dfb82459774d3078b56c",
@ -175,7 +184,8 @@ export declare enum Ammo12Gauge {
GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde",
SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845",
COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5",
LEAD_SLUG = "58820d1224597753c90aeb13"
LEAD_SLUG = "58820d1224597753c90aeb13",
PIRANHA = "64b8ee384b75259c590fa89b"
}
export declare enum Ammo20Gauge {
BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b",

View File

@ -2,5 +2,6 @@ export declare enum ItemAddedResult {
UNKNOWN = -1,
SUCCESS = 1,
NO_SPACE = 2,
NO_CONTAINERS = 3
NO_CONTAINERS = 3,
INCOMPATIBLE_ITEM = 4
}

View File

@ -22,5 +22,6 @@ export declare enum ItemEventActions {
REMOVE_WEAPON_BUILD = "RemoveWeaponBuild",
REMOVE_BUILD = "RemoveBuild",
SAVE_EQUIPMENT_BUILD = "SaveEquipmentBuild",
REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild"
REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild",
REDEEM_PROFILE_REWARD = "RedeemProfileReward"
}

View File

@ -4,6 +4,7 @@ import { GiftSenderType } from "@spt-aki/models/enums/GiftSenderType";
import { SeasonalEventType } from "@spt-aki/models/enums/SeasonalEventType";
import { Traders } from "@spt-aki/models/enums/Traders";
import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig";
import { IProfileChangeEvent } from "../dialog/ISendMessageDetails";
export interface IGiftsConfig extends IBaseConfig {
kind: "aki-gifts";
gifts: Record<string, Gift>;
@ -25,4 +26,6 @@ export interface Gift {
timestampToSend?: number;
associatedEvent: SeasonalEventType;
collectionTimeHours: number;
/** Optional, can be used to change profile settings like level/skills */
profileChangeEvents?: IProfileChangeEvent[];
}

View File

@ -19,15 +19,18 @@ export interface Sell {
time: Time;
/** Player offer reputation gain/loss settings */
reputation: Reputation;
/** How many hours are simulated to figure out if player offer was sold */
simulatedSellHours: number;
/**Seconds from clicking remove to remove offer from market */
expireSeconds: number;
}
export interface Chance {
/** Base chance percent to sell an item */
base: number;
overpriced: number;
underpriced: number;
/** Value to multiply the sell chance by */
sellMultiplier: number;
/** Max possible sell chance % for a player listed offer */
maxSellChancePercent: number;
/** Min possible sell chance % for a player listed offer */
minSellChancePercent: number;
}
export interface Time extends MinMax {
base: number;
@ -129,7 +132,7 @@ export interface Blacklist {
enableBsgList: boolean;
/** Should quest items be blacklisted from flea */
enableQuestList: boolean;
/** Should trader items that are blacklisted by bsg */
/** Should trader items that are blacklisted by bsg be listed on flea */
traderItems: boolean;
}
export interface IUnreasonableModPrices {

View File

@ -25,6 +25,12 @@ export interface ISendMessageDetails {
systemData?: ISystemData;
/** Optional - Used by ragfair messages */
ragfairDetails?: MessageContentRagfair;
/** Optional - Usage not known, unsure of purpose, even dumps dont have it */
profileChangeEvents?: any[];
/** OPTIONAL - allows modification of profile settings via mail */
profileChangeEvents?: IProfileChangeEvent[];
}
export interface IProfileChangeEvent {
_id: string;
Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader";
value: number;
entity?: string;
}

View File

@ -2,6 +2,7 @@ import { RagfairOfferGenerator } from "@spt-aki/generators/RagfairOfferGenerator
import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
import { TraderHelper } from "@spt-aki/helpers/TraderHelper";
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
@ -27,9 +28,8 @@ export declare class RagfairServer {
* Get traders who need to be periodically refreshed
* @returns string array of traders
*/
protected getUpdateableTraders(): string[];
getAllCategories(): Record<string, number>;
getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>;
getUpdateableTraders(): string[];
getAllActiveCategories(fleaUnlocked: boolean, searchRequestData: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Disable/Hide an offer from flea
* @param offerId

View File

@ -9,6 +9,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
export declare class WebSocketServer {
protected logger: ILogger;
protected randomUtil: RandomUtil;
@ -16,7 +17,8 @@ export declare class WebSocketServer {
protected localisationService: LocalisationService;
protected jsonUtil: JsonUtil;
protected httpServerHelper: HttpServerHelper;
constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper);
protected profileHelper: ProfileHelper;
constructor(logger: ILogger, randomUtil: RandomUtil, configServer: ConfigServer, localisationService: LocalisationService, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper);
protected httpConfig: IHttpConfig;
protected defaultNotification: INotification;
protected webSockets: Record<string, WebSocket.WebSocket>;

View File

@ -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[], maxStorageTimeSeconds?: any): void;
sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: any[], maxStorageTimeSeconds?: any): void;
/**
* Send a USER message to a player with or without items
* @param sessionId The session ID to send the message to

View File

@ -1,40 +1,17 @@
import { PaymentHelper } from "@spt-aki/helpers/PaymentHelper";
import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
export declare class RagfairCategoriesService {
protected logger: ILogger;
protected categories: Record<string, number>;
constructor(logger: ILogger);
protected paymentHelper: PaymentHelper;
constructor(logger: ILogger, paymentHelper: PaymentHelper);
/**
* Get all flea categories and their count of offers
* @returns item categories and count
* Get a dictionary of each item the play can see in their flea menu, filtered by what is available for them to buy
* @param offers All offers in flea
* @param searchRequestData Search criteria requested
* @param fleaUnlocked Can player see full flea yet (level 15 by default)
* @returns KVP of item tpls + count of offers
*/
getAllCategories(): Record<string, number>;
/**
* With the supplied items, get custom categories
* @returns a custom list of categories
*/
getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>;
/**
* Take an array of ragfair offers and create a dictionary of items with thier corrisponding offer count
* @param offers ragfair offers
* @returns categories and count
*/
protected processOffersIntoCategories(offers: IRagfairOffer[]): Record<string, number>;
/**
* Increment or decrement a category array
* @param offer Offer to process
* @param categories Categories to update
* @param increment (Optional) Should item be incremented or decremented
*/
protected addOrIncrementCategory(offer: IRagfairOffer, categories: Record<string, number>, increment?: boolean): void;
/**
* Increase category count by 1
* @param offer
*/
incrementCategory(offer: IRagfairOffer): void;
/**
* Reduce category count by 1
* @param offer
*/
decrementCategory(offer: IRagfairOffer): void;
getCategoriesFromOffers(offers: IRagfairOffer[], searchRequestData: ISearchRequestData, fleaUnlocked: boolean): Record<string, number>;
}

View File

@ -10,7 +10,6 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { RagfairOfferHolder } from "@spt-aki/utils/RagfairOfferHolder";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
@ -20,7 +19,6 @@ export declare class RagfairOfferService {
protected databaseServer: DatabaseServer;
protected saveServer: SaveServer;
protected ragfairServerHelper: RagfairServerHelper;
protected ragfairCategoriesService: RagfairCategoriesService;
protected profileHelper: ProfileHelper;
protected eventOutputHolder: EventOutputHolder;
protected httpResponse: HttpResponseUtil;
@ -30,7 +28,7 @@ export declare class RagfairOfferService {
protected expiredOffers: Record<string, IRagfairOffer>;
protected ragfairConfig: IRagfairConfig;
protected ragfairOfferHandler: RagfairOfferHolder;
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all offers
* @returns IRagfairOffer array

View File

@ -56,6 +56,7 @@ export declare class RepairService {
* @param pmcData Profile to add points to
*/
addRepairSkillPoints(sessionId: string, repairDetails: RepairDetails, pmcData: IPmcData): void;
protected getIntellectGainedFromRepair(repairDetails: RepairDetails): number;
/**
* Return an appromixation of the amount of skill points live would return for the given repairDetails
* @param repairDetails the repair details to calculate skill points for

View File

@ -12,7 +12,7 @@ export declare class BundleCallbacks {
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
/**
* Handle singleplayer/bundles
*/

View File

@ -17,7 +17,7 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
declare class GameCallbacks implements OnLoad {
export declare class GameCallbacks implements OnLoad {
protected httpResponse: HttpResponseUtil;
protected watermark: Watermark;
protected saveServer: SaveServer;
@ -75,4 +75,3 @@ declare class GameCallbacks implements OnLoad {
*/
getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): any;
}
export { GameCallbacks };

View File

@ -17,6 +17,7 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
export declare class InventoryCallbacks {
protected inventoryController: InventoryController;
@ -46,4 +47,5 @@ export declare class InventoryCallbacks {
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle OpenRandomLootContainer */
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, body: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
}

View File

@ -7,7 +7,7 @@ import { IRemoveProfileData } from "@spt-aki/models/eft/launcher/IRemoveProfileD
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark";
declare class LauncherCallbacks {
export declare class LauncherCallbacks {
protected httpResponse: HttpResponseUtil;
protected launcherController: LauncherController;
protected saveServer: SaveServer;
@ -27,4 +27,3 @@ declare class LauncherCallbacks {
getLoadedServerMods(): string;
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
}
export { LauncherCallbacks };

View File

@ -6,7 +6,7 @@ import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
declare class ModCallbacks implements OnLoad {
export declare class ModCallbacks implements OnLoad {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
@ -18,4 +18,3 @@ declare class ModCallbacks implements OnLoad {
onLoad(): Promise<void>;
getRoute(): string;
}
export { ModCallbacks };

View File

@ -23,12 +23,14 @@ import { IInventoryTagRequestData } from "@spt-aki/models/eft/inventory/IInvento
import { IInventoryToggleRequestData } from "@spt-aki/models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "@spt-aki/models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "@spt-aki/models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IRedeemProfileRequestData } from "@spt-aki/models/eft/inventory/IRedeemProfileRequestData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { PlayerService } from "@spt-aki/services/PlayerService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
@ -49,10 +51,11 @@ export declare class InventoryController {
protected profileHelper: ProfileHelper;
protected paymentHelper: PaymentHelper;
protected localisationService: LocalisationService;
protected playerService: PlayerService;
protected lootGenerator: LootGenerator;
protected eventOutputHolder: EventOutputHolder;
protected httpResponseUtil: HttpResponseUtil;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, playerService: PlayerService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
/**
* Move Item
* change location of item with parentId and slotId
@ -162,6 +165,7 @@ export declare class InventoryController {
* @returns response
*/
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
protected flagItemsAsInspectedAndRewardXp(itemTpls: string[], pmcProfile: IPmcData): void;
/**
* Get the tplid of an item from the examine request object
* @param body response request
@ -217,4 +221,5 @@ export declare class InventoryController {
* @returns IItemEventRouterResponse
*/
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): IItemEventRouterResponse;
}

View File

@ -84,7 +84,7 @@ export declare class RagfairController {
* @param offers ragfair offers to get categories for
* @returns record with tpls + counts
*/
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
protected getSpecificCategories(pmcProfile: IPmcData, searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Add Required offers to offers result
* @param searchRequest Client search request data

View File

@ -61,7 +61,9 @@ export declare class RepeatableQuestController {
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
* The new quests generated are again persisted in profile.RepeatableQuests
*
* @param {string} sessionId Player's session id
* @param {string} _info Request from client
* @param {string} sessionID Player's session id
*
* @returns {array} array of "repeatableQuestObjects" as descibed above
*/
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];

View File

@ -20,7 +20,7 @@ import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
declare class TradeController {
export declare class TradeController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper;
@ -63,4 +63,3 @@ declare class TradeController {
protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
}
export { TradeController };

View File

@ -15,7 +15,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
import { FenceService } from "@spt-aki/services/FenceService";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { RagfairCategoriesService } from "@spt-aki/services/RagfairCategoriesService";
import { RagfairOfferService } from "@spt-aki/services/RagfairOfferService";
import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService";
import { HashUtil } from "@spt-aki/utils/HashUtil";
@ -38,7 +37,6 @@ export declare class RagfairOfferGenerator {
protected ragfairPriceService: RagfairPriceService;
protected localisationService: LocalisationService;
protected paymentHelper: PaymentHelper;
protected ragfairCategoriesService: RagfairCategoriesService;
protected fenceService: FenceService;
protected itemHelper: ItemHelper;
protected configServer: ConfigServer;
@ -47,7 +45,7 @@ export declare class RagfairOfferGenerator {
tpl: string;
price: number;
}[];
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, ragfairCategoriesService: RagfairCategoriesService, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, handbookHelper: HandbookHelper, saveServer: SaveServer, presetHelper: PresetHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferService: RagfairOfferService, ragfairPriceService: RagfairPriceService, localisationService: LocalisationService, paymentHelper: PaymentHelper, fenceService: FenceService, itemHelper: ItemHelper, configServer: ConfigServer);
/**
* Create a flea offer and store it in the Ragfair server offers array
* @param userID Owner of the offer

View File

@ -77,10 +77,10 @@ export declare class BotWeaponGeneratorHelper {
*/
addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], parentId: string, parentTpl: string, itemWithChildren: Item[], inventory: Inventory): ItemAddedResult;
/**
* is the provided item allowed inside a container
* @param slot location item wants to be placed in
* @param itemTpl item being placed
* @returns true if allowed
* Is the provided item allowed inside a container
* @param slotGrid Items sub-grid we want to place item inside
* @param itemTpl Item tpl being placed
* @returns True if allowed
*/
protected itemAllowedInContainer(slot: Grid, itemTpl: string): boolean;
protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean;
}

View File

@ -1,3 +1,4 @@
import { Category } from "@spt-aki/models/eft/common/tables/IHandbookBase";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
declare class LookupItem<T, I> {
@ -59,5 +60,6 @@ export declare class HandbookHelper {
* @returns currency count in desired type
*/
fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number;
getCategoryById(handbookId: string): Category;
}
export {};

View File

@ -15,9 +15,11 @@ import { SaveServer } from "@spt-aki/servers/SaveServer";
import { LocalisationService } from "@spt-aki/services/LocalisationService";
import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService";
import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
import { ProfileHelper } from "./ProfileHelper";
export declare class InRaidHelper {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected saveServer: SaveServer;
protected jsonUtil: JsonUtil;
protected itemHelper: ItemHelper;
@ -31,7 +33,7 @@ export declare class InRaidHelper {
protected configServer: ConfigServer;
protected lostOnDeathConfig: ILostOnDeathConfig;
protected inRaidConfig: IInRaidConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer);
/**
* Lookup quest item loss from lostOnDeath config
* @returns True if items should be removed from inventory
@ -60,7 +62,6 @@ export declare class InRaidHelper {
* Reset a profile to a baseline, used post-raid
* Reset points earned during session property
* Increment exp
* Remove Labs keycard
* @param profileData Profile to update
* @param saveProgressRequest post raid save data request data
* @param sessionID Session id
@ -89,13 +90,13 @@ export declare class InRaidHelper {
*/
updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void;
/**
* Look for quests with status = fail that were not failed pre-raid and run the failQuest() function
* Look for quests with a status different from what it began the raid with
* @param sessionId Player id
* @param pmcData Player profile
* @param preRaidQuests Quests prior to starting raid
* @param postRaidProfile Profile sent by client
* @param postRaidProfile Profile sent by client with post-raid quests
*/
protected processFailedQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void;
protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void;
/**
* Take body part effects from client profile and apply to server profile
* @param saveProgressRequest post-raid request

View File

@ -15,7 +15,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil";
import { MathUtil } from "@spt-aki/utils/MathUtil";
import { ObjectId } from "@spt-aki/utils/ObjectId";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
declare class ItemHelper {
export declare class ItemHelper {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected jsonUtil: JsonUtil;
@ -355,4 +355,4 @@ declare namespace ItemHelper {
height: number;
}
}
export { ItemHelper };
export {};

View File

@ -4,7 +4,6 @@ import { TraderAssortHelper } from "@spt-aki/helpers/TraderAssortHelper";
import { UtilityHelper } from "@spt-aki/helpers/UtilityHelper";
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader";
import { IGetOffersResult } from "@spt-aki/models/eft/ragfair/IGetOffersResult";
import { ISearchRequestData } from "@spt-aki/models/eft/ragfair/ISearchRequestData";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
@ -30,14 +29,19 @@ export declare class RagfairHelper {
* @returns string
*/
getCurrencyTag(currency: string): string;
filterCategories(sessionID: string, info: ISearchRequestData): string[];
filterCategories(sessionID: string, request: ISearchRequestData): string[];
getDisplayableAssorts(sessionID: string): Record<string, ITraderAssort>;
protected getCategoryList(handbookId: string): string[];
countCategories(result: IGetOffersResult): void;
/**
* Merges Root Items
* Ragfair allows abnormally large stacks.
*/
mergeStackable(items: Item[]): Item[];
/**
* Return the symbol for a currency
* e.g. 5449016a4bdc2d6f028b456f return
* @param currencyTpl currency to get symbol for
* @returns symbol of currency
*/
getCurrencySymbol(currencyTpl: string): string;
}

View File

@ -2,15 +2,17 @@ import { SellResult } from "@spt-aki/models/eft/ragfair/IRagfairOffer";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { RandomUtil } from "@spt-aki/utils/RandomUtil";
import { TimeUtil } from "@spt-aki/utils/TimeUtil";
export declare class RagfairSellHelper {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected timeUtil: TimeUtil;
protected databaseServer: DatabaseServer;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
/**
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price
* @param averageOfferPriceRub Price of average offer in roubles
@ -19,13 +21,6 @@ export declare class RagfairSellHelper {
* @returns percent value
*/
calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number;
/**
* Get percent chance to sell an item when price is below items average listing price
* @param playerListedPriceRub Price player listed item for in roubles
* @param averageOfferPriceRub Price of average offer in roubles
* @returns percent value
*/
protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number;
/**
* Get array of item count and sell time (empty array = no sell)
* @param sellChancePercent chance item will sell

View File

@ -7,6 +7,7 @@ import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
import { IQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { SaveServer } from "@spt-aki/servers/SaveServer";
@ -21,6 +22,7 @@ import { TimeUtil } from "@spt-aki/utils/TimeUtil";
* Helper class for common ragfair server actions
*/
export declare class RagfairServerHelper {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil;
@ -38,7 +40,7 @@ export declare class RagfairServerHelper {
protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig;
protected static goodsReturnedTemplate: string;
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, mailSendService: MailSendService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* Is item valid / on blacklist / quest item
* @param itemDetails
@ -76,14 +78,29 @@ export declare class RagfairServerHelper {
*/
getDynamicOfferCurrency(): string;
getMemberType(userID: string): MemberCategory;
/**
* Get a player or traders nickname from their profile by their user id
* @param userID Sessionid/userid
* @returns Nickname of individual
*/
getNickname(userID: string): string;
getPresetItems(item: any): Item[];
/**
* Given a preset id from globals.json, return an array of items[] with unique ids
* @param item Preset item
* @returns Array of weapon and its children
*/
getPresetItems(item: Item): Item[];
/**
* Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json
* @param item Preset item
* @returns
*/
getPresetItemsByTpl(item: Item): Item[];
/**
* Generate new unique ids for the children while preserving hierarchy
* @param item base item
* @param preset
* Generate new unique ids for child items while preserving hierarchy
* @param rootItem Base/primary item of preset
* @param preset Primary item + children of primary item
* @returns Item array with new IDs
*/
reparentPresets(item: Item, preset: Item[]): Item[];
reparentPresets(rootItem: Item, preset: Item[]): Item[];
}

View File

@ -25,12 +25,22 @@ export declare class RepairHelper {
* @param applyMaxDurabilityDegradation should item have max durability reduced
*/
updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void;
protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
/**
* Is the supplied tpl a weapon
* @param tpl tplId to check is a weapon
* @returns true if tpl is a weapon
* Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material
* @param armorMaterial What material is the armor being repaired made of
* @param isRepairKit Was a repair kit used
* @param armorMax Max amount of durability item can have
* @param traderQualityMultipler Different traders produce different loss values
* @returns Amount to reduce max durability by
*/
isWeaponTemplate(tpl: string): boolean;
protected getRandomisedArmorRepairDegradationValue(armorMaterial: string, isRepairKit: boolean, armorMax: number, traderQualityMultipler: number): number;
/**
* Repairing weapons reduces the total durability value slightly, get a randomised (to 2dp) amount
* @param itemProps Weapon properties
* @param isRepairKit Was a repair kit used
* @param weaponMax ax amount of durability item can have
* @param traderQualityMultipler Different traders produce different loss values
* @returns Amount to reduce max durability by
*/
protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number;
}

View File

@ -9,5 +9,10 @@ export interface OwnerInventoryItems {
export declare class SecureContainerHelper {
protected itemHelper: ItemHelper;
constructor(itemHelper: ItemHelper);
/**
* Get an array of the item IDs (NOT tpls) inside a secure container
* @param items Inventory items to look for secure container in
* @returns Array of ids
*/
getSecureContainerItems(items: Item[]): string[];
}

View File

@ -53,5 +53,11 @@ export declare class TradeHelper {
* @param itemsPurchasedCount number of items being bought
*/
protected incrementAssortBuyCount(assortBeingPurchased: Item, itemsPurchasedCount: number): void;
/**
* Traders allow a limited number of purchases per refresh cycle (default 60 mins)
* @param assortBeingPurchased the item from trader being bought
* @param assortId Id of assort being purchased
* @param count How many are being bought
*/
protected checkPurchaseIsWithinTraderItemLimit(assortBeingPurchased: Item, assortId: string, count: number): void;
}

View File

@ -44,6 +44,7 @@ export declare class TraderAssortHelper {
* Filter out assorts not unlocked due to level OR quest completion
* @param sessionId session id
* @param traderId traders id
* @param flea Should assorts player hasn't unlocked be returned - default false
* @returns a traders' assorts
*/
getAssort(sessionId: string, traderId: string, flea?: boolean): ITraderAssort;

View File

@ -63,6 +63,12 @@ export declare class TraderHelper {
* @param traderID trader id to reset
*/
resetTrader(sessionID: string, traderID: string): void;
/**
* Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc)
* @param traderId Trader id to get standing for
* @param rawProfileTemplate Raw profile from profiles.json to look up standing from
* @returns Standing value
*/
protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number;
/**
* Alter a traders unlocked status

View File

@ -8,6 +8,11 @@ export declare class WeightedRandomHelper {
getWeightedInventoryItem(itemArray: {
[tplId: string]: unknown;
} | ArrayLike<unknown>): string;
/**
* Choos an item from the passed in array based on the weightings of each
* @param itemArray Items and weights to use
* @returns Chosen item from array
*/
getWeightedValue<T>(itemArray: {
[key: string]: unknown;
} | ArrayLike<unknown>): T;

View File

@ -0,0 +1,9 @@
import { IInventoryBaseActionRequestData } from "./IInventoryBaseActionRequestData";
export interface IRedeemProfileRequestData extends IInventoryBaseActionRequestData {
Action: "RedeemProfileReward";
events: IRedeemProfileRequestEvent[];
}
export interface IRedeemProfileRequestEvent {
MessageId: string;
EventId: string;
}

View File

@ -3,6 +3,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { EquipmentBuildType } from "@spt-aki/models/enums/EquipmentBuildType";
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
import { MessageType } from "@spt-aki/models/enums/MessageType";
import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails";
export interface IAkiProfile {
info: Info;
characters: Characters;
@ -95,7 +96,7 @@ export interface Message {
items?: MessageItems;
maxStorageTime?: number;
systemData?: ISystemData;
profileChangeEvents?: any[];
profileChangeEvents?: IProfileChangeEvent[];
}
export interface MessagePreview {
uid: string;

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