Update types

This commit is contained in:
Dev 2023-09-12 14:36:36 +01:00
parent 47f5a841eb
commit d23f96f3db
376 changed files with 2053 additions and 666 deletions

View File

@ -14,9 +14,11 @@ import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
/**
@ -27,9 +29,10 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected ragfairTaxService: RagfairTaxService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
@ -53,4 +56,5 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
/** Handle client/reports/ragfair/send */
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
}

View File

@ -14,6 +14,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILootConfig } from "../models/spt/config/ILootConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -58,12 +59,14 @@ export declare class GameController {
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected pmcConfig: IPmcConfig;
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);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated

View File

@ -7,6 +7,7 @@ import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsura
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Insurance } from "../models/eft/profile/IAkiProfile";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -36,6 +37,11 @@ export declare class InsuranceController {
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Change SlotId of children inside Containers to be a root item
* @param insured Insured Items
*/
protected updateSlotIdOfContainersChildren(insured: Insurance): void;
/**
* Should the passed in item be removed from player inventory
* @param insuredItem Insurued item to roll to lose

View File

@ -8,7 +8,6 @@ import { RagfairHelper } from "../helpers/RagfairHelper";
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
@ -34,6 +33,7 @@ import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
@ -50,7 +50,7 @@ export declare class RagfairController {
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
protected ragfairSellHelper: RagfairSellHelper;
protected ragfairTaxHelper: RagfairTaxHelper;
protected ragfairTaxService: RagfairTaxService;
protected ragfairSortHelper: RagfairSortHelper;
protected ragfairOfferHelper: RagfairOfferHelper;
protected profileHelper: ProfileHelper;
@ -66,7 +66,7 @@ export declare class RagfairController {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed

View File

@ -83,10 +83,11 @@ export declare class BotEquipmentModGenerator {
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
* Set mod spawn chances to defined amount
* @param modSpawnChances Chance dictionary to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId: string): boolean;
protected sortModKeys(unsortedKeys: string[]): string[];
/**
* Get a Slot property for an item (chamber/cartridge/slot)
@ -193,10 +194,12 @@ export declare class BotEquipmentModGenerator {
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Filter out non-whitelisted weapon scopes
* Controlled by bot.json weaponSightWhitelist
* e.g. filter out rifle scopes from SMGs
* @param weapon Weapon scopes will be added to
* @param scopes Full scope pool
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
* @returns array of scope tpls that have been filtered
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
*/
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -2,7 +2,7 @@ import { ApplicationContext } from "../context/ApplicationContext";
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -33,6 +33,13 @@ export declare class BotGeneratorHelper {
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd;
};
/**
* Randomize the HpResource for bots e.g (245/400 resources)
* @param maxResource Max resource value of medical items
* @param randomizationValues Value provided from config
* @returns Randomized value from maxHpResource
*/
protected getRandomizedResourceValue(maxResource: number, randomizationValues: IRandomisedResourceValues): number;
/**
* Get the chance for the weapon attachment or helmet equipment to be set as activated
* @param botRole role of bot with weapon/helmet

View File

@ -367,10 +367,18 @@ export interface Quest {
export interface TraderInfo {
loyaltyLevel: number;
salesSum: number;
disabled: boolean;
standing: number;
nextResupply: number;
unlocked: boolean;
disabled: boolean;
}
/** This object is sent to the client as part of traderRelations */
export interface TraderData {
salesSum: number;
standing: number;
loyalty: number;
unlocked: boolean;
disabled: boolean;
}
export interface RagfairInfo {
rating: number;

View File

@ -1,5 +1,5 @@
export interface IGameConfigResponse {
aid: string;
aid: number;
lang: string;
languages: Record<string, string>;
ndaFree: boolean;

View File

@ -1,6 +1,6 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus";
import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -29,7 +29,7 @@ export interface ProfileChange {
improvements: Record<string, Improvement>;
skills: Skills;
health: Health;
traderRelations: Record<string, TraderInfo>;
traderRelations: Record<string, TraderData>;
repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>;

View File

@ -0,0 +1,6 @@
export interface IStorePlayerOfferTaxAmountRequestData {
id: string;
tpl: string;
count: number;
fee: number;
}

View File

@ -3,6 +3,7 @@ export declare enum BaseClasses {
UBGL = "55818b014bdc2ddc698b456b",
ARMOR = "5448e54d4bdc2dcc718b4568",
ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b",
REPAIR_KITS = "616eb7aea207f41933308f46",
HEADWEAR = "5a341c4086f77401f2541505",
FACECOVER = "5a341c4686f77469e155819e",
VEST = "5448e5284bdc2dcb718b4567",

View File

@ -12,6 +12,7 @@ export declare enum ConfigTypes {
ITEM = "aki-item",
LOCALE = "aki-locale",
LOCATION = "aki-location",
LOOT = "aki-loot",
MATCH = "aki-match",
PLAYERSCAV = "aki-playerscav",
PMC_CHAT_RESPONSE = "aki-pmcchatresponse",

View File

@ -10,6 +10,8 @@ export interface IBotConfig extends IBaseConfig {
bosses: string[];
/** Control weapon/armor durability min/max values for each bot type */
durability: IBotDurability;
/** Controls the percentage values of randomization item resources */
lootItemResourceRandomization: Record<string, IRandomisedResourceDetails>;
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
@ -133,10 +135,20 @@ export interface WeightingAdjustmentDetails {
ammo?: AdjustmentDetails;
/** Key: equipment slot e.g. TacticalVest, value: item tpl + weight */
equipment?: AdjustmentDetails;
/** Key: clothing slor e.g. feet, value: item tpl + weight */
/** Key: clothing slot e.g. feet, value: item tpl + weight */
clothing?: AdjustmentDetails;
}
export interface AdjustmentDetails {
add: Record<string, Record<string, number>>;
edit: Record<string, Record<string, number>>;
}
export interface IRandomisedResourceDetails {
food: IRandomisedResourceValues;
meds: IRandomisedResourceValues;
}
export interface IRandomisedResourceValues {
/** Minimum percent of item to randomized between min and max resource*/
resourcePercent: number;
/** Chance for randomization to not occur */
chanceMaxResourcePercent: number;
}

View File

@ -33,7 +33,6 @@ export interface ILocationConfig extends IBaseConfig {
minFillLooseMagazinePercent: number;
/** How full must a random static magazine be %*/
minFillStaticMagazinePercent: number;
makeWishingTreeAlwaysGiveGift: boolean;
allowDuplicateItemsInStaticContainers: boolean;
/** Key: map, value: loose loot ids to ignore */
looseLootBlacklist: Record<string, string[]>;

View File

@ -0,0 +1,9 @@
import { Spawnpoint } from "../../../models/eft/common/ILooseLoot";
import { IBaseConfig } from "./IBaseConfig";
export interface ILootConfig extends IBaseConfig {
kind: "aki-loot";
/** Spawn positions to add into a map, key=mapid */
looseLoot: Record<string, Spawnpoint[]>;
/** Loose loot probability adjustments to apply on game start */
looseLootSpawnPointAdjustments: Record<string, Record<string, number>>;
}

View File

@ -1,6 +1,6 @@
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase";
import { IHideoutImprovement, Productive, TraderData, TraderInfo } from "../models/eft/common/tables/IBotBase";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -26,6 +26,12 @@ export declare class EventOutputHolder {
* @param sessionId Session id
*/
updateOutputProperties(sessionId: string): void;
/**
* Convert the internal trader data object into an object we can send to the client
* @param traderData server data for traders
* @returns
*/
protected constructTraderRelations(traderData: Record<string, TraderInfo>): Record<string, TraderData>;
/**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile

View File

@ -22,9 +22,9 @@ export declare class BotEquipmentFilterService {
*/
filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void;
/**
* Iterate over the changes passed in and alter data in baseValues
* Iterate over the changes passed in and apply them to baseValues parameter
* @param equipmentChanges Changes to apply
* @param baseValues Values to update
* @param baseValues data to update
*/
protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void;
/**

View File

@ -64,7 +64,6 @@ export declare class ProfileFixerService {
*/
protected updateProfileQuestDataValues(pmcProfile: IPmcData): void;
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void;
/**
* Some profiles have hideout maxed and therefore no improvements
* @param pmcProfile Profile to add improvement data to
@ -92,7 +91,6 @@ export declare class ProfileFixerService {
* @param pmcProfile
*/
protected updateProfilePocketsToNewId(pmcProfile: IPmcData): void;
addMissingArmorRepairSkill(pmcProfile: IPmcData): void;
/**
* Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing
* @param pmcProfile Profile to update
@ -126,4 +124,9 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to update
*/
removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void;
/**
* 26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets
* @param pmcProfile Profile to add missing IDs to
*/
addMissingIdsToBonuses(pmcProfile: IPmcData): void;
}

View File

@ -1,16 +1,21 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { ItemHelper } from "./ItemHelper";
export declare class RagfairTaxHelper {
export declare class RagfairTaxService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;
calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number;
protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number;
}

View File

@ -14,9 +14,11 @@ import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
/**
@ -27,9 +29,10 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected ragfairTaxService: RagfairTaxService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
@ -53,4 +56,5 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
/** Handle client/reports/ragfair/send */
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
}

View File

@ -14,6 +14,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILootConfig } from "../models/spt/config/ILootConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -58,12 +59,14 @@ export declare class GameController {
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected pmcConfig: IPmcConfig;
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);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated

View File

@ -7,6 +7,7 @@ import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsura
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Insurance } from "../models/eft/profile/IAkiProfile";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -36,6 +37,11 @@ export declare class InsuranceController {
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Change SlotId of children inside Containers to be a root item
* @param insured Insured Items
*/
protected updateSlotIdOfContainersChildren(insured: Insurance): void;
/**
* Should the passed in item be removed from player inventory
* @param insuredItem Insurued item to roll to lose

View File

@ -8,7 +8,6 @@ import { RagfairHelper } from "../helpers/RagfairHelper";
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
@ -34,6 +33,7 @@ import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
@ -50,7 +50,7 @@ export declare class RagfairController {
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
protected ragfairSellHelper: RagfairSellHelper;
protected ragfairTaxHelper: RagfairTaxHelper;
protected ragfairTaxService: RagfairTaxService;
protected ragfairSortHelper: RagfairSortHelper;
protected ragfairOfferHelper: RagfairOfferHelper;
protected profileHelper: ProfileHelper;
@ -66,7 +66,7 @@ export declare class RagfairController {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed

View File

@ -83,10 +83,11 @@ export declare class BotEquipmentModGenerator {
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
* Set mod spawn chances to defined amount
* @param modSpawnChances Chance dictionary to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId: string): boolean;
protected sortModKeys(unsortedKeys: string[]): string[];
/**
* Get a Slot property for an item (chamber/cartridge/slot)
@ -193,10 +194,12 @@ export declare class BotEquipmentModGenerator {
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Filter out non-whitelisted weapon scopes
* Controlled by bot.json weaponSightWhitelist
* e.g. filter out rifle scopes from SMGs
* @param weapon Weapon scopes will be added to
* @param scopes Full scope pool
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
* @returns array of scope tpls that have been filtered
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
*/
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -2,7 +2,7 @@ import { ApplicationContext } from "../context/ApplicationContext";
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -33,6 +33,13 @@ export declare class BotGeneratorHelper {
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd;
};
/**
* Randomize the HpResource for bots e.g (245/400 resources)
* @param maxResource Max resource value of medical items
* @param randomizationValues Value provided from config
* @returns Randomized value from maxHpResource
*/
protected getRandomizedResourceValue(maxResource: number, randomizationValues: IRandomisedResourceValues): number;
/**
* Get the chance for the weapon attachment or helmet equipment to be set as activated
* @param botRole role of bot with weapon/helmet

View File

@ -367,10 +367,18 @@ export interface Quest {
export interface TraderInfo {
loyaltyLevel: number;
salesSum: number;
disabled: boolean;
standing: number;
nextResupply: number;
unlocked: boolean;
disabled: boolean;
}
/** This object is sent to the client as part of traderRelations */
export interface TraderData {
salesSum: number;
standing: number;
loyalty: number;
unlocked: boolean;
disabled: boolean;
}
export interface RagfairInfo {
rating: number;

View File

@ -1,5 +1,5 @@
export interface IGameConfigResponse {
aid: string;
aid: number;
lang: string;
languages: Record<string, string>;
ndaFree: boolean;

View File

@ -1,6 +1,6 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus";
import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -29,7 +29,7 @@ export interface ProfileChange {
improvements: Record<string, Improvement>;
skills: Skills;
health: Health;
traderRelations: Record<string, TraderInfo>;
traderRelations: Record<string, TraderData>;
repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>;

View File

@ -0,0 +1,6 @@
export interface IStorePlayerOfferTaxAmountRequestData {
id: string;
tpl: string;
count: number;
fee: number;
}

View File

@ -3,6 +3,7 @@ export declare enum BaseClasses {
UBGL = "55818b014bdc2ddc698b456b",
ARMOR = "5448e54d4bdc2dcc718b4568",
ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b",
REPAIR_KITS = "616eb7aea207f41933308f46",
HEADWEAR = "5a341c4086f77401f2541505",
FACECOVER = "5a341c4686f77469e155819e",
VEST = "5448e5284bdc2dcb718b4567",

View File

@ -12,6 +12,7 @@ export declare enum ConfigTypes {
ITEM = "aki-item",
LOCALE = "aki-locale",
LOCATION = "aki-location",
LOOT = "aki-loot",
MATCH = "aki-match",
PLAYERSCAV = "aki-playerscav",
PMC_CHAT_RESPONSE = "aki-pmcchatresponse",

View File

@ -10,6 +10,8 @@ export interface IBotConfig extends IBaseConfig {
bosses: string[];
/** Control weapon/armor durability min/max values for each bot type */
durability: IBotDurability;
/** Controls the percentage values of randomization item resources */
lootItemResourceRandomization: Record<string, IRandomisedResourceDetails>;
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
@ -133,10 +135,20 @@ export interface WeightingAdjustmentDetails {
ammo?: AdjustmentDetails;
/** Key: equipment slot e.g. TacticalVest, value: item tpl + weight */
equipment?: AdjustmentDetails;
/** Key: clothing slor e.g. feet, value: item tpl + weight */
/** Key: clothing slot e.g. feet, value: item tpl + weight */
clothing?: AdjustmentDetails;
}
export interface AdjustmentDetails {
add: Record<string, Record<string, number>>;
edit: Record<string, Record<string, number>>;
}
export interface IRandomisedResourceDetails {
food: IRandomisedResourceValues;
meds: IRandomisedResourceValues;
}
export interface IRandomisedResourceValues {
/** Minimum percent of item to randomized between min and max resource*/
resourcePercent: number;
/** Chance for randomization to not occur */
chanceMaxResourcePercent: number;
}

View File

@ -33,7 +33,6 @@ export interface ILocationConfig extends IBaseConfig {
minFillLooseMagazinePercent: number;
/** How full must a random static magazine be %*/
minFillStaticMagazinePercent: number;
makeWishingTreeAlwaysGiveGift: boolean;
allowDuplicateItemsInStaticContainers: boolean;
/** Key: map, value: loose loot ids to ignore */
looseLootBlacklist: Record<string, string[]>;

View File

@ -0,0 +1,9 @@
import { Spawnpoint } from "../../../models/eft/common/ILooseLoot";
import { IBaseConfig } from "./IBaseConfig";
export interface ILootConfig extends IBaseConfig {
kind: "aki-loot";
/** Spawn positions to add into a map, key=mapid */
looseLoot: Record<string, Spawnpoint[]>;
/** Loose loot probability adjustments to apply on game start */
looseLootSpawnPointAdjustments: Record<string, Record<string, number>>;
}

View File

@ -1,6 +1,6 @@
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase";
import { IHideoutImprovement, Productive, TraderData, TraderInfo } from "../models/eft/common/tables/IBotBase";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -26,6 +26,12 @@ export declare class EventOutputHolder {
* @param sessionId Session id
*/
updateOutputProperties(sessionId: string): void;
/**
* Convert the internal trader data object into an object we can send to the client
* @param traderData server data for traders
* @returns
*/
protected constructTraderRelations(traderData: Record<string, TraderInfo>): Record<string, TraderData>;
/**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile

View File

@ -22,9 +22,9 @@ export declare class BotEquipmentFilterService {
*/
filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void;
/**
* Iterate over the changes passed in and alter data in baseValues
* Iterate over the changes passed in and apply them to baseValues parameter
* @param equipmentChanges Changes to apply
* @param baseValues Values to update
* @param baseValues data to update
*/
protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void;
/**

View File

@ -64,7 +64,6 @@ export declare class ProfileFixerService {
*/
protected updateProfileQuestDataValues(pmcProfile: IPmcData): void;
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void;
/**
* Some profiles have hideout maxed and therefore no improvements
* @param pmcProfile Profile to add improvement data to
@ -92,7 +91,6 @@ export declare class ProfileFixerService {
* @param pmcProfile
*/
protected updateProfilePocketsToNewId(pmcProfile: IPmcData): void;
addMissingArmorRepairSkill(pmcProfile: IPmcData): void;
/**
* Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing
* @param pmcProfile Profile to update
@ -126,4 +124,9 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to update
*/
removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void;
/**
* 26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets
* @param pmcProfile Profile to add missing IDs to
*/
addMissingIdsToBonuses(pmcProfile: IPmcData): void;
}

View File

@ -1,16 +1,21 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { ItemHelper } from "./ItemHelper";
export declare class RagfairTaxHelper {
export declare class RagfairTaxService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;
calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number;
protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number;
}

View File

@ -14,9 +14,11 @@ import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
/**
@ -27,9 +29,10 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected ragfairTaxService: RagfairTaxService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
@ -53,4 +56,5 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
/** Handle client/reports/ragfair/send */
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
}

View File

@ -14,6 +14,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILootConfig } from "../models/spt/config/ILootConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -58,12 +59,14 @@ export declare class GameController {
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected pmcConfig: IPmcConfig;
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);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated

View File

@ -7,6 +7,7 @@ import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsura
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Insurance } from "../models/eft/profile/IAkiProfile";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -36,6 +37,11 @@ export declare class InsuranceController {
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Change SlotId of children inside Containers to be a root item
* @param insured Insured Items
*/
protected updateSlotIdOfContainersChildren(insured: Insurance): void;
/**
* Should the passed in item be removed from player inventory
* @param insuredItem Insurued item to roll to lose

View File

@ -8,7 +8,6 @@ import { RagfairHelper } from "../helpers/RagfairHelper";
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
@ -34,6 +33,7 @@ import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
@ -50,7 +50,7 @@ export declare class RagfairController {
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
protected ragfairSellHelper: RagfairSellHelper;
protected ragfairTaxHelper: RagfairTaxHelper;
protected ragfairTaxService: RagfairTaxService;
protected ragfairSortHelper: RagfairSortHelper;
protected ragfairOfferHelper: RagfairOfferHelper;
protected profileHelper: ProfileHelper;
@ -66,7 +66,7 @@ export declare class RagfairController {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed

View File

@ -83,10 +83,11 @@ export declare class BotEquipmentModGenerator {
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
* Set mod spawn chances to defined amount
* @param modSpawnChances Chance dictionary to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId: string): boolean;
protected sortModKeys(unsortedKeys: string[]): string[];
/**
* Get a Slot property for an item (chamber/cartridge/slot)
@ -193,10 +194,12 @@ export declare class BotEquipmentModGenerator {
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Filter out non-whitelisted weapon scopes
* Controlled by bot.json weaponSightWhitelist
* e.g. filter out rifle scopes from SMGs
* @param weapon Weapon scopes will be added to
* @param scopes Full scope pool
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
* @returns array of scope tpls that have been filtered
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
*/
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -2,7 +2,7 @@ import { ApplicationContext } from "../context/ApplicationContext";
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -33,6 +33,13 @@ export declare class BotGeneratorHelper {
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd;
};
/**
* Randomize the HpResource for bots e.g (245/400 resources)
* @param maxResource Max resource value of medical items
* @param randomizationValues Value provided from config
* @returns Randomized value from maxHpResource
*/
protected getRandomizedResourceValue(maxResource: number, randomizationValues: IRandomisedResourceValues): number;
/**
* Get the chance for the weapon attachment or helmet equipment to be set as activated
* @param botRole role of bot with weapon/helmet

View File

@ -367,10 +367,18 @@ export interface Quest {
export interface TraderInfo {
loyaltyLevel: number;
salesSum: number;
disabled: boolean;
standing: number;
nextResupply: number;
unlocked: boolean;
disabled: boolean;
}
/** This object is sent to the client as part of traderRelations */
export interface TraderData {
salesSum: number;
standing: number;
loyalty: number;
unlocked: boolean;
disabled: boolean;
}
export interface RagfairInfo {
rating: number;

View File

@ -1,5 +1,5 @@
export interface IGameConfigResponse {
aid: string;
aid: number;
lang: string;
languages: Record<string, string>;
ndaFree: boolean;

View File

@ -1,6 +1,6 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus";
import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -29,7 +29,7 @@ export interface ProfileChange {
improvements: Record<string, Improvement>;
skills: Skills;
health: Health;
traderRelations: Record<string, TraderInfo>;
traderRelations: Record<string, TraderData>;
repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>;

View File

@ -0,0 +1,6 @@
export interface IStorePlayerOfferTaxAmountRequestData {
id: string;
tpl: string;
count: number;
fee: number;
}

View File

@ -3,6 +3,7 @@ export declare enum BaseClasses {
UBGL = "55818b014bdc2ddc698b456b",
ARMOR = "5448e54d4bdc2dcc718b4568",
ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b",
REPAIR_KITS = "616eb7aea207f41933308f46",
HEADWEAR = "5a341c4086f77401f2541505",
FACECOVER = "5a341c4686f77469e155819e",
VEST = "5448e5284bdc2dcb718b4567",

View File

@ -12,6 +12,7 @@ export declare enum ConfigTypes {
ITEM = "aki-item",
LOCALE = "aki-locale",
LOCATION = "aki-location",
LOOT = "aki-loot",
MATCH = "aki-match",
PLAYERSCAV = "aki-playerscav",
PMC_CHAT_RESPONSE = "aki-pmcchatresponse",

View File

@ -10,6 +10,8 @@ export interface IBotConfig extends IBaseConfig {
bosses: string[];
/** Control weapon/armor durability min/max values for each bot type */
durability: IBotDurability;
/** Controls the percentage values of randomization item resources */
lootItemResourceRandomization: Record<string, IRandomisedResourceDetails>;
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
@ -133,10 +135,20 @@ export interface WeightingAdjustmentDetails {
ammo?: AdjustmentDetails;
/** Key: equipment slot e.g. TacticalVest, value: item tpl + weight */
equipment?: AdjustmentDetails;
/** Key: clothing slor e.g. feet, value: item tpl + weight */
/** Key: clothing slot e.g. feet, value: item tpl + weight */
clothing?: AdjustmentDetails;
}
export interface AdjustmentDetails {
add: Record<string, Record<string, number>>;
edit: Record<string, Record<string, number>>;
}
export interface IRandomisedResourceDetails {
food: IRandomisedResourceValues;
meds: IRandomisedResourceValues;
}
export interface IRandomisedResourceValues {
/** Minimum percent of item to randomized between min and max resource*/
resourcePercent: number;
/** Chance for randomization to not occur */
chanceMaxResourcePercent: number;
}

View File

@ -33,7 +33,6 @@ export interface ILocationConfig extends IBaseConfig {
minFillLooseMagazinePercent: number;
/** How full must a random static magazine be %*/
minFillStaticMagazinePercent: number;
makeWishingTreeAlwaysGiveGift: boolean;
allowDuplicateItemsInStaticContainers: boolean;
/** Key: map, value: loose loot ids to ignore */
looseLootBlacklist: Record<string, string[]>;

View File

@ -0,0 +1,9 @@
import { Spawnpoint } from "../../../models/eft/common/ILooseLoot";
import { IBaseConfig } from "./IBaseConfig";
export interface ILootConfig extends IBaseConfig {
kind: "aki-loot";
/** Spawn positions to add into a map, key=mapid */
looseLoot: Record<string, Spawnpoint[]>;
/** Loose loot probability adjustments to apply on game start */
looseLootSpawnPointAdjustments: Record<string, Record<string, number>>;
}

View File

@ -1,6 +1,6 @@
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase";
import { IHideoutImprovement, Productive, TraderData, TraderInfo } from "../models/eft/common/tables/IBotBase";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -26,6 +26,12 @@ export declare class EventOutputHolder {
* @param sessionId Session id
*/
updateOutputProperties(sessionId: string): void;
/**
* Convert the internal trader data object into an object we can send to the client
* @param traderData server data for traders
* @returns
*/
protected constructTraderRelations(traderData: Record<string, TraderInfo>): Record<string, TraderData>;
/**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile

View File

@ -22,9 +22,9 @@ export declare class BotEquipmentFilterService {
*/
filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void;
/**
* Iterate over the changes passed in and alter data in baseValues
* Iterate over the changes passed in and apply them to baseValues parameter
* @param equipmentChanges Changes to apply
* @param baseValues Values to update
* @param baseValues data to update
*/
protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void;
/**

View File

@ -64,7 +64,6 @@ export declare class ProfileFixerService {
*/
protected updateProfileQuestDataValues(pmcProfile: IPmcData): void;
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void;
/**
* Some profiles have hideout maxed and therefore no improvements
* @param pmcProfile Profile to add improvement data to
@ -92,7 +91,6 @@ export declare class ProfileFixerService {
* @param pmcProfile
*/
protected updateProfilePocketsToNewId(pmcProfile: IPmcData): void;
addMissingArmorRepairSkill(pmcProfile: IPmcData): void;
/**
* Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing
* @param pmcProfile Profile to update
@ -126,4 +124,9 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to update
*/
removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void;
/**
* 26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets
* @param pmcProfile Profile to add missing IDs to
*/
addMissingIdsToBonuses(pmcProfile: IPmcData): void;
}

View File

@ -1,16 +1,21 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { ItemHelper } from "./ItemHelper";
export declare class RagfairTaxHelper {
export declare class RagfairTaxService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;
calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number;
protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number;
}

View File

@ -14,9 +14,11 @@ import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
/**
@ -27,9 +29,10 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected ragfairTaxService: RagfairTaxService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
@ -53,4 +56,5 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
/** Handle client/reports/ragfair/send */
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
}

View File

@ -14,6 +14,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILootConfig } from "../models/spt/config/ILootConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -58,12 +59,14 @@ export declare class GameController {
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected pmcConfig: IPmcConfig;
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);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated

View File

@ -7,6 +7,7 @@ import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsura
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Insurance } from "../models/eft/profile/IAkiProfile";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -36,6 +37,11 @@ export declare class InsuranceController {
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Change SlotId of children inside Containers to be a root item
* @param insured Insured Items
*/
protected updateSlotIdOfContainersChildren(insured: Insurance): void;
/**
* Should the passed in item be removed from player inventory
* @param insuredItem Insurued item to roll to lose

View File

@ -8,7 +8,6 @@ import { RagfairHelper } from "../helpers/RagfairHelper";
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
@ -34,6 +33,7 @@ import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
@ -50,7 +50,7 @@ export declare class RagfairController {
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
protected ragfairSellHelper: RagfairSellHelper;
protected ragfairTaxHelper: RagfairTaxHelper;
protected ragfairTaxService: RagfairTaxService;
protected ragfairSortHelper: RagfairSortHelper;
protected ragfairOfferHelper: RagfairOfferHelper;
protected profileHelper: ProfileHelper;
@ -66,7 +66,7 @@ export declare class RagfairController {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed

View File

@ -83,10 +83,11 @@ export declare class BotEquipmentModGenerator {
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
* Set mod spawn chances to defined amount
* @param modSpawnChances Chance dictionary to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId: string): boolean;
protected sortModKeys(unsortedKeys: string[]): string[];
/**
* Get a Slot property for an item (chamber/cartridge/slot)
@ -193,10 +194,12 @@ export declare class BotEquipmentModGenerator {
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Filter out non-whitelisted weapon scopes
* Controlled by bot.json weaponSightWhitelist
* e.g. filter out rifle scopes from SMGs
* @param weapon Weapon scopes will be added to
* @param scopes Full scope pool
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
* @returns array of scope tpls that have been filtered
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
*/
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -2,7 +2,7 @@ import { ApplicationContext } from "../context/ApplicationContext";
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -33,6 +33,13 @@ export declare class BotGeneratorHelper {
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd;
};
/**
* Randomize the HpResource for bots e.g (245/400 resources)
* @param maxResource Max resource value of medical items
* @param randomizationValues Value provided from config
* @returns Randomized value from maxHpResource
*/
protected getRandomizedResourceValue(maxResource: number, randomizationValues: IRandomisedResourceValues): number;
/**
* Get the chance for the weapon attachment or helmet equipment to be set as activated
* @param botRole role of bot with weapon/helmet

View File

@ -367,10 +367,18 @@ export interface Quest {
export interface TraderInfo {
loyaltyLevel: number;
salesSum: number;
disabled: boolean;
standing: number;
nextResupply: number;
unlocked: boolean;
disabled: boolean;
}
/** This object is sent to the client as part of traderRelations */
export interface TraderData {
salesSum: number;
standing: number;
loyalty: number;
unlocked: boolean;
disabled: boolean;
}
export interface RagfairInfo {
rating: number;

View File

@ -1,5 +1,5 @@
export interface IGameConfigResponse {
aid: string;
aid: number;
lang: string;
languages: Record<string, string>;
ndaFree: boolean;

View File

@ -1,6 +1,6 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus";
import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -29,7 +29,7 @@ export interface ProfileChange {
improvements: Record<string, Improvement>;
skills: Skills;
health: Health;
traderRelations: Record<string, TraderInfo>;
traderRelations: Record<string, TraderData>;
repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>;

View File

@ -0,0 +1,6 @@
export interface IStorePlayerOfferTaxAmountRequestData {
id: string;
tpl: string;
count: number;
fee: number;
}

View File

@ -3,6 +3,7 @@ export declare enum BaseClasses {
UBGL = "55818b014bdc2ddc698b456b",
ARMOR = "5448e54d4bdc2dcc718b4568",
ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b",
REPAIR_KITS = "616eb7aea207f41933308f46",
HEADWEAR = "5a341c4086f77401f2541505",
FACECOVER = "5a341c4686f77469e155819e",
VEST = "5448e5284bdc2dcb718b4567",

View File

@ -12,6 +12,7 @@ export declare enum ConfigTypes {
ITEM = "aki-item",
LOCALE = "aki-locale",
LOCATION = "aki-location",
LOOT = "aki-loot",
MATCH = "aki-match",
PLAYERSCAV = "aki-playerscav",
PMC_CHAT_RESPONSE = "aki-pmcchatresponse",

View File

@ -10,6 +10,8 @@ export interface IBotConfig extends IBaseConfig {
bosses: string[];
/** Control weapon/armor durability min/max values for each bot type */
durability: IBotDurability;
/** Controls the percentage values of randomization item resources */
lootItemResourceRandomization: Record<string, IRandomisedResourceDetails>;
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
@ -133,10 +135,20 @@ export interface WeightingAdjustmentDetails {
ammo?: AdjustmentDetails;
/** Key: equipment slot e.g. TacticalVest, value: item tpl + weight */
equipment?: AdjustmentDetails;
/** Key: clothing slor e.g. feet, value: item tpl + weight */
/** Key: clothing slot e.g. feet, value: item tpl + weight */
clothing?: AdjustmentDetails;
}
export interface AdjustmentDetails {
add: Record<string, Record<string, number>>;
edit: Record<string, Record<string, number>>;
}
export interface IRandomisedResourceDetails {
food: IRandomisedResourceValues;
meds: IRandomisedResourceValues;
}
export interface IRandomisedResourceValues {
/** Minimum percent of item to randomized between min and max resource*/
resourcePercent: number;
/** Chance for randomization to not occur */
chanceMaxResourcePercent: number;
}

View File

@ -33,7 +33,6 @@ export interface ILocationConfig extends IBaseConfig {
minFillLooseMagazinePercent: number;
/** How full must a random static magazine be %*/
minFillStaticMagazinePercent: number;
makeWishingTreeAlwaysGiveGift: boolean;
allowDuplicateItemsInStaticContainers: boolean;
/** Key: map, value: loose loot ids to ignore */
looseLootBlacklist: Record<string, string[]>;

View File

@ -0,0 +1,9 @@
import { Spawnpoint } from "../../../models/eft/common/ILooseLoot";
import { IBaseConfig } from "./IBaseConfig";
export interface ILootConfig extends IBaseConfig {
kind: "aki-loot";
/** Spawn positions to add into a map, key=mapid */
looseLoot: Record<string, Spawnpoint[]>;
/** Loose loot probability adjustments to apply on game start */
looseLootSpawnPointAdjustments: Record<string, Record<string, number>>;
}

View File

@ -1,6 +1,6 @@
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase";
import { IHideoutImprovement, Productive, TraderData, TraderInfo } from "../models/eft/common/tables/IBotBase";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -26,6 +26,12 @@ export declare class EventOutputHolder {
* @param sessionId Session id
*/
updateOutputProperties(sessionId: string): void;
/**
* Convert the internal trader data object into an object we can send to the client
* @param traderData server data for traders
* @returns
*/
protected constructTraderRelations(traderData: Record<string, TraderInfo>): Record<string, TraderData>;
/**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile

View File

@ -22,9 +22,9 @@ export declare class BotEquipmentFilterService {
*/
filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void;
/**
* Iterate over the changes passed in and alter data in baseValues
* Iterate over the changes passed in and apply them to baseValues parameter
* @param equipmentChanges Changes to apply
* @param baseValues Values to update
* @param baseValues data to update
*/
protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void;
/**

View File

@ -64,7 +64,6 @@ export declare class ProfileFixerService {
*/
protected updateProfileQuestDataValues(pmcProfile: IPmcData): void;
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void;
/**
* Some profiles have hideout maxed and therefore no improvements
* @param pmcProfile Profile to add improvement data to
@ -92,7 +91,6 @@ export declare class ProfileFixerService {
* @param pmcProfile
*/
protected updateProfilePocketsToNewId(pmcProfile: IPmcData): void;
addMissingArmorRepairSkill(pmcProfile: IPmcData): void;
/**
* Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing
* @param pmcProfile Profile to update
@ -126,4 +124,9 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to update
*/
removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void;
/**
* 26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets
* @param pmcProfile Profile to add missing IDs to
*/
addMissingIdsToBonuses(pmcProfile: IPmcData): void;
}

View File

@ -1,16 +1,21 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { ItemHelper } from "./ItemHelper";
export declare class RagfairTaxHelper {
export declare class RagfairTaxService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;
calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number;
protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number;
}

View File

@ -14,9 +14,11 @@ import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
/**
@ -27,9 +29,10 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected ragfairTaxService: RagfairTaxService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
@ -53,4 +56,5 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
/** Handle client/reports/ragfair/send */
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
}

View File

@ -14,6 +14,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILootConfig } from "../models/spt/config/ILootConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -58,12 +59,14 @@ export declare class GameController {
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected pmcConfig: IPmcConfig;
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);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated

View File

@ -7,6 +7,7 @@ import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsura
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Insurance } from "../models/eft/profile/IAkiProfile";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -36,6 +37,11 @@ export declare class InsuranceController {
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Change SlotId of children inside Containers to be a root item
* @param insured Insured Items
*/
protected updateSlotIdOfContainersChildren(insured: Insurance): void;
/**
* Should the passed in item be removed from player inventory
* @param insuredItem Insurued item to roll to lose

View File

@ -8,7 +8,6 @@ import { RagfairHelper } from "../helpers/RagfairHelper";
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
@ -34,6 +33,7 @@ import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
@ -50,7 +50,7 @@ export declare class RagfairController {
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
protected ragfairSellHelper: RagfairSellHelper;
protected ragfairTaxHelper: RagfairTaxHelper;
protected ragfairTaxService: RagfairTaxService;
protected ragfairSortHelper: RagfairSortHelper;
protected ragfairOfferHelper: RagfairOfferHelper;
protected profileHelper: ProfileHelper;
@ -66,7 +66,7 @@ export declare class RagfairController {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed

View File

@ -83,10 +83,11 @@ export declare class BotEquipmentModGenerator {
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
* Set mod spawn chances to defined amount
* @param modSpawnChances Chance dictionary to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId: string): boolean;
protected sortModKeys(unsortedKeys: string[]): string[];
/**
* Get a Slot property for an item (chamber/cartridge/slot)
@ -193,10 +194,12 @@ export declare class BotEquipmentModGenerator {
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Filter out non-whitelisted weapon scopes
* Controlled by bot.json weaponSightWhitelist
* e.g. filter out rifle scopes from SMGs
* @param weapon Weapon scopes will be added to
* @param scopes Full scope pool
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
* @returns array of scope tpls that have been filtered
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
*/
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -2,7 +2,7 @@ import { ApplicationContext } from "../context/ApplicationContext";
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "../models/spt/config/IBotConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -33,6 +33,13 @@ export declare class BotGeneratorHelper {
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd;
};
/**
* Randomize the HpResource for bots e.g (245/400 resources)
* @param maxResource Max resource value of medical items
* @param randomizationValues Value provided from config
* @returns Randomized value from maxHpResource
*/
protected getRandomizedResourceValue(maxResource: number, randomizationValues: IRandomisedResourceValues): number;
/**
* Get the chance for the weapon attachment or helmet equipment to be set as activated
* @param botRole role of bot with weapon/helmet

View File

@ -1,16 +0,0 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { ItemHelper } from "./ItemHelper";
export declare class RagfairTaxHelper {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper;
constructor(logger: ILogger, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper);
calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number;
protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number;
}

View File

@ -367,10 +367,18 @@ export interface Quest {
export interface TraderInfo {
loyaltyLevel: number;
salesSum: number;
disabled: boolean;
standing: number;
nextResupply: number;
unlocked: boolean;
disabled: boolean;
}
/** This object is sent to the client as part of traderRelations */
export interface TraderData {
salesSum: number;
standing: number;
loyalty: number;
unlocked: boolean;
disabled: boolean;
}
export interface RagfairInfo {
rating: number;

View File

@ -1,5 +1,5 @@
export interface IGameConfigResponse {
aid: string;
aid: number;
lang: string;
languages: Record<string, string>;
ndaFree: boolean;

View File

@ -1,6 +1,6 @@
import { EquipmentBuildType } from "../../../models/enums/EquipmentBuildType";
import { QuestStatus } from "../../../models/enums/QuestStatus";
import { Health, Productive, Skills, TraderInfo } from "../common/tables/IBotBase";
import { Health, Productive, Skills, TraderData } from "../common/tables/IBotBase";
import { Item, Upd } from "../common/tables/IItem";
import { IQuest } from "../common/tables/IQuest";
import { IPmcDataRepeatableQuest } from "../common/tables/IRepeatableQuests";
@ -29,7 +29,7 @@ export interface ProfileChange {
improvements: Record<string, Improvement>;
skills: Skills;
health: Health;
traderRelations: Record<string, TraderInfo>;
traderRelations: Record<string, TraderData>;
repeatableQuests?: IPmcDataRepeatableQuest[];
recipeUnlocked: Record<string, boolean>;
changedHideoutStashes?: Record<string, IHideoutStashItem>;

View File

@ -0,0 +1,6 @@
export interface IStorePlayerOfferTaxAmountRequestData {
id: string;
tpl: string;
count: number;
fee: number;
}

View File

@ -3,6 +3,7 @@ export declare enum BaseClasses {
UBGL = "55818b014bdc2ddc698b456b",
ARMOR = "5448e54d4bdc2dcc718b4568",
ARMOREDEQUIPMENT = "57bef4c42459772e8d35a53b",
REPAIR_KITS = "616eb7aea207f41933308f46",
HEADWEAR = "5a341c4086f77401f2541505",
FACECOVER = "5a341c4686f77469e155819e",
VEST = "5448e5284bdc2dcb718b4567",

View File

@ -12,6 +12,7 @@ export declare enum ConfigTypes {
ITEM = "aki-item",
LOCALE = "aki-locale",
LOCATION = "aki-location",
LOOT = "aki-loot",
MATCH = "aki-match",
PLAYERSCAV = "aki-playerscav",
PMC_CHAT_RESPONSE = "aki-pmcchatresponse",

View File

@ -10,6 +10,8 @@ export interface IBotConfig extends IBaseConfig {
bosses: string[];
/** Control weapon/armor durability min/max values for each bot type */
durability: IBotDurability;
/** Controls the percentage values of randomization item resources */
lootItemResourceRandomization: Record<string, IRandomisedResourceDetails>;
/** Control the weighting of how expensive an average loot item is on a PMC or Scav */
lootNValue: LootNvalue;
/** Control what bots are added to a bots revenge list key: bottype, value: bottypes to revenge on seeing their death */
@ -133,10 +135,20 @@ export interface WeightingAdjustmentDetails {
ammo?: AdjustmentDetails;
/** Key: equipment slot e.g. TacticalVest, value: item tpl + weight */
equipment?: AdjustmentDetails;
/** Key: clothing slor e.g. feet, value: item tpl + weight */
/** Key: clothing slot e.g. feet, value: item tpl + weight */
clothing?: AdjustmentDetails;
}
export interface AdjustmentDetails {
add: Record<string, Record<string, number>>;
edit: Record<string, Record<string, number>>;
}
export interface IRandomisedResourceDetails {
food: IRandomisedResourceValues;
meds: IRandomisedResourceValues;
}
export interface IRandomisedResourceValues {
/** Minimum percent of item to randomized between min and max resource*/
resourcePercent: number;
/** Chance for randomization to not occur */
chanceMaxResourcePercent: number;
}

View File

@ -33,7 +33,6 @@ export interface ILocationConfig extends IBaseConfig {
minFillLooseMagazinePercent: number;
/** How full must a random static magazine be %*/
minFillStaticMagazinePercent: number;
makeWishingTreeAlwaysGiveGift: boolean;
allowDuplicateItemsInStaticContainers: boolean;
/** Key: map, value: loose loot ids to ignore */
looseLootBlacklist: Record<string, string[]>;

View File

@ -0,0 +1,9 @@
import { Spawnpoint } from "../../../models/eft/common/ILooseLoot";
import { IBaseConfig } from "./IBaseConfig";
export interface ILootConfig extends IBaseConfig {
kind: "aki-loot";
/** Spawn positions to add into a map, key=mapid */
looseLoot: Record<string, Spawnpoint[]>;
/** Loose loot probability adjustments to apply on game start */
looseLootSpawnPointAdjustments: Record<string, Record<string, number>>;
}

View File

@ -1,6 +1,6 @@
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHideoutImprovement, Productive } from "../models/eft/common/tables/IBotBase";
import { IHideoutImprovement, Productive, TraderData, TraderInfo } from "../models/eft/common/tables/IBotBase";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -26,6 +26,12 @@ export declare class EventOutputHolder {
* @param sessionId Session id
*/
updateOutputProperties(sessionId: string): void;
/**
* Convert the internal trader data object into an object we can send to the client
* @param traderData server data for traders
* @returns
*/
protected constructTraderRelations(traderData: Record<string, TraderInfo>): Record<string, TraderData>;
/**
* Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true
* @param pmcData Player profile

View File

@ -22,9 +22,9 @@ export declare class BotEquipmentFilterService {
*/
filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void;
/**
* Iterate over the changes passed in and alter data in baseValues
* Iterate over the changes passed in and apply them to baseValues parameter
* @param equipmentChanges Changes to apply
* @param baseValues Values to update
* @param baseValues data to update
*/
protected adjustChances(equipmentChanges: Record<string, number>, baseValues: EquipmentChances | ModsChances): void;
/**

View File

@ -64,7 +64,6 @@ export declare class ProfileFixerService {
*/
protected updateProfileQuestDataValues(pmcProfile: IPmcData): void;
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
protected addMissingWorkbenchWeaponSkills(pmcProfile: IPmcData): void;
/**
* Some profiles have hideout maxed and therefore no improvements
* @param pmcProfile Profile to add improvement data to
@ -92,7 +91,6 @@ export declare class ProfileFixerService {
* @param pmcProfile
*/
protected updateProfilePocketsToNewId(pmcProfile: IPmcData): void;
addMissingArmorRepairSkill(pmcProfile: IPmcData): void;
/**
* Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing
* @param pmcProfile Profile to update
@ -126,4 +124,9 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to update
*/
removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void;
/**
* 26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets
* @param pmcProfile Profile to add missing IDs to
*/
addMissingIdsToBonuses(pmcProfile: IPmcData): void;
}

View File

@ -0,0 +1,21 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairPriceService } from "../services/RagfairPriceService";
export declare class RagfairTaxService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;
calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number;
protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number;
}

View File

@ -14,9 +14,11 @@ import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
/**
@ -27,9 +29,10 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected ragfairTaxService: RagfairTaxService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
@ -53,4 +56,5 @@ export declare class RagfairCallbacks implements OnLoad, OnUpdate {
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
/** Handle client/reports/ragfair/send */
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
}

View File

@ -14,6 +14,7 @@ import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILootConfig } from "../models/spt/config/ILootConfig";
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@ -58,12 +59,14 @@ export declare class GameController {
protected locationConfig: ILocationConfig;
protected ragfairConfig: IRagfairConfig;
protected pmcConfig: IPmcConfig;
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);
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected makeCustomsWishingTreeLootGuaranteed(): void;
protected addCustomLooseLootPositions(): void;
protected adjustLooseLootSpawnProbabilities(): void;
protected setHideoutAreasAndCraftsTo30Secs(): void;
/**
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated

View File

@ -7,6 +7,7 @@ import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsura
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Insurance } from "../models/eft/profile/IAkiProfile";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
@ -36,6 +37,11 @@ export declare class InsuranceController {
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Change SlotId of children inside Containers to be a root item
* @param insured Insured Items
*/
protected updateSlotIdOfContainersChildren(insured: Insurance): void;
/**
* Should the passed in item be removed from player inventory
* @param insuredItem Insurued item to roll to lose

View File

@ -8,7 +8,6 @@ import { RagfairHelper } from "../helpers/RagfairHelper";
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
@ -34,6 +33,7 @@ import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
import { RagfairTaxService } from "../services/RagfairTaxService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
@ -50,7 +50,7 @@ export declare class RagfairController {
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
protected ragfairSellHelper: RagfairSellHelper;
protected ragfairTaxHelper: RagfairTaxHelper;
protected ragfairTaxService: RagfairTaxService;
protected ragfairSortHelper: RagfairSortHelper;
protected ragfairOfferHelper: RagfairOfferHelper;
protected profileHelper: ProfileHelper;
@ -66,7 +66,7 @@ export declare class RagfairController {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed

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