13.5 #15

Merged
chomp merged 19 commits from 13.5 into master 2023-10-08 17:07:30 -04:00
646 changed files with 4636 additions and 2337 deletions
Showing only changes of commit 746a756046 - Show all commits

View File

@ -1,4 +1,5 @@
import { GameController } from "../controllers/GameController"; import { GameController } from "../controllers/GameController";
import { OnLoad } from "../di/OnLoad";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse"; import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
@ -15,12 +16,14 @@ import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { Watermark } from "../utils/Watermark"; import { Watermark } from "../utils/Watermark";
declare class GameCallbacks { declare class GameCallbacks implements OnLoad {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected watermark: Watermark; protected watermark: Watermark;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected gameController: GameController; protected gameController: GameController;
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController); constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController);
onLoad(): Promise<void>;
getRoute(): string;
/** /**
* Handle client/game/version/validate * Handle client/game/version/validate
* @returns INullResponseData * @returns INullResponseData

View File

@ -61,13 +61,14 @@ export declare class GameController {
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
protected lootConfig: ILootConfig; protected lootConfig: ILootConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
load(): void;
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected addCustomLooseLootPositions(): void; protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void; protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void; protected setHideoutAreasAndCraftsTo40Secs(): void;
/** /**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated
* We store the old AID value in new field `sessionId` * We store the old AID value in new field `sessionId`

View File

@ -29,34 +29,35 @@ export declare class HealthController {
* stores in-raid player health * stores in-raid player health
* @param pmcData Player profile * @param pmcData Player profile
* @param info Request data * @param info Request data
* @param sessionID * @param sessionID Player id
* @param addEffects Should effects found be added or removed from profile * @param addEffects Should effects found be added or removed from profile
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
*/ */
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**
* When healing in menu * When healing in menu
* @param pmcData * @param pmcData Player profile
* @param body * @param request Healing request
* @param sessionID * @param sessionID Player id
* @returns * @returns IItemEventRouterResponse
*/ */
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidHeal(pmcData: IPmcData, request: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle Eat event * Handle Eat event
* Consume food/water outside of a raid * Consume food/water outside of a raid
* @param pmcData Player profile * @param pmcData Player profile
* @param body request Object * @param request Eat request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, request: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle RestoreHealth event * Handle RestoreHealth event
* Occurs on post-raid healing page * Occurs on post-raid healing page
* @param pmcData player profile * @param pmcData player profile
* @param healthTreatmentRequest Request data from client * @param healthTreatmentRequest Request data from client
* @param sessionID Session id * @param sessionID Session id
* @returns * @returns IItemEventRouterResponse
*/ */
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
@ -66,12 +67,4 @@ export declare class HealthController {
* @param sessionID * @param sessionID
*/ */
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
/**
* Iterate over treatment request diff and find effects to remove from player limbs
* @param sessionId
* @param profile Profile to update
* @param treatmentRequest client request
* @param output response to send to client
*/
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void;
} }

View File

@ -88,11 +88,11 @@ export declare class HideoutController {
* @param pmcData Profile to edit * @param pmcData Profile to edit
* @param output Object to send back to client * @param output Object to send back to client
* @param sessionID Session/player id * @param sessionID Session/player id
* @param profileHideoutArea Current hideout data for profile * @param profileParentHideoutArea Current hideout area for profile
* @param dbHideoutArea Hideout area being upgraded * @param dbHideoutArea Hideout area being upgraded
* @param hideoutStage Stage hideout area is being upgraded to * @param hideoutStage Stage hideout area is being upgraded to
*/ */
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void;
/** /**
* Add an inventory item to profile from a hideout area stage data * Add an inventory item to profile from a hideout area stage data
* @param pmcData Profile to update * @param pmcData Profile to update

View File

@ -4,6 +4,7 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILocationBase } from "../models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase"; import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { AirdropTypeEnum } from "../models/enums/AirdropType";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
@ -34,10 +35,11 @@ export declare class LocationController {
/** /**
* Handle client/location/getLocalloot * Handle client/location/getLocalloot
* Get a location (map) with generated loot data * Get a location (map) with generated loot data
* @param location Map to generate loot for * @param sessionId Player id
* @param request Map request to generate
* @returns ILocationBase * @returns ILocationBase
*/ */
get(location: string): ILocationBase; get(sessionId: string, request: IGetLocationRequestData): ILocationBase;
/** /**
* Generate a maps base location with loot * Generate a maps base location with loot
* @param name Map name * @param name Map name

View File

@ -61,7 +61,7 @@ export declare class QuestController {
* @param playerLevel level of player to test against quest * @param playerLevel level of player to test against quest
* @returns true if quest can be seen/accepted by player of defined level * @returns true if quest can be seen/accepted by player of defined level
*/ */
protected playerLevelFulfillsQuestRequrement(quest: IQuest, playerLevel: number): boolean; protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean;
/** /**
* Should a quest be shown to the player in trader quest screen * Should a quest be shown to the player in trader quest screen
* @param questId Quest to check * @param questId Quest to check

View File

@ -21,6 +21,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -125,6 +126,18 @@ export declare class RagfairController {
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Charge player a listing fee for using flea, pulls charge from data previously sent by client
* @param sessionID Player id
* @param rootItem Base item being listed (used when client tax cost not found and must be done on server)
* @param pmcData Player profile
* @param requirementsPriceInRub Rouble cost player chose for listing (used when client tax cost not found and must be done on server)
* @param itemStackCount How many items were listed in player (used when client tax cost not found and must be done on server)
* @param offerRequest Add offer request object from client
* @param output IItemEventRouterResponse
* @returns True if charging tax to player failed
*/
protected chargePlayerTaxFee(sessionID: string, rootItem: Item, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean;
/** /**
* Is the item to be listed on the flea valid * Is the item to be listed on the flea valid
* @param offerRequest Client offer request * @param offerRequest Client offer request
@ -158,4 +171,11 @@ export declare class RagfairController {
*/ */
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Create a basic trader request object with price and currency type
* @param currency What currency: RUB, EURO, USD
* @param value Amount of currency
* @returns IProcessBuyTradeRequestData
*/
protected createBuyTradeRequestObject(currency: string, value: number): IProcessBuyTradeRequestData;
} }

View File

@ -14,7 +14,6 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { ItemBaseClassService } from "../services/ItemBaseClassService";
import { ItemFilterService } from "../services/ItemFilterService"; import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
@ -29,7 +28,6 @@ export declare class BotEquipmentModGenerator {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botEquipmentFilterService: BotEquipmentFilterService; protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemBaseClassService: ItemBaseClassService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected botWeaponModLimitService: BotWeaponModLimitService; protected botWeaponModLimitService: BotWeaponModLimitService;
@ -40,7 +38,7 @@ export declare class BotEquipmentModGenerator {
protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
/** /**
* Check mods are compatible and add to array * Check mods are compatible and add to array
* @param equipment Equipment item to add mods to * @param equipment Equipment item to add mods to

View File

@ -65,10 +65,11 @@ export declare class LocationGenerator {
protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[];
/** /**
* Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount
* @param groupId Name of the group the containers are being collected for
* @param containerData Containers and probability values for a groupId * @param containerData Containers and probability values for a groupId
* @returns List of chosen container Ids * @returns List of chosen container Ids
*/ */
protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; protected getContainersByProbabilty(groupId: string, containerData: IContainerGroupCount): string[];
/** /**
* Get a mapping of each groupid and the containers in that group + count of containers to spawn on map * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map
* @param containersGroups Container group values * @param containersGroups Container group values

View File

@ -31,12 +31,12 @@ export declare class PMCLootGenerator {
*/ */
generatePMCVestLootPool(): string[]; generatePMCVestLootPool(): string[];
/** /**
* Check if item has a width/height that lets it fit into a 1x2/2x1 slot * Check if item has a width/height that lets it fit into a 2x2 slot
* 1x1 / 1x2 / 2x1 * 1x1 / 1x2 / 2x1 / 2x2
* @param item Item to check size of * @param item Item to check size of
* @returns true if it fits * @returns true if it fits
*/ */
protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; protected itemFitsInto2By2Slot(item: ITemplateItem): boolean;
/** /**
* Create an array of loot items a PMC can have in their backpack * Create an array of loot items a PMC can have in their backpack
* @returns string array of tpls * @returns string array of tpls

View File

@ -55,11 +55,10 @@ export declare class RagfairOfferGenerator {
* @param items Items in the offer * @param items Items in the offer
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param price Price of offer * @param sellInOnePiece Flags sellInOnePiece to be true
* @param sellInOnePiece Set StackObjectsCount to 1
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -67,17 +66,16 @@ export declare class RagfairOfferGenerator {
* @param items Items in the offer * @param items Items in the offer
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param price Price of offer
* @param sellInOnePiece Set StackObjectsCount to 1 * @param sellInOnePiece Set StackObjectsCount to 1
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer
* @returns rouble cost of offer * @returns rouble cost of offer
*/ */
protected calculateOfferListingPrice(offerRequirements: OfferRequirement[]): number; protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number;
/** /**
* Get avatar url from trader table in db * Get avatar url from trader table in db
* @param isTrader Is user we're getting avatar for a trader * @param isTrader Is user we're getting avatar for a trader
@ -137,7 +135,7 @@ export declare class RagfairOfferGenerator {
* @param itemDetails raw db item details * @param itemDetails raw db item details
* @returns Item array * @returns Item array
*/ */
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<Item[]>; protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
/** /**
* Generate trader offers on flea using the traders assort data * Generate trader offers on flea using the traders assort data
* @param traderID Trader to generate offers for * @param traderID Trader to generate offers for
@ -151,7 +149,7 @@ export declare class RagfairOfferGenerator {
* @param itemDetails db details of first item * @param itemDetails db details of first item
* @returns * @returns
*/ */
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[]; protected randomiseItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
/** /**
* Get the relevant condition id if item tpl matches in ragfair.json/condition * Get the relevant condition id if item tpl matches in ragfair.json/condition
* @param tpl Item to look for matching condition object * @param tpl Item to look for matching condition object
@ -184,7 +182,7 @@ export declare class RagfairOfferGenerator {
* @param offerItems Items for sale in offer * @param offerItems Items for sale in offer
* @returns Barter scheme * @returns Barter scheme
*/ */
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[];
/** /**
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
* @returns array with tpl/price values * @returns array with tpl/price values
@ -196,7 +194,9 @@ export declare class RagfairOfferGenerator {
/** /**
* Create a random currency-based barter scheme for an array of items * Create a random currency-based barter scheme for an array of items
* @param offerItems Items on offer * @param offerItems Items on offer
* @param isPackOffer Is the barter scheme being created for a pack offer
* @param multipler What to multiply the resulting price by
* @returns Barter scheme for offer * @returns Barter scheme for offer
*/ */
protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[]; protected createCurrencyBarterScheme(offerItems: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
} }

View File

@ -25,6 +25,8 @@ export declare class ScavCaseRewardGenerator {
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected scavCaseConfig: IScavCaseConfig; protected scavCaseConfig: IScavCaseConfig;
protected dbItemsCache: ITemplateItem[];
protected dbAmmoItemsCache: ITemplateItem[];
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Create an array of rewards that will be given to the player upon completing their scav case build * Create an array of rewards that will be given to the player upon completing their scav case build
@ -33,10 +35,10 @@ export declare class ScavCaseRewardGenerator {
*/ */
generate(recipeId: string): Product[]; generate(recipeId: string): Product[];
/** /**
* Get all db items that are not blacklisted in scavcase config * Get all db items that are not blacklisted in scavcase config or global blacklist
* @returns filtered array of db items * Store in class field
*/ */
protected getDbItems(): ITemplateItem[]; protected cacheDbItems(): void;
/** /**
* Pick a number of items to be rewards, the count is defined by the values in * Pick a number of items to be rewards, the count is defined by the values in
* @param items item pool to pick rewards from * @param items item pool to pick rewards from

View File

@ -52,6 +52,7 @@ export declare class WeatherGenerator {
*/ */
protected setCurrentDateTime(weather: IWeather): void; protected setCurrentDateTime(weather: IWeather): void;
protected getWeightedWindDirection(): WindDirection; protected getWeightedWindDirection(): WindDirection;
protected getWeightedClouds(): number;
protected getWeightedWindSpeed(): number; protected getWeightedWindSpeed(): number;
protected getWeightedFog(): number; protected getWeightedFog(): number;
protected getWeightedRain(): number; protected getWeightedRain(): number;

View File

@ -27,6 +27,7 @@ export declare class HealthHelper {
* @param request Heal request * @param request Heal request
* @param sessionID Session id * @param sessionID Session id
* @param addEffects Should effects be added or removed (default - add) * @param addEffects Should effects be added or removed (default - add)
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
*/ */
saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**

View File

@ -53,7 +53,7 @@ export declare class InRaidHelper {
* @param victim Who was killed by player * @param victim Who was killed by player
* @returns a numerical standing gain or loss * @returns a numerical standing gain or loss
*/ */
protected getStandingChangeForKill(victim: Victim): number; protected getFenceStandingChangeForKillAsScav(victim: Victim): number;
/** /**
* Reset a profile to a baseline, used post-raid * Reset a profile to a baseline, used post-raid
* Reset points earned during session property * Reset points earned during session property

View File

@ -26,6 +26,7 @@ declare class ItemHelper {
protected itemBaseClassService: ItemBaseClassService; protected itemBaseClassService: ItemBaseClassService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected localeService: LocaleService; protected localeService: LocaleService;
protected readonly defaultInvalidBaseTypes: string[];
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService);
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
@ -67,6 +68,11 @@ declare class ItemHelper {
* @returns Price in roubles (undefined if not found) * @returns Price in roubles (undefined if not found)
*/ */
getDynamicItemPrice(tpl: string): number; getDynamicItemPrice(tpl: string): number;
/**
* Update items upd.StackObjectsCount to be 1 if its upd is missing or StackObjectsCount is undefined
* @param item Item to update
* @returns Fixed item
*/
fixItemStackCount(item: Item): Item; fixItemStackCount(item: Item): Item;
/** /**
* AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content. * AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content.
@ -125,19 +131,19 @@ declare class ItemHelper {
getItemQualityModifier(item: Item): number; getItemQualityModifier(item: Item): number;
/** /**
* Get a quality value based on a repairable items (weapon/armor) current state between current and max durability * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability
* @param itemDetails * @param itemDetails Db details for item we want quality value for
* @param repairable repairable object * @param repairable Repairable properties
* @param item * @param item Item quality value is for
* @returns a number between 0 and 1 * @returns A number between 0 and 1
*/ */
protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number;
/** /**
* Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results * Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results
* @param items * @param items Array of items (item + possible children)
* @param itemID * @param itemId Parent items id
* @returns an array of strings * @returns an array of strings
*/ */
findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; findAndReturnChildrenByItems(items: Item[], itemId: string): string[];
/** /**
* A variant of findAndReturnChildren where the output is list of item objects instead of their ids. * A variant of findAndReturnChildren where the output is list of item objects instead of their ids.
* @param items * @param items
@ -164,12 +170,6 @@ declare class ItemHelper {
* @returns true if it is a dogtag * @returns true if it is a dogtag
*/ */
isDogtag(tpl: string): boolean; isDogtag(tpl: string): boolean;
/**
* Can the item passed in be sold to a trader because it is raw money
* @param tpl Item template id to check
* @returns true if unsellable
*/
isNotSellable(tpl: string): boolean;
/** /**
* Gets the identifier for a child using slotId, locationX and locationY. * Gets the identifier for a child using slotId, locationX and locationY.
* @param item * @param item
@ -183,19 +183,19 @@ declare class ItemHelper {
*/ */
isItemTplStackable(tpl: string): boolean; isItemTplStackable(tpl: string): boolean;
/** /**
* split item stack if it exceeds its StackMaxSize property * split item stack if it exceeds its items StackMaxSize property
* @param itemToSplit item being split into smaller stacks * @param itemToSplit Item to split into smaller stacks
* @returns Array of split items * @returns Array of split items
*/ */
splitStack(itemToSplit: Item): Item[]; splitStack(itemToSplit: Item): Item[];
/** /**
* Find Barter items in the inventory * Find Barter items from array of items
* @param {string} by tpl or id * @param {string} by tpl or id
* @param {Object} pmcData * @param {Item[]} items Array of items to iterate over
* @param {string} barterItemId * @param {string} barterItemId
* @returns Array of Item objects * @returns Array of Item objects
*/ */
findBarterItems(by: "tpl" | "id", pmcData: IPmcData, barterItemId: string): Item[]; findBarterItems(by: "tpl" | "id", items: Item[], barterItemId: string): Item[];
/** /**
* Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table) * Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table)
* @param pmcData Player profile * @param pmcData Player profile
@ -262,10 +262,21 @@ declare class ItemHelper {
* @param minSizePercent % the magazine must be filled to * @param minSizePercent % the magazine must be filled to
*/ */
fillMagazineWithCartridge(magazine: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void; fillMagazineWithCartridge(magazine: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void;
/**
* Choose a random bullet type from the list of possible a magazine has
* @param magTemplate Magazine template from Db
* @returns Tpl of cartridge
*/
protected getRandomValidCaliber(magTemplate: ITemplateItem): string; protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
/**
* Chose a randomly weighted cartridge that fits
* @param caliber Desired caliber
* @param staticAmmoDist Cartridges and thier weights
* @returns Tpl of cartrdige
*/
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string; protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
/** /**
* * Create a basic cartrige object
* @param parentId container cartridges will be placed in * @param parentId container cartridges will be placed in
* @param ammoTpl Cartridge to insert * @param ammoTpl Cartridge to insert
* @param stackCount Count of cartridges inside parent * @param stackCount Count of cartridges inside parent

View File

@ -21,6 +21,7 @@ import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
import { ProfileHelper } from "./ProfileHelper"; import { ProfileHelper } from "./ProfileHelper";
import { QuestConditionHelper } from "./QuestConditionHelper";
import { RagfairServerHelper } from "./RagfairServerHelper"; import { RagfairServerHelper } from "./RagfairServerHelper";
import { TraderHelper } from "./TraderHelper"; import { TraderHelper } from "./TraderHelper";
export declare class QuestHelper { export declare class QuestHelper {
@ -29,6 +30,7 @@ export declare class QuestHelper {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected questConditionHelper: QuestConditionHelper;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
@ -41,7 +43,7 @@ export declare class QuestHelper {
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Get status of a quest in player profile by its id * Get status of a quest in player profile by its id
* @param pmcData Profile to search * @param pmcData Profile to search
@ -119,7 +121,7 @@ export declare class QuestHelper {
* @param sessionID Session id * @param sessionID Session id
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started * @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
*/ */
acceptedUnlocked(startedQuestId: string, sessionID: string): IQuest[]; getNewlyAccessibleQuestsWhenStartingQuest(startedQuestId: string, sessionID: string): IQuest[];
/** /**
* Get quests that can be shown to player after failing a quest * Get quests that can be shown to player after failing a quest
* @param failedQuestId Id of the quest failed by player * @param failedQuestId Id of the quest failed by player

View File

@ -1,4 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
@ -13,10 +14,10 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { LocaleService } from "../services/LocaleService"; import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { MailSendService } from "../services/MailSendService";
import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairOfferService } from "../services/RagfairOfferService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
import { PresetHelper } from "./PresetHelper"; import { PresetHelper } from "./PresetHelper";
@ -33,7 +34,6 @@ export declare class RagfairOfferHelper {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected dialogueHelper: DialogueHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
@ -44,11 +44,12 @@ export declare class RagfairOfferHelper {
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected static goodSoldTemplate: string; protected static goodSoldTemplate: string;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client
@ -119,19 +120,26 @@ export declare class RagfairOfferHelper {
*/ */
protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected getProfileOffers(sessionID: string): IRagfairOffer[];
/** /**
* Delete an offer from a desired profile * Delete an offer from a desired profile and from ragfair offers
* @param sessionID Session id of profile to delete offer from * @param sessionID Session id of profile to delete offer from
* @param offerId Offer id to delete * @param offerId Id of offer to delete
*/ */
protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected deleteOfferById(sessionID: string, offerId: string): void;
/** /**
* Complete the selling of players' offer * Complete the selling of players' offer
* @param sessionID Session id * @param sessionID Session id
* @param offer Sold offer details * @param offer Sold offer details
* @param boughtAmount Amount item was purchased for * @param boughtAmount Amount item was purchased for
* @returns Client response * @returns IItemEventRouterResponse
*/ */
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
/**
* Get a localised message for when players offer has sold on flea
* @param itemTpl Item sold
* @param boughtAmount How many were purchased
* @returns Localised message text
*/
protected getLocalisedOfferSoldMessage(itemTpl: string, boughtAmount: number): string;
/** /**
* Should a ragfair offer be visible to the player * Should a ragfair offer be visible to the player
* @param searchRequest Search request * @param searchRequest Search request
@ -142,4 +150,12 @@ export declare class RagfairOfferHelper {
* @returns True = should be shown to player * @returns True = should be shown to player
*/ */
isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
/**
* Is items quality value within desired range
* @param item Item to check quality of
* @param min Desired minimum quality
* @param max Desired maximum quality
* @returns True if in range
*/
protected itemQualityInRange(item: Item, min: number, max: number): boolean;
} }

View File

@ -13,12 +13,12 @@ export declare class RagfairSellHelper {
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
/** /**
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price * Get the percent chance to sell an item based on its average listed price vs player chosen listing price
* @param baseChancePercent Base chance to sell item
* @param averageOfferPriceRub Price of average offer in roubles * @param averageOfferPriceRub Price of average offer in roubles
* @param playerListedPriceRub Price player listed item for in roubles * @param playerListedPriceRub Price player listed item for in roubles
* @param qualityMultiplier Quality multipler of item being sold
* @returns percent value * @returns percent value
*/ */
calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number; calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number;
/** /**
* Get percent chance to sell an item when price is below items average listing price * 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 playerListedPriceRub Price player listed item for in roubles

View File

@ -35,7 +35,7 @@ export declare class TraderHelper {
protected highestTraderBuyPriceItems: Record<string, number>; protected highestTraderBuyPriceItems: Record<string, number>;
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer);
getTrader(traderID: string, sessionID: string): ITraderBase; getTrader(traderID: string, sessionID: string): ITraderBase;
getTraderAssortsById(traderId: string): ITraderAssort; getTraderAssortsByTraderId(traderId: string): ITraderAssort;
/** /**
* Reset a profiles trader data back to its initial state as seen by a level 1 player * Reset a profiles trader data back to its initial state as seen by a level 1 player
* Does NOT take into account different profile levels * Does NOT take into account different profile levels

View File

@ -281,7 +281,7 @@ export interface InsuredItem {
export interface Hideout { export interface Hideout {
Production: Record<string, Productive>; Production: Record<string, Productive>;
Areas: HideoutArea[]; Areas: HideoutArea[];
Improvements: Record<string, IHideoutImprovement>; Improvement: Record<string, IHideoutImprovement>;
Seed: number; Seed: number;
sptUpdateLastRunTimestamp: number; sptUpdateLastRunTimestamp: number;
} }

View File

@ -1,12 +1,14 @@
export interface IHealthTreatmentRequestData { export interface IHealthTreatmentRequestData {
Action: "RestoreHealth"; Action: "RestoreHealth";
trader: string; trader: string;
items: Item[]; items: Cost[];
difference: Difference; difference: Difference;
timestamp: number; timestamp: number;
} }
export interface Item { export interface Cost {
/** Id of stack to take money from */
id: string; id: string;
/** Amount of money to take off player for treatment */
count: number; count: number;
} }
export interface Difference { export interface Difference {
@ -25,5 +27,6 @@ export interface BodyParts {
} }
export interface BodyPart { export interface BodyPart {
Health: number; Health: number;
/** Effects in array are to be removed */
Effects: string[]; Effects: string[];
} }

View File

@ -14,6 +14,11 @@ export interface INotification {
} }
export declare enum NotificationType { export declare enum NotificationType {
RAGFAIR_OFFER_SOLD = "RagfairOfferSold", RAGFAIR_OFFER_SOLD = "RagfairOfferSold",
RAGFAIR_RATING_CHANGE = "RagfairRatingChange",
/** ChatMessageReceived */
NEW_MESSAGE = "new_message", NEW_MESSAGE = "new_message",
PING = "ping" PING = "ping",
TRADER_SUPPLY = "TraderSupply",
TRADER_STANDING = "TraderStanding",
UNLOCK_TRADER = "UnlockTrader"
} }

View File

@ -1,6 +1,3 @@
import { INotifierChannel } from "./INotifier";
export interface ISelectProfileResponse { export interface ISelectProfileResponse {
status: string; status: string;
notifier: INotifierChannel;
notifierServer: string;
} }

View File

@ -1,19 +1,19 @@
export declare enum WeatherType { export declare enum WeatherType {
CLEAR_DAY = 1, CLEAR_DAY = 0,
CLEAR_WIND = 2, CLEAR_WIND = 1,
CLEAR_NIGHT = 3, CLEAR_NIGHT = 2,
PARTLY_CLOUD_DAY = 4, PARTLY_CLOUD_DAY = 3,
PARTLY_CLOUD_NIGHT = 5, PARTLY_CLOUD_NIGHT = 4,
CLEAR_FOG_DAY = 6, CLEAR_FOG_DAY = 5,
CLEAR_FOG_NIGHT = 7, CLEAR_FOG_NIGHT = 6,
CLOUDFOG = 8, CLOUD_FOG = 7,
FOG = 9, FOG = 8,
MOSTLY_CLOUD = 10, MOSTLY_CLOUD = 9,
LIGHT_RAIN = 11, LIGHT_RAIN = 10,
RAIN = 12, RAIN = 11,
CLOUD_WIND = 13, CLOUD_WIND = 12,
CLOUD_WIND_RAIN = 14, CLOUD_WIND_RAIN = 13,
FULL_CLOUD = 15, FULL_CLOUD = 14,
THUNDER_CLOUD = 16, THUNDER_CLOUD = 15,
NONE = 0 NONE = 16
} }

View File

@ -41,7 +41,8 @@ export interface Dynamic {
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
useTraderPriceForOffersIfHigher: boolean; useTraderPriceForOffersIfHigher: boolean;
/** Barter offer specific settings */ /** Barter offer specific settings */
barter: Barter; barter: IBarterDetails;
pack: IPackDetails;
/** Dynamic offer price below handbook adjustment values */ /** Dynamic offer price below handbook adjustment values */
offerAdjustment: OfferAdjustment; offerAdjustment: OfferAdjustment;
/** How many offers should expire before an offer regeneration occurs */ /** How many offers should expire before an offer regeneration occurs */
@ -49,9 +50,7 @@ export interface Dynamic {
/** How many offers should be listed */ /** How many offers should be listed */
offerItemCount: MinMax; offerItemCount: MinMax;
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */ /** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
price: MinMax; priceRanges: IPriceRanges;
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
presetPrice: MinMax;
/** Should default presets to listed only or should non-standard presets found in globals.json be listed too */ /** Should default presets to listed only or should non-standard presets found in globals.json be listed too */
showDefaultPresetsOnly: boolean; showDefaultPresetsOnly: boolean;
endTimeSeconds: MinMax; endTimeSeconds: MinMax;
@ -74,7 +73,12 @@ export interface Dynamic {
/** Dict of price limits keyed by item type */ /** Dict of price limits keyed by item type */
unreasonableModPrices: Record<string, IUnreasonableModPrices>; unreasonableModPrices: Record<string, IUnreasonableModPrices>;
} }
export interface Barter { export interface IPriceRanges {
default: MinMax;
preset: MinMax;
pack: MinMax;
}
export interface IBarterDetails {
/** Should barter offers be generated */ /** Should barter offers be generated */
enable: boolean; enable: boolean;
/** Percentage change an offer is listed as a barter */ /** Percentage change an offer is listed as a barter */
@ -90,6 +94,18 @@ export interface Barter {
/** Item Tpls to never be turned into a barter */ /** Item Tpls to never be turned into a barter */
itemTypeBlacklist: string[]; itemTypeBlacklist: string[];
} }
export interface IPackDetails {
/** Should pack offers be generated */
enable: boolean;
/** Percentage change an offer is listed as a pack */
chancePercent: number;
/** Min number of required items for a pack */
itemCountMin: number;
/** Max number of required items for a pack */
itemCountMax: number;
/** item types to allow being a pack */
itemTypeWhitelist: string[];
}
export interface OfferAdjustment { export interface OfferAdjustment {
/** Shuld offer price be adjusted when below handbook price */ /** Shuld offer price be adjusted when below handbook price */
adjustPriceWhenBelowHandbookPrice: boolean; adjustPriceWhenBelowHandbookPrice: boolean;

View File

@ -7,7 +7,7 @@ export interface IWeatherConfig extends IBaseConfig {
weather: Weather; weather: Weather;
} }
export interface Weather { export interface Weather {
clouds: MinMax; clouds: WeatherSettings<string>;
windSpeed: WeatherSettings<number>; windSpeed: WeatherSettings<number>;
windDirection: WeatherSettings<WindDirection>; windDirection: WeatherSettings<WindDirection>;
windGustiness: MinMax; windGustiness: MinMax;

View File

@ -11,7 +11,18 @@ export declare class HashCacheService {
protected modHashes: any; protected modHashes: any;
protected readonly modCachePath = "./user/cache/modCache.json"; protected readonly modCachePath = "./user/cache/modCache.json";
constructor(vfs: VFS, hashUtil: HashUtil, jsonUtil: JsonUtil, logger: ILogger); constructor(vfs: VFS, hashUtil: HashUtil, jsonUtil: JsonUtil, logger: ILogger);
/**
* Return a stored hash by key
* @param modName Name of mod to get hash for
* @returns Mod hash
*/
getStoredModHash(modName: string): string; getStoredModHash(modName: string): string;
/**
* Does the generated hash match the stored hash
* @param modName name of mod
* @param modContent
* @returns True if they match
*/
modContentMatchesStoredHash(modName: string, modContent: string): boolean; modContentMatchesStoredHash(modName: string, modContent: string): boolean;
hashMatchesStoredHash(modName: string, modHash: string): boolean; hashMatchesStoredHash(modName: string, modHash: string): boolean;
storeModContent(modName: string, modContent: string): void; storeModContent(modName: string, modContent: string): void;

View File

@ -35,7 +35,7 @@ export declare class MailSendService {
* @param items Optional items to send to player * @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire * @param maxStorageTimeSeconds Optional time to collect items before they expire
*/ */
sendDirectNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; sendDirectNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void;
/** /**
* Send a message from an NPC (e.g. prapor) to the player with or without items * Send a message from an NPC (e.g. prapor) to the player with or without items
* @param playerId Players id to send message to * @param playerId Players id to send message to
@ -45,7 +45,7 @@ export declare class MailSendService {
* @param items Optional items to send to player * @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire * @param maxStorageTimeSeconds Optional time to collect items before they expire
*/ */
sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void;
/** /**
* Send a message from SYSTEM to the player with or without items * Send a message from SYSTEM to the player with or without items
* @param playerId Players id to send message to * @param playerId Players id to send message to

View File

@ -1,7 +1,7 @@
import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { LocalisationService } from "./LocalisationService"; import { LocalisationService } from "./LocalisationService";
/** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */ /** Cache bots in a dictionary, keyed by the bots name, keying by name isnt ideal as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */
export declare class MatchBotDetailsCacheService { export declare class MatchBotDetailsCacheService {
protected logger: ILogger; protected logger: ILogger;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
@ -17,9 +17,9 @@ export declare class MatchBotDetailsCacheService {
*/ */
clearCache(): void; clearCache(): void;
/** /**
* Find a bot in the cache by its name * Find a bot in the cache by its name and side
* @param botName Name of bot to find * @param botName Name of bot to find
* @returns Bot details * @returns Bot details
*/ */
getBotByName(botName: string): IBotBase; getBotByNameAndSide(botName: string, botSide: string): IBotBase;
} }

View File

@ -1,14 +1,36 @@
import { CompilerOptions } from "typescript"; import { CompilerOptions } from "typescript";
import type { ILogger } from "../models/spt/utils/ILogger"; import type { ILogger } from "../models/spt/utils/ILogger";
import { HashCacheService } from "./HashCacheService";
import { VFS } from "../utils/VFS"; import { VFS } from "../utils/VFS";
import { HashCacheService } from "./HashCacheService";
export declare class ModCompilerService { export declare class ModCompilerService {
protected logger: ILogger; protected logger: ILogger;
protected hashCacheService: HashCacheService; protected hashCacheService: HashCacheService;
protected vfs: VFS; protected vfs: VFS;
constructor(logger: ILogger, hashCacheService: HashCacheService, vfs: VFS); constructor(logger: ILogger, hashCacheService: HashCacheService, vfs: VFS);
/**
* Convert a mods TS into JS
* @param modName Name of mod
* @param modPath Dir path to mod
* @param modTypeScriptFiles
* @returns
*/
compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void>; compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void>;
/**
* Convert a TS file into JS
* @param fileNames Paths to TS files
* @param options Compiler options
*/
protected compile(fileNames: string[], options: CompilerOptions): Promise<void>; protected compile(fileNames: string[], options: CompilerOptions): Promise<void>;
/**
* Do the files at the provided paths exist
* @param fileNames
* @returns
*/
protected areFilesReady(fileNames: string[]): boolean; protected areFilesReady(fileNames: string[]): boolean;
/**
* Wait the provided number of milliseconds
* @param ms Milliseconds
* @returns
*/
protected delay(ms: number): Promise<unknown>; protected delay(ms: number): Promise<unknown>;
} }

View File

@ -61,23 +61,26 @@ export declare class PaymentService {
* Get all money stacks in inventory and prioritse items in stash * Get all money stacks in inventory and prioritse items in stash
* @param pmcData * @param pmcData
* @param currencyTpl * @param currencyTpl
* @param playerStashId Players stash id
* @returns Sorting money items * @returns Sorting money items
*/ */
protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string): Item[]; protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string, playerStashId: string): Item[];
/** /**
* Prioritise player stash first over player inventory * Prioritise player stash first over player inventory
* Post-raid healing would often take money out of the players pockets/secure container * Post-raid healing would often take money out of the players pockets/secure container
* @param a First money stack item * @param a First money stack item
* @param b Second money stack item * @param b Second money stack item
* @param inventoryItems players inventory items * @param inventoryItems players inventory items
* @param playerStashId Players stash id
* @returns sort order * @returns sort order
*/ */
protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number; protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[], playerStashId: string): number;
/** /**
* Recursivly check items parents to see if it is inside the players inventory, not stash * Recursivly check items parents to see if it is inside the players inventory, not stash
* @param itemId item id to check * @param itemId item id to check
* @param inventoryItems player inventory * @param inventoryItems player inventory
* @param playerStashId Players stash id
* @returns true if its in inventory * @returns true if its in inventory
*/ */
protected isInInventory(itemId: string, inventoryItems: Item[]): boolean; protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean;
} }

View File

@ -14,6 +14,7 @@ import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { Watermark } from "../utils/Watermark"; import { Watermark } from "../utils/Watermark";
import { LocalisationService } from "./LocalisationService"; import { LocalisationService } from "./LocalisationService";
@ -27,17 +28,19 @@ export declare class ProfileFixerService {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
/** /**
* Find issues in the pmc profile data that may cause issues and fix them * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix
*/ */
checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void;
protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void;
protected ensureGunStandLevelsMatch(pmcProfile: IPmcData): void;
protected addHideoutAreaStashes(pmcProfile: IPmcData): void; protected addHideoutAreaStashes(pmcProfile: IPmcData): void;
protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void;
protected adjustUnreasonableModFleaPrices(): void; protected adjustUnreasonableModFleaPrices(): void;
@ -131,4 +134,9 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to add missing IDs to * @param pmcProfile Profile to add missing IDs to
*/ */
addMissingIdsToBonuses(pmcProfile: IPmcData): void; addMissingIdsToBonuses(pmcProfile: IPmcData): void;
/**
* At some point the property name was changed,migrate data across to new name
* @param pmcProfile
*/
protected migrateImprovements(pmcProfile: IPmcData): void;
} }

View File

@ -3,6 +3,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { MinMax } from "../models/common/MinMax";
import { IPreset } from "../models/eft/common/IGlobals"; import { IPreset } from "../models/eft/common/IGlobals";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IBarterScheme } from "../models/eft/common/tables/ITrader";
@ -35,10 +36,6 @@ export declare class RagfairPriceService implements OnLoad {
* Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries * Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries
*/ */
onLoad(): Promise<void>; onLoad(): Promise<void>;
/**
* Add placeholder values for items missing from handbook
*/
protected addMissingHandbookPrices(): void;
getRoute(): string; getRoute(): string;
/** /**
* Iterate over all items of type "Item" in db and get template price, store in cache * Iterate over all items of type "Item" in db and get template price, store in cache
@ -91,9 +88,17 @@ export declare class RagfairPriceService implements OnLoad {
* Generate a currency cost for an item and its mods * Generate a currency cost for an item and its mods
* @param items Item with mods to get price for * @param items Item with mods to get price for
* @param desiredCurrency Currency price desired in * @param desiredCurrency Currency price desired in
* @param isPackOffer Price is for a pack type offer
* @returns cost of item in desired currency * @returns cost of item in desired currency
*/ */
getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; getDynamicOfferPriceForOffer(items: Item[], desiredCurrency: string, isPackOffer: boolean): number;
/**
* Get different min/max price multipliers for different offer types (preset/pack/default)
* @param isPreset Offer is a preset
* @param isPack Offer is a pack
* @returns MinMax values
*/
protected getOfferTypeRangeValues(isPreset: boolean, isPack: boolean): MinMax;
/** /**
* Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json
* @param itemPrice price of item * @param itemPrice price of item
@ -104,10 +109,10 @@ export declare class RagfairPriceService implements OnLoad {
/** /**
* Multiply the price by a randomised curve where n = 2, shift = 2 * Multiply the price by a randomised curve where n = 2, shift = 2
* @param existingPrice price to alter * @param existingPrice price to alter
* @param isPreset is the item we're multiplying a preset * @param rangeValues min and max to adjust price by
* @returns multiplied price * @returns multiplied price
*/ */
protected randomisePrice(existingPrice: number, isPreset: boolean): number; protected randomiseOfferPrice(existingPrice: number, rangeValues: MinMax): number;
/** /**
* Calculate the cost of a weapon preset by adding together the price of its mods + base price of default weapon preset * Calculate the cost of a weapon preset by adding together the price of its mods + base price of default weapon preset
* @param item base weapon * @param item base weapon

View File

@ -1,4 +1,5 @@
import { GameController } from "../controllers/GameController"; import { GameController } from "../controllers/GameController";
import { OnLoad } from "../di/OnLoad";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse"; import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
@ -15,12 +16,14 @@ import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { Watermark } from "../utils/Watermark"; import { Watermark } from "../utils/Watermark";
declare class GameCallbacks { declare class GameCallbacks implements OnLoad {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected watermark: Watermark; protected watermark: Watermark;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected gameController: GameController; protected gameController: GameController;
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController); constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController);
onLoad(): Promise<void>;
getRoute(): string;
/** /**
* Handle client/game/version/validate * Handle client/game/version/validate
* @returns INullResponseData * @returns INullResponseData

View File

@ -61,13 +61,14 @@ export declare class GameController {
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
protected lootConfig: ILootConfig; protected lootConfig: ILootConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
load(): void;
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected addCustomLooseLootPositions(): void; protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void; protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void; protected setHideoutAreasAndCraftsTo40Secs(): void;
/** /**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated
* We store the old AID value in new field `sessionId` * We store the old AID value in new field `sessionId`

View File

@ -29,34 +29,35 @@ export declare class HealthController {
* stores in-raid player health * stores in-raid player health
* @param pmcData Player profile * @param pmcData Player profile
* @param info Request data * @param info Request data
* @param sessionID * @param sessionID Player id
* @param addEffects Should effects found be added or removed from profile * @param addEffects Should effects found be added or removed from profile
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
*/ */
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**
* When healing in menu * When healing in menu
* @param pmcData * @param pmcData Player profile
* @param body * @param request Healing request
* @param sessionID * @param sessionID Player id
* @returns * @returns IItemEventRouterResponse
*/ */
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidHeal(pmcData: IPmcData, request: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle Eat event * Handle Eat event
* Consume food/water outside of a raid * Consume food/water outside of a raid
* @param pmcData Player profile * @param pmcData Player profile
* @param body request Object * @param request Eat request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, request: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle RestoreHealth event * Handle RestoreHealth event
* Occurs on post-raid healing page * Occurs on post-raid healing page
* @param pmcData player profile * @param pmcData player profile
* @param healthTreatmentRequest Request data from client * @param healthTreatmentRequest Request data from client
* @param sessionID Session id * @param sessionID Session id
* @returns * @returns IItemEventRouterResponse
*/ */
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
@ -66,12 +67,4 @@ export declare class HealthController {
* @param sessionID * @param sessionID
*/ */
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
/**
* Iterate over treatment request diff and find effects to remove from player limbs
* @param sessionId
* @param profile Profile to update
* @param treatmentRequest client request
* @param output response to send to client
*/
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void;
} }

View File

@ -88,11 +88,11 @@ export declare class HideoutController {
* @param pmcData Profile to edit * @param pmcData Profile to edit
* @param output Object to send back to client * @param output Object to send back to client
* @param sessionID Session/player id * @param sessionID Session/player id
* @param profileHideoutArea Current hideout data for profile * @param profileParentHideoutArea Current hideout area for profile
* @param dbHideoutArea Hideout area being upgraded * @param dbHideoutArea Hideout area being upgraded
* @param hideoutStage Stage hideout area is being upgraded to * @param hideoutStage Stage hideout area is being upgraded to
*/ */
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void;
/** /**
* Add an inventory item to profile from a hideout area stage data * Add an inventory item to profile from a hideout area stage data
* @param pmcData Profile to update * @param pmcData Profile to update

View File

@ -4,6 +4,7 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILocationBase } from "../models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase"; import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { AirdropTypeEnum } from "../models/enums/AirdropType";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
@ -34,10 +35,11 @@ export declare class LocationController {
/** /**
* Handle client/location/getLocalloot * Handle client/location/getLocalloot
* Get a location (map) with generated loot data * Get a location (map) with generated loot data
* @param location Map to generate loot for * @param sessionId Player id
* @param request Map request to generate
* @returns ILocationBase * @returns ILocationBase
*/ */
get(location: string): ILocationBase; get(sessionId: string, request: IGetLocationRequestData): ILocationBase;
/** /**
* Generate a maps base location with loot * Generate a maps base location with loot
* @param name Map name * @param name Map name

View File

@ -61,7 +61,7 @@ export declare class QuestController {
* @param playerLevel level of player to test against quest * @param playerLevel level of player to test against quest
* @returns true if quest can be seen/accepted by player of defined level * @returns true if quest can be seen/accepted by player of defined level
*/ */
protected playerLevelFulfillsQuestRequrement(quest: IQuest, playerLevel: number): boolean; protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean;
/** /**
* Should a quest be shown to the player in trader quest screen * Should a quest be shown to the player in trader quest screen
* @param questId Quest to check * @param questId Quest to check

View File

@ -21,6 +21,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -125,6 +126,18 @@ export declare class RagfairController {
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Charge player a listing fee for using flea, pulls charge from data previously sent by client
* @param sessionID Player id
* @param rootItem Base item being listed (used when client tax cost not found and must be done on server)
* @param pmcData Player profile
* @param requirementsPriceInRub Rouble cost player chose for listing (used when client tax cost not found and must be done on server)
* @param itemStackCount How many items were listed in player (used when client tax cost not found and must be done on server)
* @param offerRequest Add offer request object from client
* @param output IItemEventRouterResponse
* @returns True if charging tax to player failed
*/
protected chargePlayerTaxFee(sessionID: string, rootItem: Item, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean;
/** /**
* Is the item to be listed on the flea valid * Is the item to be listed on the flea valid
* @param offerRequest Client offer request * @param offerRequest Client offer request
@ -158,4 +171,11 @@ export declare class RagfairController {
*/ */
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Create a basic trader request object with price and currency type
* @param currency What currency: RUB, EURO, USD
* @param value Amount of currency
* @returns IProcessBuyTradeRequestData
*/
protected createBuyTradeRequestObject(currency: string, value: number): IProcessBuyTradeRequestData;
} }

View File

@ -14,7 +14,6 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { ItemBaseClassService } from "../services/ItemBaseClassService";
import { ItemFilterService } from "../services/ItemFilterService"; import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
@ -29,7 +28,6 @@ export declare class BotEquipmentModGenerator {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botEquipmentFilterService: BotEquipmentFilterService; protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemBaseClassService: ItemBaseClassService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected botWeaponModLimitService: BotWeaponModLimitService; protected botWeaponModLimitService: BotWeaponModLimitService;
@ -40,7 +38,7 @@ export declare class BotEquipmentModGenerator {
protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
/** /**
* Check mods are compatible and add to array * Check mods are compatible and add to array
* @param equipment Equipment item to add mods to * @param equipment Equipment item to add mods to

View File

@ -65,10 +65,11 @@ export declare class LocationGenerator {
protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[];
/** /**
* Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount
* @param groupId Name of the group the containers are being collected for
* @param containerData Containers and probability values for a groupId * @param containerData Containers and probability values for a groupId
* @returns List of chosen container Ids * @returns List of chosen container Ids
*/ */
protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; protected getContainersByProbabilty(groupId: string, containerData: IContainerGroupCount): string[];
/** /**
* Get a mapping of each groupid and the containers in that group + count of containers to spawn on map * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map
* @param containersGroups Container group values * @param containersGroups Container group values

View File

@ -31,12 +31,12 @@ export declare class PMCLootGenerator {
*/ */
generatePMCVestLootPool(): string[]; generatePMCVestLootPool(): string[];
/** /**
* Check if item has a width/height that lets it fit into a 1x2/2x1 slot * Check if item has a width/height that lets it fit into a 2x2 slot
* 1x1 / 1x2 / 2x1 * 1x1 / 1x2 / 2x1 / 2x2
* @param item Item to check size of * @param item Item to check size of
* @returns true if it fits * @returns true if it fits
*/ */
protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; protected itemFitsInto2By2Slot(item: ITemplateItem): boolean;
/** /**
* Create an array of loot items a PMC can have in their backpack * Create an array of loot items a PMC can have in their backpack
* @returns string array of tpls * @returns string array of tpls

View File

@ -55,11 +55,10 @@ export declare class RagfairOfferGenerator {
* @param items Items in the offer * @param items Items in the offer
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param price Price of offer * @param sellInOnePiece Flags sellInOnePiece to be true
* @param sellInOnePiece Set StackObjectsCount to 1
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -67,17 +66,16 @@ export declare class RagfairOfferGenerator {
* @param items Items in the offer * @param items Items in the offer
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param price Price of offer
* @param sellInOnePiece Set StackObjectsCount to 1 * @param sellInOnePiece Set StackObjectsCount to 1
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer
* @returns rouble cost of offer * @returns rouble cost of offer
*/ */
protected calculateOfferListingPrice(offerRequirements: OfferRequirement[]): number; protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number;
/** /**
* Get avatar url from trader table in db * Get avatar url from trader table in db
* @param isTrader Is user we're getting avatar for a trader * @param isTrader Is user we're getting avatar for a trader
@ -137,7 +135,7 @@ export declare class RagfairOfferGenerator {
* @param itemDetails raw db item details * @param itemDetails raw db item details
* @returns Item array * @returns Item array
*/ */
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<Item[]>; protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
/** /**
* Generate trader offers on flea using the traders assort data * Generate trader offers on flea using the traders assort data
* @param traderID Trader to generate offers for * @param traderID Trader to generate offers for
@ -151,7 +149,7 @@ export declare class RagfairOfferGenerator {
* @param itemDetails db details of first item * @param itemDetails db details of first item
* @returns * @returns
*/ */
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[]; protected randomiseItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
/** /**
* Get the relevant condition id if item tpl matches in ragfair.json/condition * Get the relevant condition id if item tpl matches in ragfair.json/condition
* @param tpl Item to look for matching condition object * @param tpl Item to look for matching condition object
@ -184,7 +182,7 @@ export declare class RagfairOfferGenerator {
* @param offerItems Items for sale in offer * @param offerItems Items for sale in offer
* @returns Barter scheme * @returns Barter scheme
*/ */
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[];
/** /**
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
* @returns array with tpl/price values * @returns array with tpl/price values
@ -196,7 +194,9 @@ export declare class RagfairOfferGenerator {
/** /**
* Create a random currency-based barter scheme for an array of items * Create a random currency-based barter scheme for an array of items
* @param offerItems Items on offer * @param offerItems Items on offer
* @param isPackOffer Is the barter scheme being created for a pack offer
* @param multipler What to multiply the resulting price by
* @returns Barter scheme for offer * @returns Barter scheme for offer
*/ */
protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[]; protected createCurrencyBarterScheme(offerItems: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
} }

View File

@ -25,6 +25,8 @@ export declare class ScavCaseRewardGenerator {
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected scavCaseConfig: IScavCaseConfig; protected scavCaseConfig: IScavCaseConfig;
protected dbItemsCache: ITemplateItem[];
protected dbAmmoItemsCache: ITemplateItem[];
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Create an array of rewards that will be given to the player upon completing their scav case build * Create an array of rewards that will be given to the player upon completing their scav case build
@ -33,10 +35,10 @@ export declare class ScavCaseRewardGenerator {
*/ */
generate(recipeId: string): Product[]; generate(recipeId: string): Product[];
/** /**
* Get all db items that are not blacklisted in scavcase config * Get all db items that are not blacklisted in scavcase config or global blacklist
* @returns filtered array of db items * Store in class field
*/ */
protected getDbItems(): ITemplateItem[]; protected cacheDbItems(): void;
/** /**
* Pick a number of items to be rewards, the count is defined by the values in * Pick a number of items to be rewards, the count is defined by the values in
* @param items item pool to pick rewards from * @param items item pool to pick rewards from

View File

@ -52,6 +52,7 @@ export declare class WeatherGenerator {
*/ */
protected setCurrentDateTime(weather: IWeather): void; protected setCurrentDateTime(weather: IWeather): void;
protected getWeightedWindDirection(): WindDirection; protected getWeightedWindDirection(): WindDirection;
protected getWeightedClouds(): number;
protected getWeightedWindSpeed(): number; protected getWeightedWindSpeed(): number;
protected getWeightedFog(): number; protected getWeightedFog(): number;
protected getWeightedRain(): number; protected getWeightedRain(): number;

View File

@ -27,6 +27,7 @@ export declare class HealthHelper {
* @param request Heal request * @param request Heal request
* @param sessionID Session id * @param sessionID Session id
* @param addEffects Should effects be added or removed (default - add) * @param addEffects Should effects be added or removed (default - add)
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
*/ */
saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**

View File

@ -53,7 +53,7 @@ export declare class InRaidHelper {
* @param victim Who was killed by player * @param victim Who was killed by player
* @returns a numerical standing gain or loss * @returns a numerical standing gain or loss
*/ */
protected getStandingChangeForKill(victim: Victim): number; protected getFenceStandingChangeForKillAsScav(victim: Victim): number;
/** /**
* Reset a profile to a baseline, used post-raid * Reset a profile to a baseline, used post-raid
* Reset points earned during session property * Reset points earned during session property

View File

@ -26,6 +26,7 @@ declare class ItemHelper {
protected itemBaseClassService: ItemBaseClassService; protected itemBaseClassService: ItemBaseClassService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected localeService: LocaleService; protected localeService: LocaleService;
protected readonly defaultInvalidBaseTypes: string[];
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService);
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
@ -67,6 +68,11 @@ declare class ItemHelper {
* @returns Price in roubles (undefined if not found) * @returns Price in roubles (undefined if not found)
*/ */
getDynamicItemPrice(tpl: string): number; getDynamicItemPrice(tpl: string): number;
/**
* Update items upd.StackObjectsCount to be 1 if its upd is missing or StackObjectsCount is undefined
* @param item Item to update
* @returns Fixed item
*/
fixItemStackCount(item: Item): Item; fixItemStackCount(item: Item): Item;
/** /**
* AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content. * AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content.
@ -125,19 +131,19 @@ declare class ItemHelper {
getItemQualityModifier(item: Item): number; getItemQualityModifier(item: Item): number;
/** /**
* Get a quality value based on a repairable items (weapon/armor) current state between current and max durability * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability
* @param itemDetails * @param itemDetails Db details for item we want quality value for
* @param repairable repairable object * @param repairable Repairable properties
* @param item * @param item Item quality value is for
* @returns a number between 0 and 1 * @returns A number between 0 and 1
*/ */
protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number;
/** /**
* Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results * Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results
* @param items * @param items Array of items (item + possible children)
* @param itemID * @param itemId Parent items id
* @returns an array of strings * @returns an array of strings
*/ */
findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; findAndReturnChildrenByItems(items: Item[], itemId: string): string[];
/** /**
* A variant of findAndReturnChildren where the output is list of item objects instead of their ids. * A variant of findAndReturnChildren where the output is list of item objects instead of their ids.
* @param items * @param items
@ -164,12 +170,6 @@ declare class ItemHelper {
* @returns true if it is a dogtag * @returns true if it is a dogtag
*/ */
isDogtag(tpl: string): boolean; isDogtag(tpl: string): boolean;
/**
* Can the item passed in be sold to a trader because it is raw money
* @param tpl Item template id to check
* @returns true if unsellable
*/
isNotSellable(tpl: string): boolean;
/** /**
* Gets the identifier for a child using slotId, locationX and locationY. * Gets the identifier for a child using slotId, locationX and locationY.
* @param item * @param item
@ -183,19 +183,19 @@ declare class ItemHelper {
*/ */
isItemTplStackable(tpl: string): boolean; isItemTplStackable(tpl: string): boolean;
/** /**
* split item stack if it exceeds its StackMaxSize property * split item stack if it exceeds its items StackMaxSize property
* @param itemToSplit item being split into smaller stacks * @param itemToSplit Item to split into smaller stacks
* @returns Array of split items * @returns Array of split items
*/ */
splitStack(itemToSplit: Item): Item[]; splitStack(itemToSplit: Item): Item[];
/** /**
* Find Barter items in the inventory * Find Barter items from array of items
* @param {string} by tpl or id * @param {string} by tpl or id
* @param {Object} pmcData * @param {Item[]} items Array of items to iterate over
* @param {string} barterItemId * @param {string} barterItemId
* @returns Array of Item objects * @returns Array of Item objects
*/ */
findBarterItems(by: "tpl" | "id", pmcData: IPmcData, barterItemId: string): Item[]; findBarterItems(by: "tpl" | "id", items: Item[], barterItemId: string): Item[];
/** /**
* Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table) * Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table)
* @param pmcData Player profile * @param pmcData Player profile
@ -262,10 +262,21 @@ declare class ItemHelper {
* @param minSizePercent % the magazine must be filled to * @param minSizePercent % the magazine must be filled to
*/ */
fillMagazineWithCartridge(magazine: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void; fillMagazineWithCartridge(magazine: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void;
/**
* Choose a random bullet type from the list of possible a magazine has
* @param magTemplate Magazine template from Db
* @returns Tpl of cartridge
*/
protected getRandomValidCaliber(magTemplate: ITemplateItem): string; protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
/**
* Chose a randomly weighted cartridge that fits
* @param caliber Desired caliber
* @param staticAmmoDist Cartridges and thier weights
* @returns Tpl of cartrdige
*/
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string; protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
/** /**
* * Create a basic cartrige object
* @param parentId container cartridges will be placed in * @param parentId container cartridges will be placed in
* @param ammoTpl Cartridge to insert * @param ammoTpl Cartridge to insert
* @param stackCount Count of cartridges inside parent * @param stackCount Count of cartridges inside parent

View File

@ -21,6 +21,7 @@ import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
import { ProfileHelper } from "./ProfileHelper"; import { ProfileHelper } from "./ProfileHelper";
import { QuestConditionHelper } from "./QuestConditionHelper";
import { RagfairServerHelper } from "./RagfairServerHelper"; import { RagfairServerHelper } from "./RagfairServerHelper";
import { TraderHelper } from "./TraderHelper"; import { TraderHelper } from "./TraderHelper";
export declare class QuestHelper { export declare class QuestHelper {
@ -29,6 +30,7 @@ export declare class QuestHelper {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected questConditionHelper: QuestConditionHelper;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
@ -41,7 +43,7 @@ export declare class QuestHelper {
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Get status of a quest in player profile by its id * Get status of a quest in player profile by its id
* @param pmcData Profile to search * @param pmcData Profile to search
@ -119,7 +121,7 @@ export declare class QuestHelper {
* @param sessionID Session id * @param sessionID Session id
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started * @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
*/ */
acceptedUnlocked(startedQuestId: string, sessionID: string): IQuest[]; getNewlyAccessibleQuestsWhenStartingQuest(startedQuestId: string, sessionID: string): IQuest[];
/** /**
* Get quests that can be shown to player after failing a quest * Get quests that can be shown to player after failing a quest
* @param failedQuestId Id of the quest failed by player * @param failedQuestId Id of the quest failed by player

View File

@ -1,4 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
@ -13,10 +14,10 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { LocaleService } from "../services/LocaleService"; import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { MailSendService } from "../services/MailSendService";
import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairOfferService } from "../services/RagfairOfferService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
import { PresetHelper } from "./PresetHelper"; import { PresetHelper } from "./PresetHelper";
@ -33,7 +34,6 @@ export declare class RagfairOfferHelper {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected dialogueHelper: DialogueHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
@ -44,11 +44,12 @@ export declare class RagfairOfferHelper {
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected static goodSoldTemplate: string; protected static goodSoldTemplate: string;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client
@ -119,19 +120,26 @@ export declare class RagfairOfferHelper {
*/ */
protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected getProfileOffers(sessionID: string): IRagfairOffer[];
/** /**
* Delete an offer from a desired profile * Delete an offer from a desired profile and from ragfair offers
* @param sessionID Session id of profile to delete offer from * @param sessionID Session id of profile to delete offer from
* @param offerId Offer id to delete * @param offerId Id of offer to delete
*/ */
protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected deleteOfferById(sessionID: string, offerId: string): void;
/** /**
* Complete the selling of players' offer * Complete the selling of players' offer
* @param sessionID Session id * @param sessionID Session id
* @param offer Sold offer details * @param offer Sold offer details
* @param boughtAmount Amount item was purchased for * @param boughtAmount Amount item was purchased for
* @returns Client response * @returns IItemEventRouterResponse
*/ */
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
/**
* Get a localised message for when players offer has sold on flea
* @param itemTpl Item sold
* @param boughtAmount How many were purchased
* @returns Localised message text
*/
protected getLocalisedOfferSoldMessage(itemTpl: string, boughtAmount: number): string;
/** /**
* Should a ragfair offer be visible to the player * Should a ragfair offer be visible to the player
* @param searchRequest Search request * @param searchRequest Search request
@ -142,4 +150,12 @@ export declare class RagfairOfferHelper {
* @returns True = should be shown to player * @returns True = should be shown to player
*/ */
isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
/**
* Is items quality value within desired range
* @param item Item to check quality of
* @param min Desired minimum quality
* @param max Desired maximum quality
* @returns True if in range
*/
protected itemQualityInRange(item: Item, min: number, max: number): boolean;
} }

View File

@ -13,12 +13,12 @@ export declare class RagfairSellHelper {
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
/** /**
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price * Get the percent chance to sell an item based on its average listed price vs player chosen listing price
* @param baseChancePercent Base chance to sell item
* @param averageOfferPriceRub Price of average offer in roubles * @param averageOfferPriceRub Price of average offer in roubles
* @param playerListedPriceRub Price player listed item for in roubles * @param playerListedPriceRub Price player listed item for in roubles
* @param qualityMultiplier Quality multipler of item being sold
* @returns percent value * @returns percent value
*/ */
calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number; calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number;
/** /**
* Get percent chance to sell an item when price is below items average listing price * 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 playerListedPriceRub Price player listed item for in roubles

View File

@ -35,7 +35,7 @@ export declare class TraderHelper {
protected highestTraderBuyPriceItems: Record<string, number>; protected highestTraderBuyPriceItems: Record<string, number>;
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer);
getTrader(traderID: string, sessionID: string): ITraderBase; getTrader(traderID: string, sessionID: string): ITraderBase;
getTraderAssortsById(traderId: string): ITraderAssort; getTraderAssortsByTraderId(traderId: string): ITraderAssort;
/** /**
* Reset a profiles trader data back to its initial state as seen by a level 1 player * Reset a profiles trader data back to its initial state as seen by a level 1 player
* Does NOT take into account different profile levels * Does NOT take into account different profile levels

View File

@ -281,7 +281,7 @@ export interface InsuredItem {
export interface Hideout { export interface Hideout {
Production: Record<string, Productive>; Production: Record<string, Productive>;
Areas: HideoutArea[]; Areas: HideoutArea[];
Improvements: Record<string, IHideoutImprovement>; Improvement: Record<string, IHideoutImprovement>;
Seed: number; Seed: number;
sptUpdateLastRunTimestamp: number; sptUpdateLastRunTimestamp: number;
} }

View File

@ -1,12 +1,14 @@
export interface IHealthTreatmentRequestData { export interface IHealthTreatmentRequestData {
Action: "RestoreHealth"; Action: "RestoreHealth";
trader: string; trader: string;
items: Item[]; items: Cost[];
difference: Difference; difference: Difference;
timestamp: number; timestamp: number;
} }
export interface Item { export interface Cost {
/** Id of stack to take money from */
id: string; id: string;
/** Amount of money to take off player for treatment */
count: number; count: number;
} }
export interface Difference { export interface Difference {
@ -25,5 +27,6 @@ export interface BodyParts {
} }
export interface BodyPart { export interface BodyPart {
Health: number; Health: number;
/** Effects in array are to be removed */
Effects: string[]; Effects: string[];
} }

View File

@ -14,6 +14,11 @@ export interface INotification {
} }
export declare enum NotificationType { export declare enum NotificationType {
RAGFAIR_OFFER_SOLD = "RagfairOfferSold", RAGFAIR_OFFER_SOLD = "RagfairOfferSold",
RAGFAIR_RATING_CHANGE = "RagfairRatingChange",
/** ChatMessageReceived */
NEW_MESSAGE = "new_message", NEW_MESSAGE = "new_message",
PING = "ping" PING = "ping",
TRADER_SUPPLY = "TraderSupply",
TRADER_STANDING = "TraderStanding",
UNLOCK_TRADER = "UnlockTrader"
} }

View File

@ -1,6 +1,3 @@
import { INotifierChannel } from "./INotifier";
export interface ISelectProfileResponse { export interface ISelectProfileResponse {
status: string; status: string;
notifier: INotifierChannel;
notifierServer: string;
} }

View File

@ -1,19 +1,19 @@
export declare enum WeatherType { export declare enum WeatherType {
CLEAR_DAY = 1, CLEAR_DAY = 0,
CLEAR_WIND = 2, CLEAR_WIND = 1,
CLEAR_NIGHT = 3, CLEAR_NIGHT = 2,
PARTLY_CLOUD_DAY = 4, PARTLY_CLOUD_DAY = 3,
PARTLY_CLOUD_NIGHT = 5, PARTLY_CLOUD_NIGHT = 4,
CLEAR_FOG_DAY = 6, CLEAR_FOG_DAY = 5,
CLEAR_FOG_NIGHT = 7, CLEAR_FOG_NIGHT = 6,
CLOUDFOG = 8, CLOUD_FOG = 7,
FOG = 9, FOG = 8,
MOSTLY_CLOUD = 10, MOSTLY_CLOUD = 9,
LIGHT_RAIN = 11, LIGHT_RAIN = 10,
RAIN = 12, RAIN = 11,
CLOUD_WIND = 13, CLOUD_WIND = 12,
CLOUD_WIND_RAIN = 14, CLOUD_WIND_RAIN = 13,
FULL_CLOUD = 15, FULL_CLOUD = 14,
THUNDER_CLOUD = 16, THUNDER_CLOUD = 15,
NONE = 0 NONE = 16
} }

View File

@ -41,7 +41,8 @@ export interface Dynamic {
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
useTraderPriceForOffersIfHigher: boolean; useTraderPriceForOffersIfHigher: boolean;
/** Barter offer specific settings */ /** Barter offer specific settings */
barter: Barter; barter: IBarterDetails;
pack: IPackDetails;
/** Dynamic offer price below handbook adjustment values */ /** Dynamic offer price below handbook adjustment values */
offerAdjustment: OfferAdjustment; offerAdjustment: OfferAdjustment;
/** How many offers should expire before an offer regeneration occurs */ /** How many offers should expire before an offer regeneration occurs */
@ -49,9 +50,7 @@ export interface Dynamic {
/** How many offers should be listed */ /** How many offers should be listed */
offerItemCount: MinMax; offerItemCount: MinMax;
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */ /** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
price: MinMax; priceRanges: IPriceRanges;
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
presetPrice: MinMax;
/** Should default presets to listed only or should non-standard presets found in globals.json be listed too */ /** Should default presets to listed only or should non-standard presets found in globals.json be listed too */
showDefaultPresetsOnly: boolean; showDefaultPresetsOnly: boolean;
endTimeSeconds: MinMax; endTimeSeconds: MinMax;
@ -74,7 +73,12 @@ export interface Dynamic {
/** Dict of price limits keyed by item type */ /** Dict of price limits keyed by item type */
unreasonableModPrices: Record<string, IUnreasonableModPrices>; unreasonableModPrices: Record<string, IUnreasonableModPrices>;
} }
export interface Barter { export interface IPriceRanges {
default: MinMax;
preset: MinMax;
pack: MinMax;
}
export interface IBarterDetails {
/** Should barter offers be generated */ /** Should barter offers be generated */
enable: boolean; enable: boolean;
/** Percentage change an offer is listed as a barter */ /** Percentage change an offer is listed as a barter */
@ -90,6 +94,18 @@ export interface Barter {
/** Item Tpls to never be turned into a barter */ /** Item Tpls to never be turned into a barter */
itemTypeBlacklist: string[]; itemTypeBlacklist: string[];
} }
export interface IPackDetails {
/** Should pack offers be generated */
enable: boolean;
/** Percentage change an offer is listed as a pack */
chancePercent: number;
/** Min number of required items for a pack */
itemCountMin: number;
/** Max number of required items for a pack */
itemCountMax: number;
/** item types to allow being a pack */
itemTypeWhitelist: string[];
}
export interface OfferAdjustment { export interface OfferAdjustment {
/** Shuld offer price be adjusted when below handbook price */ /** Shuld offer price be adjusted when below handbook price */
adjustPriceWhenBelowHandbookPrice: boolean; adjustPriceWhenBelowHandbookPrice: boolean;

View File

@ -7,7 +7,7 @@ export interface IWeatherConfig extends IBaseConfig {
weather: Weather; weather: Weather;
} }
export interface Weather { export interface Weather {
clouds: MinMax; clouds: WeatherSettings<string>;
windSpeed: WeatherSettings<number>; windSpeed: WeatherSettings<number>;
windDirection: WeatherSettings<WindDirection>; windDirection: WeatherSettings<WindDirection>;
windGustiness: MinMax; windGustiness: MinMax;

View File

@ -11,7 +11,18 @@ export declare class HashCacheService {
protected modHashes: any; protected modHashes: any;
protected readonly modCachePath = "./user/cache/modCache.json"; protected readonly modCachePath = "./user/cache/modCache.json";
constructor(vfs: VFS, hashUtil: HashUtil, jsonUtil: JsonUtil, logger: ILogger); constructor(vfs: VFS, hashUtil: HashUtil, jsonUtil: JsonUtil, logger: ILogger);
/**
* Return a stored hash by key
* @param modName Name of mod to get hash for
* @returns Mod hash
*/
getStoredModHash(modName: string): string; getStoredModHash(modName: string): string;
/**
* Does the generated hash match the stored hash
* @param modName name of mod
* @param modContent
* @returns True if they match
*/
modContentMatchesStoredHash(modName: string, modContent: string): boolean; modContentMatchesStoredHash(modName: string, modContent: string): boolean;
hashMatchesStoredHash(modName: string, modHash: string): boolean; hashMatchesStoredHash(modName: string, modHash: string): boolean;
storeModContent(modName: string, modContent: string): void; storeModContent(modName: string, modContent: string): void;

View File

@ -35,7 +35,7 @@ export declare class MailSendService {
* @param items Optional items to send to player * @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire * @param maxStorageTimeSeconds Optional time to collect items before they expire
*/ */
sendDirectNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; sendDirectNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void;
/** /**
* Send a message from an NPC (e.g. prapor) to the player with or without items * Send a message from an NPC (e.g. prapor) to the player with or without items
* @param playerId Players id to send message to * @param playerId Players id to send message to
@ -45,7 +45,7 @@ export declare class MailSendService {
* @param items Optional items to send to player * @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire * @param maxStorageTimeSeconds Optional time to collect items before they expire
*/ */
sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void;
/** /**
* Send a message from SYSTEM to the player with or without items * Send a message from SYSTEM to the player with or without items
* @param playerId Players id to send message to * @param playerId Players id to send message to

View File

@ -1,7 +1,7 @@
import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { LocalisationService } from "./LocalisationService"; import { LocalisationService } from "./LocalisationService";
/** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */ /** Cache bots in a dictionary, keyed by the bots name, keying by name isnt ideal as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */
export declare class MatchBotDetailsCacheService { export declare class MatchBotDetailsCacheService {
protected logger: ILogger; protected logger: ILogger;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
@ -17,9 +17,9 @@ export declare class MatchBotDetailsCacheService {
*/ */
clearCache(): void; clearCache(): void;
/** /**
* Find a bot in the cache by its name * Find a bot in the cache by its name and side
* @param botName Name of bot to find * @param botName Name of bot to find
* @returns Bot details * @returns Bot details
*/ */
getBotByName(botName: string): IBotBase; getBotByNameAndSide(botName: string, botSide: string): IBotBase;
} }

View File

@ -1,14 +1,36 @@
import { CompilerOptions } from "typescript"; import { CompilerOptions } from "typescript";
import type { ILogger } from "../models/spt/utils/ILogger"; import type { ILogger } from "../models/spt/utils/ILogger";
import { HashCacheService } from "./HashCacheService";
import { VFS } from "../utils/VFS"; import { VFS } from "../utils/VFS";
import { HashCacheService } from "./HashCacheService";
export declare class ModCompilerService { export declare class ModCompilerService {
protected logger: ILogger; protected logger: ILogger;
protected hashCacheService: HashCacheService; protected hashCacheService: HashCacheService;
protected vfs: VFS; protected vfs: VFS;
constructor(logger: ILogger, hashCacheService: HashCacheService, vfs: VFS); constructor(logger: ILogger, hashCacheService: HashCacheService, vfs: VFS);
/**
* Convert a mods TS into JS
* @param modName Name of mod
* @param modPath Dir path to mod
* @param modTypeScriptFiles
* @returns
*/
compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void>; compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void>;
/**
* Convert a TS file into JS
* @param fileNames Paths to TS files
* @param options Compiler options
*/
protected compile(fileNames: string[], options: CompilerOptions): Promise<void>; protected compile(fileNames: string[], options: CompilerOptions): Promise<void>;
/**
* Do the files at the provided paths exist
* @param fileNames
* @returns
*/
protected areFilesReady(fileNames: string[]): boolean; protected areFilesReady(fileNames: string[]): boolean;
/**
* Wait the provided number of milliseconds
* @param ms Milliseconds
* @returns
*/
protected delay(ms: number): Promise<unknown>; protected delay(ms: number): Promise<unknown>;
} }

View File

@ -61,23 +61,26 @@ export declare class PaymentService {
* Get all money stacks in inventory and prioritse items in stash * Get all money stacks in inventory and prioritse items in stash
* @param pmcData * @param pmcData
* @param currencyTpl * @param currencyTpl
* @param playerStashId Players stash id
* @returns Sorting money items * @returns Sorting money items
*/ */
protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string): Item[]; protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string, playerStashId: string): Item[];
/** /**
* Prioritise player stash first over player inventory * Prioritise player stash first over player inventory
* Post-raid healing would often take money out of the players pockets/secure container * Post-raid healing would often take money out of the players pockets/secure container
* @param a First money stack item * @param a First money stack item
* @param b Second money stack item * @param b Second money stack item
* @param inventoryItems players inventory items * @param inventoryItems players inventory items
* @param playerStashId Players stash id
* @returns sort order * @returns sort order
*/ */
protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number; protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[], playerStashId: string): number;
/** /**
* Recursivly check items parents to see if it is inside the players inventory, not stash * Recursivly check items parents to see if it is inside the players inventory, not stash
* @param itemId item id to check * @param itemId item id to check
* @param inventoryItems player inventory * @param inventoryItems player inventory
* @param playerStashId Players stash id
* @returns true if its in inventory * @returns true if its in inventory
*/ */
protected isInInventory(itemId: string, inventoryItems: Item[]): boolean; protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean;
} }

View File

@ -14,6 +14,7 @@ import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { Watermark } from "../utils/Watermark"; import { Watermark } from "../utils/Watermark";
import { LocalisationService } from "./LocalisationService"; import { LocalisationService } from "./LocalisationService";
@ -27,17 +28,19 @@ export declare class ProfileFixerService {
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, databaseServer: DatabaseServer, configServer: ConfigServer); constructor(logger: ILogger, watermark: Watermark, hideoutHelper: HideoutHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, profileHelper: ProfileHelper, itemHelper: ItemHelper, localisationService: LocalisationService, timeUtil: TimeUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
/** /**
* Find issues in the pmc profile data that may cause issues and fix them * Find issues in the pmc profile data that may cause issues and fix them
* @param pmcProfile profile to check and fix * @param pmcProfile profile to check and fix
*/ */
checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void; checkForAndFixPmcProfileIssues(pmcProfile: IPmcData): void;
protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void;
protected ensureGunStandLevelsMatch(pmcProfile: IPmcData): void;
protected addHideoutAreaStashes(pmcProfile: IPmcData): void; protected addHideoutAreaStashes(pmcProfile: IPmcData): void;
protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void;
protected adjustUnreasonableModFleaPrices(): void; protected adjustUnreasonableModFleaPrices(): void;
@ -131,4 +134,9 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to add missing IDs to * @param pmcProfile Profile to add missing IDs to
*/ */
addMissingIdsToBonuses(pmcProfile: IPmcData): void; addMissingIdsToBonuses(pmcProfile: IPmcData): void;
/**
* At some point the property name was changed,migrate data across to new name
* @param pmcProfile
*/
protected migrateImprovements(pmcProfile: IPmcData): void;
} }

View File

@ -3,6 +3,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper"; import { PresetHelper } from "../helpers/PresetHelper";
import { TraderHelper } from "../helpers/TraderHelper"; import { TraderHelper } from "../helpers/TraderHelper";
import { MinMax } from "../models/common/MinMax";
import { IPreset } from "../models/eft/common/IGlobals"; import { IPreset } from "../models/eft/common/IGlobals";
import { Item } from "../models/eft/common/tables/IItem"; import { Item } from "../models/eft/common/tables/IItem";
import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IBarterScheme } from "../models/eft/common/tables/ITrader";
@ -35,10 +36,6 @@ export declare class RagfairPriceService implements OnLoad {
* Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries * Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries
*/ */
onLoad(): Promise<void>; onLoad(): Promise<void>;
/**
* Add placeholder values for items missing from handbook
*/
protected addMissingHandbookPrices(): void;
getRoute(): string; getRoute(): string;
/** /**
* Iterate over all items of type "Item" in db and get template price, store in cache * Iterate over all items of type "Item" in db and get template price, store in cache
@ -91,9 +88,17 @@ export declare class RagfairPriceService implements OnLoad {
* Generate a currency cost for an item and its mods * Generate a currency cost for an item and its mods
* @param items Item with mods to get price for * @param items Item with mods to get price for
* @param desiredCurrency Currency price desired in * @param desiredCurrency Currency price desired in
* @param isPackOffer Price is for a pack type offer
* @returns cost of item in desired currency * @returns cost of item in desired currency
*/ */
getDynamicOfferPrice(items: Item[], desiredCurrency: string): number; getDynamicOfferPriceForOffer(items: Item[], desiredCurrency: string, isPackOffer: boolean): number;
/**
* Get different min/max price multipliers for different offer types (preset/pack/default)
* @param isPreset Offer is a preset
* @param isPack Offer is a pack
* @returns MinMax values
*/
protected getOfferTypeRangeValues(isPreset: boolean, isPack: boolean): MinMax;
/** /**
* Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json * Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json
* @param itemPrice price of item * @param itemPrice price of item
@ -104,10 +109,10 @@ export declare class RagfairPriceService implements OnLoad {
/** /**
* Multiply the price by a randomised curve where n = 2, shift = 2 * Multiply the price by a randomised curve where n = 2, shift = 2
* @param existingPrice price to alter * @param existingPrice price to alter
* @param isPreset is the item we're multiplying a preset * @param rangeValues min and max to adjust price by
* @returns multiplied price * @returns multiplied price
*/ */
protected randomisePrice(existingPrice: number, isPreset: boolean): number; protected randomiseOfferPrice(existingPrice: number, rangeValues: MinMax): number;
/** /**
* Calculate the cost of a weapon preset by adding together the price of its mods + base price of default weapon preset * Calculate the cost of a weapon preset by adding together the price of its mods + base price of default weapon preset
* @param item base weapon * @param item base weapon

View File

@ -1,4 +1,5 @@
import { GameController } from "../controllers/GameController"; import { GameController } from "../controllers/GameController";
import { OnLoad } from "../di/OnLoad";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse"; import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
@ -15,12 +16,14 @@ import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { Watermark } from "../utils/Watermark"; import { Watermark } from "../utils/Watermark";
declare class GameCallbacks { declare class GameCallbacks implements OnLoad {
protected httpResponse: HttpResponseUtil; protected httpResponse: HttpResponseUtil;
protected watermark: Watermark; protected watermark: Watermark;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected gameController: GameController; protected gameController: GameController;
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController); constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController);
onLoad(): Promise<void>;
getRoute(): string;
/** /**
* Handle client/game/version/validate * Handle client/game/version/validate
* @returns INullResponseData * @returns INullResponseData

View File

@ -61,13 +61,14 @@ export declare class GameController {
protected pmcConfig: IPmcConfig; protected pmcConfig: IPmcConfig;
protected lootConfig: ILootConfig; protected lootConfig: ILootConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
load(): void;
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected addCustomLooseLootPositions(): void; protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void; protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void; protected setHideoutAreasAndCraftsTo40Secs(): void;
/** /**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated
* We store the old AID value in new field `sessionId` * We store the old AID value in new field `sessionId`

View File

@ -29,34 +29,35 @@ export declare class HealthController {
* stores in-raid player health * stores in-raid player health
* @param pmcData Player profile * @param pmcData Player profile
* @param info Request data * @param info Request data
* @param sessionID * @param sessionID Player id
* @param addEffects Should effects found be added or removed from profile * @param addEffects Should effects found be added or removed from profile
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
*/ */
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**
* When healing in menu * When healing in menu
* @param pmcData * @param pmcData Player profile
* @param body * @param request Healing request
* @param sessionID * @param sessionID Player id
* @returns * @returns IItemEventRouterResponse
*/ */
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidHeal(pmcData: IPmcData, request: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle Eat event * Handle Eat event
* Consume food/water outside of a raid * Consume food/water outside of a raid
* @param pmcData Player profile * @param pmcData Player profile
* @param body request Object * @param request Eat request
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, request: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
* Handle RestoreHealth event * Handle RestoreHealth event
* Occurs on post-raid healing page * Occurs on post-raid healing page
* @param pmcData player profile * @param pmcData player profile
* @param healthTreatmentRequest Request data from client * @param healthTreatmentRequest Request data from client
* @param sessionID Session id * @param sessionID Session id
* @returns * @returns IItemEventRouterResponse
*/ */
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
/** /**
@ -66,12 +67,4 @@ export declare class HealthController {
* @param sessionID * @param sessionID
*/ */
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void; applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
/**
* Iterate over treatment request diff and find effects to remove from player limbs
* @param sessionId
* @param profile Profile to update
* @param treatmentRequest client request
* @param output response to send to client
*/
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void;
} }

View File

@ -88,11 +88,11 @@ export declare class HideoutController {
* @param pmcData Profile to edit * @param pmcData Profile to edit
* @param output Object to send back to client * @param output Object to send back to client
* @param sessionID Session/player id * @param sessionID Session/player id
* @param profileHideoutArea Current hideout data for profile * @param profileParentHideoutArea Current hideout area for profile
* @param dbHideoutArea Hideout area being upgraded * @param dbHideoutArea Hideout area being upgraded
* @param hideoutStage Stage hideout area is being upgraded to * @param hideoutStage Stage hideout area is being upgraded to
*/ */
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void;
/** /**
* Add an inventory item to profile from a hideout area stage data * Add an inventory item to profile from a hideout area stage data
* @param pmcData Profile to update * @param pmcData Profile to update

View File

@ -4,6 +4,7 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { ILocationBase } from "../models/eft/common/ILocationBase"; import { ILocationBase } from "../models/eft/common/ILocationBase";
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase"; import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult"; import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
import { AirdropTypeEnum } from "../models/enums/AirdropType"; import { AirdropTypeEnum } from "../models/enums/AirdropType";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig"; import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
@ -34,10 +35,11 @@ export declare class LocationController {
/** /**
* Handle client/location/getLocalloot * Handle client/location/getLocalloot
* Get a location (map) with generated loot data * Get a location (map) with generated loot data
* @param location Map to generate loot for * @param sessionId Player id
* @param request Map request to generate
* @returns ILocationBase * @returns ILocationBase
*/ */
get(location: string): ILocationBase; get(sessionId: string, request: IGetLocationRequestData): ILocationBase;
/** /**
* Generate a maps base location with loot * Generate a maps base location with loot
* @param name Map name * @param name Map name

View File

@ -61,7 +61,7 @@ export declare class QuestController {
* @param playerLevel level of player to test against quest * @param playerLevel level of player to test against quest
* @returns true if quest can be seen/accepted by player of defined level * @returns true if quest can be seen/accepted by player of defined level
*/ */
protected playerLevelFulfillsQuestRequrement(quest: IQuest, playerLevel: number): boolean; protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean;
/** /**
* Should a quest be shown to the player in trader quest screen * Should a quest be shown to the player in trader quest screen
* @param questId Quest to check * @param questId Quest to check

View File

@ -21,6 +21,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer"; import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder"; import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -125,6 +126,18 @@ export declare class RagfairController {
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse; addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Charge player a listing fee for using flea, pulls charge from data previously sent by client
* @param sessionID Player id
* @param rootItem Base item being listed (used when client tax cost not found and must be done on server)
* @param pmcData Player profile
* @param requirementsPriceInRub Rouble cost player chose for listing (used when client tax cost not found and must be done on server)
* @param itemStackCount How many items were listed in player (used when client tax cost not found and must be done on server)
* @param offerRequest Add offer request object from client
* @param output IItemEventRouterResponse
* @returns True if charging tax to player failed
*/
protected chargePlayerTaxFee(sessionID: string, rootItem: Item, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean;
/** /**
* Is the item to be listed on the flea valid * Is the item to be listed on the flea valid
* @param offerRequest Client offer request * @param offerRequest Client offer request
@ -158,4 +171,11 @@ export declare class RagfairController {
*/ */
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse; removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Create a basic trader request object with price and currency type
* @param currency What currency: RUB, EURO, USD
* @param value Amount of currency
* @returns IProcessBuyTradeRequestData
*/
protected createBuyTradeRequestObject(currency: string, value: number): IProcessBuyTradeRequestData;
} }

View File

@ -14,7 +14,6 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { ItemBaseClassService } from "../services/ItemBaseClassService";
import { ItemFilterService } from "../services/ItemFilterService"; import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
@ -29,7 +28,6 @@ export declare class BotEquipmentModGenerator {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected botEquipmentFilterService: BotEquipmentFilterService; protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemBaseClassService: ItemBaseClassService;
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
protected botWeaponModLimitService: BotWeaponModLimitService; protected botWeaponModLimitService: BotWeaponModLimitService;
@ -40,7 +38,7 @@ export declare class BotEquipmentModGenerator {
protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
/** /**
* Check mods are compatible and add to array * Check mods are compatible and add to array
* @param equipment Equipment item to add mods to * @param equipment Equipment item to add mods to

View File

@ -65,10 +65,11 @@ export declare class LocationGenerator {
protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[]; protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[];
/** /**
* Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount * Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount
* @param groupId Name of the group the containers are being collected for
* @param containerData Containers and probability values for a groupId * @param containerData Containers and probability values for a groupId
* @returns List of chosen container Ids * @returns List of chosen container Ids
*/ */
protected getContainersByProbabilty(containerData: IContainerGroupCount): string[]; protected getContainersByProbabilty(groupId: string, containerData: IContainerGroupCount): string[];
/** /**
* Get a mapping of each groupid and the containers in that group + count of containers to spawn on map * Get a mapping of each groupid and the containers in that group + count of containers to spawn on map
* @param containersGroups Container group values * @param containersGroups Container group values

View File

@ -31,12 +31,12 @@ export declare class PMCLootGenerator {
*/ */
generatePMCVestLootPool(): string[]; generatePMCVestLootPool(): string[];
/** /**
* Check if item has a width/height that lets it fit into a 1x2/2x1 slot * Check if item has a width/height that lets it fit into a 2x2 slot
* 1x1 / 1x2 / 2x1 * 1x1 / 1x2 / 2x1 / 2x2
* @param item Item to check size of * @param item Item to check size of
* @returns true if it fits * @returns true if it fits
*/ */
protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; protected itemFitsInto2By2Slot(item: ITemplateItem): boolean;
/** /**
* Create an array of loot items a PMC can have in their backpack * Create an array of loot items a PMC can have in their backpack
* @returns string array of tpls * @returns string array of tpls

View File

@ -55,11 +55,10 @@ export declare class RagfairOfferGenerator {
* @param items Items in the offer * @param items Items in the offer
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param price Price of offer * @param sellInOnePiece Flags sellInOnePiece to be true
* @param sellInOnePiece Set StackObjectsCount to 1
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Create an offer object ready to send to ragfairOfferService.addOffer() * Create an offer object ready to send to ragfairOfferService.addOffer()
* @param userID Owner of the offer * @param userID Owner of the offer
@ -67,17 +66,16 @@ export declare class RagfairOfferGenerator {
* @param items Items in the offer * @param items Items in the offer
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param price Price of offer
* @param sellInOnePiece Set StackObjectsCount to 1 * @param sellInOnePiece Set StackObjectsCount to 1
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer; protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
/** /**
* Calculate the offer price that's listed on the flea listing * Calculate the offer price that's listed on the flea listing
* @param offerRequirements barter requirements for offer * @param offerRequirements barter requirements for offer
* @returns rouble cost of offer * @returns rouble cost of offer
*/ */
protected calculateOfferListingPrice(offerRequirements: OfferRequirement[]): number; protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number;
/** /**
* Get avatar url from trader table in db * Get avatar url from trader table in db
* @param isTrader Is user we're getting avatar for a trader * @param isTrader Is user we're getting avatar for a trader
@ -137,7 +135,7 @@ export declare class RagfairOfferGenerator {
* @param itemDetails raw db item details * @param itemDetails raw db item details
* @returns Item array * @returns Item array
*/ */
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<Item[]>; protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
/** /**
* Generate trader offers on flea using the traders assort data * Generate trader offers on flea using the traders assort data
* @param traderID Trader to generate offers for * @param traderID Trader to generate offers for
@ -151,7 +149,7 @@ export declare class RagfairOfferGenerator {
* @param itemDetails db details of first item * @param itemDetails db details of first item
* @returns * @returns
*/ */
protected getItemCondition(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[]; protected randomiseItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
/** /**
* Get the relevant condition id if item tpl matches in ragfair.json/condition * Get the relevant condition id if item tpl matches in ragfair.json/condition
* @param tpl Item to look for matching condition object * @param tpl Item to look for matching condition object
@ -184,7 +182,7 @@ export declare class RagfairOfferGenerator {
* @param offerItems Items for sale in offer * @param offerItems Items for sale in offer
* @returns Barter scheme * @returns Barter scheme
*/ */
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[]; protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[];
/** /**
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
* @returns array with tpl/price values * @returns array with tpl/price values
@ -196,7 +194,9 @@ export declare class RagfairOfferGenerator {
/** /**
* Create a random currency-based barter scheme for an array of items * Create a random currency-based barter scheme for an array of items
* @param offerItems Items on offer * @param offerItems Items on offer
* @param isPackOffer Is the barter scheme being created for a pack offer
* @param multipler What to multiply the resulting price by
* @returns Barter scheme for offer * @returns Barter scheme for offer
*/ */
protected createCurrencyRequirement(offerItems: Item[]): IBarterScheme[]; protected createCurrencyBarterScheme(offerItems: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
} }

View File

@ -25,6 +25,8 @@ export declare class ScavCaseRewardGenerator {
protected itemFilterService: ItemFilterService; protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected scavCaseConfig: IScavCaseConfig; protected scavCaseConfig: IScavCaseConfig;
protected dbItemsCache: ITemplateItem[];
protected dbAmmoItemsCache: ITemplateItem[];
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
/** /**
* Create an array of rewards that will be given to the player upon completing their scav case build * Create an array of rewards that will be given to the player upon completing their scav case build
@ -33,10 +35,10 @@ export declare class ScavCaseRewardGenerator {
*/ */
generate(recipeId: string): Product[]; generate(recipeId: string): Product[];
/** /**
* Get all db items that are not blacklisted in scavcase config * Get all db items that are not blacklisted in scavcase config or global blacklist
* @returns filtered array of db items * Store in class field
*/ */
protected getDbItems(): ITemplateItem[]; protected cacheDbItems(): void;
/** /**
* Pick a number of items to be rewards, the count is defined by the values in * Pick a number of items to be rewards, the count is defined by the values in
* @param items item pool to pick rewards from * @param items item pool to pick rewards from

View File

@ -52,6 +52,7 @@ export declare class WeatherGenerator {
*/ */
protected setCurrentDateTime(weather: IWeather): void; protected setCurrentDateTime(weather: IWeather): void;
protected getWeightedWindDirection(): WindDirection; protected getWeightedWindDirection(): WindDirection;
protected getWeightedClouds(): number;
protected getWeightedWindSpeed(): number; protected getWeightedWindSpeed(): number;
protected getWeightedFog(): number; protected getWeightedFog(): number;
protected getWeightedRain(): number; protected getWeightedRain(): number;

View File

@ -27,6 +27,7 @@ export declare class HealthHelper {
* @param request Heal request * @param request Heal request
* @param sessionID Session id * @param sessionID Session id
* @param addEffects Should effects be added or removed (default - add) * @param addEffects Should effects be added or removed (default - add)
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
*/ */
saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; saveVitality(pmcData: IPmcData, request: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/** /**

View File

@ -53,7 +53,7 @@ export declare class InRaidHelper {
* @param victim Who was killed by player * @param victim Who was killed by player
* @returns a numerical standing gain or loss * @returns a numerical standing gain or loss
*/ */
protected getStandingChangeForKill(victim: Victim): number; protected getFenceStandingChangeForKillAsScav(victim: Victim): number;
/** /**
* Reset a profile to a baseline, used post-raid * Reset a profile to a baseline, used post-raid
* Reset points earned during session property * Reset points earned during session property

View File

@ -26,6 +26,7 @@ declare class ItemHelper {
protected itemBaseClassService: ItemBaseClassService; protected itemBaseClassService: ItemBaseClassService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected localeService: LocaleService; protected localeService: LocaleService;
protected readonly defaultInvalidBaseTypes: string[];
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService); constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService);
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
@ -67,6 +68,11 @@ declare class ItemHelper {
* @returns Price in roubles (undefined if not found) * @returns Price in roubles (undefined if not found)
*/ */
getDynamicItemPrice(tpl: string): number; getDynamicItemPrice(tpl: string): number;
/**
* Update items upd.StackObjectsCount to be 1 if its upd is missing or StackObjectsCount is undefined
* @param item Item to update
* @returns Fixed item
*/
fixItemStackCount(item: Item): Item; fixItemStackCount(item: Item): Item;
/** /**
* AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content. * AmmoBoxes contain StackSlots which need to be filled for the AmmoBox to have content.
@ -125,19 +131,19 @@ declare class ItemHelper {
getItemQualityModifier(item: Item): number; getItemQualityModifier(item: Item): number;
/** /**
* Get a quality value based on a repairable items (weapon/armor) current state between current and max durability * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability
* @param itemDetails * @param itemDetails Db details for item we want quality value for
* @param repairable repairable object * @param repairable Repairable properties
* @param item * @param item Item quality value is for
* @returns a number between 0 and 1 * @returns A number between 0 and 1
*/ */
protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number;
/** /**
* Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results * Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results
* @param items * @param items Array of items (item + possible children)
* @param itemID * @param itemId Parent items id
* @returns an array of strings * @returns an array of strings
*/ */
findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; findAndReturnChildrenByItems(items: Item[], itemId: string): string[];
/** /**
* A variant of findAndReturnChildren where the output is list of item objects instead of their ids. * A variant of findAndReturnChildren where the output is list of item objects instead of their ids.
* @param items * @param items
@ -164,12 +170,6 @@ declare class ItemHelper {
* @returns true if it is a dogtag * @returns true if it is a dogtag
*/ */
isDogtag(tpl: string): boolean; isDogtag(tpl: string): boolean;
/**
* Can the item passed in be sold to a trader because it is raw money
* @param tpl Item template id to check
* @returns true if unsellable
*/
isNotSellable(tpl: string): boolean;
/** /**
* Gets the identifier for a child using slotId, locationX and locationY. * Gets the identifier for a child using slotId, locationX and locationY.
* @param item * @param item
@ -183,19 +183,19 @@ declare class ItemHelper {
*/ */
isItemTplStackable(tpl: string): boolean; isItemTplStackable(tpl: string): boolean;
/** /**
* split item stack if it exceeds its StackMaxSize property * split item stack if it exceeds its items StackMaxSize property
* @param itemToSplit item being split into smaller stacks * @param itemToSplit Item to split into smaller stacks
* @returns Array of split items * @returns Array of split items
*/ */
splitStack(itemToSplit: Item): Item[]; splitStack(itemToSplit: Item): Item[];
/** /**
* Find Barter items in the inventory * Find Barter items from array of items
* @param {string} by tpl or id * @param {string} by tpl or id
* @param {Object} pmcData * @param {Item[]} items Array of items to iterate over
* @param {string} barterItemId * @param {string} barterItemId
* @returns Array of Item objects * @returns Array of Item objects
*/ */
findBarterItems(by: "tpl" | "id", pmcData: IPmcData, barterItemId: string): Item[]; findBarterItems(by: "tpl" | "id", items: Item[], barterItemId: string): Item[];
/** /**
* Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table) * Regenerate all guids with new ids, exceptions are for items that cannot be altered (e.g. stash/sorting table)
* @param pmcData Player profile * @param pmcData Player profile
@ -262,10 +262,21 @@ declare class ItemHelper {
* @param minSizePercent % the magazine must be filled to * @param minSizePercent % the magazine must be filled to
*/ */
fillMagazineWithCartridge(magazine: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void; fillMagazineWithCartridge(magazine: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void;
/**
* Choose a random bullet type from the list of possible a magazine has
* @param magTemplate Magazine template from Db
* @returns Tpl of cartridge
*/
protected getRandomValidCaliber(magTemplate: ITemplateItem): string; protected getRandomValidCaliber(magTemplate: ITemplateItem): string;
/**
* Chose a randomly weighted cartridge that fits
* @param caliber Desired caliber
* @param staticAmmoDist Cartridges and thier weights
* @returns Tpl of cartrdige
*/
protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string; protected drawAmmoTpl(caliber: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): string;
/** /**
* * Create a basic cartrige object
* @param parentId container cartridges will be placed in * @param parentId container cartridges will be placed in
* @param ammoTpl Cartridge to insert * @param ammoTpl Cartridge to insert
* @param stackCount Count of cartridges inside parent * @param stackCount Count of cartridges inside parent

View File

@ -21,6 +21,7 @@ import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
import { ProfileHelper } from "./ProfileHelper"; import { ProfileHelper } from "./ProfileHelper";
import { QuestConditionHelper } from "./QuestConditionHelper";
import { RagfairServerHelper } from "./RagfairServerHelper"; import { RagfairServerHelper } from "./RagfairServerHelper";
import { TraderHelper } from "./TraderHelper"; import { TraderHelper } from "./TraderHelper";
export declare class QuestHelper { export declare class QuestHelper {
@ -29,6 +30,7 @@ export declare class QuestHelper {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected hashUtil: HashUtil; protected hashUtil: HashUtil;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected questConditionHelper: QuestConditionHelper;
protected eventOutputHolder: EventOutputHolder; protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
@ -41,7 +43,7 @@ export declare class QuestHelper {
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer); constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Get status of a quest in player profile by its id * Get status of a quest in player profile by its id
* @param pmcData Profile to search * @param pmcData Profile to search
@ -119,7 +121,7 @@ export declare class QuestHelper {
* @param sessionID Session id * @param sessionID Session id
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started * @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
*/ */
acceptedUnlocked(startedQuestId: string, sessionID: string): IQuest[]; getNewlyAccessibleQuestsWhenStartingQuest(startedQuestId: string, sessionID: string): IQuest[];
/** /**
* Get quests that can be shown to player after failing a quest * Get quests that can be shown to player after failing a quest
* @param failedQuestId Id of the quest failed by player * @param failedQuestId Id of the quest failed by player

View File

@ -1,4 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData"; import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITraderAssort } from "../models/eft/common/tables/ITrader"; import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
@ -13,10 +14,10 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer"; import { SaveServer } from "../servers/SaveServer";
import { LocaleService } from "../services/LocaleService"; import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService"; import { LocalisationService } from "../services/LocalisationService";
import { MailSendService } from "../services/MailSendService";
import { RagfairOfferService } from "../services/RagfairOfferService"; import { RagfairOfferService } from "../services/RagfairOfferService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
import { DialogueHelper } from "./DialogueHelper";
import { ItemHelper } from "./ItemHelper"; import { ItemHelper } from "./ItemHelper";
import { PaymentHelper } from "./PaymentHelper"; import { PaymentHelper } from "./PaymentHelper";
import { PresetHelper } from "./PresetHelper"; import { PresetHelper } from "./PresetHelper";
@ -33,7 +34,6 @@ export declare class RagfairOfferHelper {
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected traderHelper: TraderHelper; protected traderHelper: TraderHelper;
protected saveServer: SaveServer; protected saveServer: SaveServer;
protected dialogueHelper: DialogueHelper;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected paymentHelper: PaymentHelper; protected paymentHelper: PaymentHelper;
protected presetHelper: PresetHelper; protected presetHelper: PresetHelper;
@ -44,11 +44,12 @@ export declare class RagfairOfferHelper {
protected ragfairOfferService: RagfairOfferService; protected ragfairOfferService: RagfairOfferService;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected static goodSoldTemplate: string; protected static goodSoldTemplate: string;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer);
/** /**
* Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see
* @param searchRequest Data from client * @param searchRequest Data from client
@ -119,19 +120,26 @@ export declare class RagfairOfferHelper {
*/ */
protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected getProfileOffers(sessionID: string): IRagfairOffer[];
/** /**
* Delete an offer from a desired profile * Delete an offer from a desired profile and from ragfair offers
* @param sessionID Session id of profile to delete offer from * @param sessionID Session id of profile to delete offer from
* @param offerId Offer id to delete * @param offerId Id of offer to delete
*/ */
protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected deleteOfferById(sessionID: string, offerId: string): void;
/** /**
* Complete the selling of players' offer * Complete the selling of players' offer
* @param sessionID Session id * @param sessionID Session id
* @param offer Sold offer details * @param offer Sold offer details
* @param boughtAmount Amount item was purchased for * @param boughtAmount Amount item was purchased for
* @returns Client response * @returns IItemEventRouterResponse
*/ */
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
/**
* Get a localised message for when players offer has sold on flea
* @param itemTpl Item sold
* @param boughtAmount How many were purchased
* @returns Localised message text
*/
protected getLocalisedOfferSoldMessage(itemTpl: string, boughtAmount: number): string;
/** /**
* Should a ragfair offer be visible to the player * Should a ragfair offer be visible to the player
* @param searchRequest Search request * @param searchRequest Search request
@ -142,4 +150,12 @@ export declare class RagfairOfferHelper {
* @returns True = should be shown to player * @returns True = should be shown to player
*/ */
isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
/**
* Is items quality value within desired range
* @param item Item to check quality of
* @param min Desired minimum quality
* @param max Desired maximum quality
* @returns True if in range
*/
protected itemQualityInRange(item: Item, min: number, max: number): boolean;
} }

View File

@ -13,12 +13,12 @@ export declare class RagfairSellHelper {
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
/** /**
* Get the percent chance to sell an item based on its average listed price vs player chosen listing price * Get the percent chance to sell an item based on its average listed price vs player chosen listing price
* @param baseChancePercent Base chance to sell item
* @param averageOfferPriceRub Price of average offer in roubles * @param averageOfferPriceRub Price of average offer in roubles
* @param playerListedPriceRub Price player listed item for in roubles * @param playerListedPriceRub Price player listed item for in roubles
* @param qualityMultiplier Quality multipler of item being sold
* @returns percent value * @returns percent value
*/ */
calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number; calculateSellChance(averageOfferPriceRub: number, playerListedPriceRub: number, qualityMultiplier: number): number;
/** /**
* Get percent chance to sell an item when price is below items average listing price * 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 playerListedPriceRub Price player listed item for in roubles

View File

@ -35,7 +35,7 @@ export declare class TraderHelper {
protected highestTraderBuyPriceItems: Record<string, number>; protected highestTraderBuyPriceItems: Record<string, number>;
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer);
getTrader(traderID: string, sessionID: string): ITraderBase; getTrader(traderID: string, sessionID: string): ITraderBase;
getTraderAssortsById(traderId: string): ITraderAssort; getTraderAssortsByTraderId(traderId: string): ITraderAssort;
/** /**
* Reset a profiles trader data back to its initial state as seen by a level 1 player * Reset a profiles trader data back to its initial state as seen by a level 1 player
* Does NOT take into account different profile levels * Does NOT take into account different profile levels

View File

@ -281,7 +281,7 @@ export interface InsuredItem {
export interface Hideout { export interface Hideout {
Production: Record<string, Productive>; Production: Record<string, Productive>;
Areas: HideoutArea[]; Areas: HideoutArea[];
Improvements: Record<string, IHideoutImprovement>; Improvement: Record<string, IHideoutImprovement>;
Seed: number; Seed: number;
sptUpdateLastRunTimestamp: number; sptUpdateLastRunTimestamp: number;
} }

View File

@ -1,12 +1,14 @@
export interface IHealthTreatmentRequestData { export interface IHealthTreatmentRequestData {
Action: "RestoreHealth"; Action: "RestoreHealth";
trader: string; trader: string;
items: Item[]; items: Cost[];
difference: Difference; difference: Difference;
timestamp: number; timestamp: number;
} }
export interface Item { export interface Cost {
/** Id of stack to take money from */
id: string; id: string;
/** Amount of money to take off player for treatment */
count: number; count: number;
} }
export interface Difference { export interface Difference {
@ -25,5 +27,6 @@ export interface BodyParts {
} }
export interface BodyPart { export interface BodyPart {
Health: number; Health: number;
/** Effects in array are to be removed */
Effects: string[]; Effects: string[];
} }

View File

@ -14,6 +14,11 @@ export interface INotification {
} }
export declare enum NotificationType { export declare enum NotificationType {
RAGFAIR_OFFER_SOLD = "RagfairOfferSold", RAGFAIR_OFFER_SOLD = "RagfairOfferSold",
RAGFAIR_RATING_CHANGE = "RagfairRatingChange",
/** ChatMessageReceived */
NEW_MESSAGE = "new_message", NEW_MESSAGE = "new_message",
PING = "ping" PING = "ping",
TRADER_SUPPLY = "TraderSupply",
TRADER_STANDING = "TraderStanding",
UNLOCK_TRADER = "UnlockTrader"
} }

View File

@ -1,6 +1,3 @@
import { INotifierChannel } from "./INotifier";
export interface ISelectProfileResponse { export interface ISelectProfileResponse {
status: string; status: string;
notifier: INotifierChannel;
notifierServer: string;
} }

View File

@ -1,19 +1,19 @@
export declare enum WeatherType { export declare enum WeatherType {
CLEAR_DAY = 1, CLEAR_DAY = 0,
CLEAR_WIND = 2, CLEAR_WIND = 1,
CLEAR_NIGHT = 3, CLEAR_NIGHT = 2,
PARTLY_CLOUD_DAY = 4, PARTLY_CLOUD_DAY = 3,
PARTLY_CLOUD_NIGHT = 5, PARTLY_CLOUD_NIGHT = 4,
CLEAR_FOG_DAY = 6, CLEAR_FOG_DAY = 5,
CLEAR_FOG_NIGHT = 7, CLEAR_FOG_NIGHT = 6,
CLOUDFOG = 8, CLOUD_FOG = 7,
FOG = 9, FOG = 8,
MOSTLY_CLOUD = 10, MOSTLY_CLOUD = 9,
LIGHT_RAIN = 11, LIGHT_RAIN = 10,
RAIN = 12, RAIN = 11,
CLOUD_WIND = 13, CLOUD_WIND = 12,
CLOUD_WIND_RAIN = 14, CLOUD_WIND_RAIN = 13,
FULL_CLOUD = 15, FULL_CLOUD = 14,
THUNDER_CLOUD = 16, THUNDER_CLOUD = 15,
NONE = 0 NONE = 16
} }

View File

@ -41,7 +41,8 @@ export interface Dynamic {
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
useTraderPriceForOffersIfHigher: boolean; useTraderPriceForOffersIfHigher: boolean;
/** Barter offer specific settings */ /** Barter offer specific settings */
barter: Barter; barter: IBarterDetails;
pack: IPackDetails;
/** Dynamic offer price below handbook adjustment values */ /** Dynamic offer price below handbook adjustment values */
offerAdjustment: OfferAdjustment; offerAdjustment: OfferAdjustment;
/** How many offers should expire before an offer regeneration occurs */ /** How many offers should expire before an offer regeneration occurs */
@ -49,9 +50,7 @@ export interface Dynamic {
/** How many offers should be listed */ /** How many offers should be listed */
offerItemCount: MinMax; offerItemCount: MinMax;
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */ /** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
price: MinMax; priceRanges: IPriceRanges;
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
presetPrice: MinMax;
/** Should default presets to listed only or should non-standard presets found in globals.json be listed too */ /** Should default presets to listed only or should non-standard presets found in globals.json be listed too */
showDefaultPresetsOnly: boolean; showDefaultPresetsOnly: boolean;
endTimeSeconds: MinMax; endTimeSeconds: MinMax;
@ -74,7 +73,12 @@ export interface Dynamic {
/** Dict of price limits keyed by item type */ /** Dict of price limits keyed by item type */
unreasonableModPrices: Record<string, IUnreasonableModPrices>; unreasonableModPrices: Record<string, IUnreasonableModPrices>;
} }
export interface Barter { export interface IPriceRanges {
default: MinMax;
preset: MinMax;
pack: MinMax;
}
export interface IBarterDetails {
/** Should barter offers be generated */ /** Should barter offers be generated */
enable: boolean; enable: boolean;
/** Percentage change an offer is listed as a barter */ /** Percentage change an offer is listed as a barter */
@ -90,6 +94,18 @@ export interface Barter {
/** Item Tpls to never be turned into a barter */ /** Item Tpls to never be turned into a barter */
itemTypeBlacklist: string[]; itemTypeBlacklist: string[];
} }
export interface IPackDetails {
/** Should pack offers be generated */
enable: boolean;
/** Percentage change an offer is listed as a pack */
chancePercent: number;
/** Min number of required items for a pack */
itemCountMin: number;
/** Max number of required items for a pack */
itemCountMax: number;
/** item types to allow being a pack */
itemTypeWhitelist: string[];
}
export interface OfferAdjustment { export interface OfferAdjustment {
/** Shuld offer price be adjusted when below handbook price */ /** Shuld offer price be adjusted when below handbook price */
adjustPriceWhenBelowHandbookPrice: boolean; adjustPriceWhenBelowHandbookPrice: boolean;

View File

@ -7,7 +7,7 @@ export interface IWeatherConfig extends IBaseConfig {
weather: Weather; weather: Weather;
} }
export interface Weather { export interface Weather {
clouds: MinMax; clouds: WeatherSettings<string>;
windSpeed: WeatherSettings<number>; windSpeed: WeatherSettings<number>;
windDirection: WeatherSettings<WindDirection>; windDirection: WeatherSettings<WindDirection>;
windGustiness: MinMax; windGustiness: MinMax;

View File

@ -11,7 +11,18 @@ export declare class HashCacheService {
protected modHashes: any; protected modHashes: any;
protected readonly modCachePath = "./user/cache/modCache.json"; protected readonly modCachePath = "./user/cache/modCache.json";
constructor(vfs: VFS, hashUtil: HashUtil, jsonUtil: JsonUtil, logger: ILogger); constructor(vfs: VFS, hashUtil: HashUtil, jsonUtil: JsonUtil, logger: ILogger);
/**
* Return a stored hash by key
* @param modName Name of mod to get hash for
* @returns Mod hash
*/
getStoredModHash(modName: string): string; getStoredModHash(modName: string): string;
/**
* Does the generated hash match the stored hash
* @param modName name of mod
* @param modContent
* @returns True if they match
*/
modContentMatchesStoredHash(modName: string, modContent: string): boolean; modContentMatchesStoredHash(modName: string, modContent: string): boolean;
hashMatchesStoredHash(modName: string, modHash: string): boolean; hashMatchesStoredHash(modName: string, modHash: string): boolean;
storeModContent(modName: string, modContent: string): void; storeModContent(modName: string, modContent: string): void;

View File

@ -35,7 +35,7 @@ export declare class MailSendService {
* @param items Optional items to send to player * @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire * @param maxStorageTimeSeconds Optional time to collect items before they expire
*/ */
sendDirectNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any): void; sendDirectNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void;
/** /**
* Send a message from an NPC (e.g. prapor) to the player with or without items * Send a message from an NPC (e.g. prapor) to the player with or without items
* @param playerId Players id to send message to * @param playerId Players id to send message to
@ -45,7 +45,7 @@ export declare class MailSendService {
* @param items Optional items to send to player * @param items Optional items to send to player
* @param maxStorageTimeSeconds Optional time to collect items before they expire * @param maxStorageTimeSeconds Optional time to collect items before they expire
*/ */
sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any): void; sendLocalisedNpcMessageToPlayer(playerId: string, sender: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: any, systemData?: any, ragfair?: any): void;
/** /**
* Send a message from SYSTEM to the player with or without items * Send a message from SYSTEM to the player with or without items
* @param playerId Players id to send message to * @param playerId Players id to send message to

View File

@ -1,7 +1,7 @@
import { IBotBase } from "../models/eft/common/tables/IBotBase"; import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { LocalisationService } from "./LocalisationService"; import { LocalisationService } from "./LocalisationService";
/** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */ /** Cache bots in a dictionary, keyed by the bots name, keying by name isnt ideal as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */
export declare class MatchBotDetailsCacheService { export declare class MatchBotDetailsCacheService {
protected logger: ILogger; protected logger: ILogger;
protected localisationService: LocalisationService; protected localisationService: LocalisationService;
@ -17,9 +17,9 @@ export declare class MatchBotDetailsCacheService {
*/ */
clearCache(): void; clearCache(): void;
/** /**
* Find a bot in the cache by its name * Find a bot in the cache by its name and side
* @param botName Name of bot to find * @param botName Name of bot to find
* @returns Bot details * @returns Bot details
*/ */
getBotByName(botName: string): IBotBase; getBotByNameAndSide(botName: string, botSide: string): IBotBase;
} }

View File

@ -1,14 +1,36 @@
import { CompilerOptions } from "typescript"; import { CompilerOptions } from "typescript";
import type { ILogger } from "../models/spt/utils/ILogger"; import type { ILogger } from "../models/spt/utils/ILogger";
import { HashCacheService } from "./HashCacheService";
import { VFS } from "../utils/VFS"; import { VFS } from "../utils/VFS";
import { HashCacheService } from "./HashCacheService";
export declare class ModCompilerService { export declare class ModCompilerService {
protected logger: ILogger; protected logger: ILogger;
protected hashCacheService: HashCacheService; protected hashCacheService: HashCacheService;
protected vfs: VFS; protected vfs: VFS;
constructor(logger: ILogger, hashCacheService: HashCacheService, vfs: VFS); constructor(logger: ILogger, hashCacheService: HashCacheService, vfs: VFS);
/**
* Convert a mods TS into JS
* @param modName Name of mod
* @param modPath Dir path to mod
* @param modTypeScriptFiles
* @returns
*/
compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void>; compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void>;
/**
* Convert a TS file into JS
* @param fileNames Paths to TS files
* @param options Compiler options
*/
protected compile(fileNames: string[], options: CompilerOptions): Promise<void>; protected compile(fileNames: string[], options: CompilerOptions): Promise<void>;
/**
* Do the files at the provided paths exist
* @param fileNames
* @returns
*/
protected areFilesReady(fileNames: string[]): boolean; protected areFilesReady(fileNames: string[]): boolean;
/**
* Wait the provided number of milliseconds
* @param ms Milliseconds
* @returns
*/
protected delay(ms: number): Promise<unknown>; protected delay(ms: number): Promise<unknown>;
} }

View File

@ -61,23 +61,26 @@ export declare class PaymentService {
* Get all money stacks in inventory and prioritse items in stash * Get all money stacks in inventory and prioritse items in stash
* @param pmcData * @param pmcData
* @param currencyTpl * @param currencyTpl
* @param playerStashId Players stash id
* @returns Sorting money items * @returns Sorting money items
*/ */
protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string): Item[]; protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string, playerStashId: string): Item[];
/** /**
* Prioritise player stash first over player inventory * Prioritise player stash first over player inventory
* Post-raid healing would often take money out of the players pockets/secure container * Post-raid healing would often take money out of the players pockets/secure container
* @param a First money stack item * @param a First money stack item
* @param b Second money stack item * @param b Second money stack item
* @param inventoryItems players inventory items * @param inventoryItems players inventory items
* @param playerStashId Players stash id
* @returns sort order * @returns sort order
*/ */
protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[]): number; protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[], playerStashId: string): number;
/** /**
* Recursivly check items parents to see if it is inside the players inventory, not stash * Recursivly check items parents to see if it is inside the players inventory, not stash
* @param itemId item id to check * @param itemId item id to check
* @param inventoryItems player inventory * @param inventoryItems player inventory
* @param playerStashId Players stash id
* @returns true if its in inventory * @returns true if its in inventory
*/ */
protected isInInventory(itemId: string, inventoryItems: Item[]): boolean; protected isInStash(itemId: string, inventoryItems: Item[], playerStashId: string): boolean;
} }

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