Update types for 3.5.4
This commit is contained in:
parent
af9cacc6e9
commit
33f835fb83
@ -13,6 +13,7 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class BotController {
|
||||
protected logger: ILogger;
|
||||
@ -21,6 +22,7 @@ export declare class BotController {
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected botGenerationCacheService: BotGenerationCacheService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected configServer: ConfigServer;
|
||||
@ -28,7 +30,7 @@ export declare class BotController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected botConfig: IBotConfig;
|
||||
static readonly pmcTypeLabel = "PMC";
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Return the number of bot loadout varieties to be generated
|
||||
* @param type bot Type we want the loadout gen count for
|
||||
|
@ -43,6 +43,11 @@ export declare class GameController {
|
||||
protected locationConfig: ILocationConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
/**
|
||||
* Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it
|
||||
* @param pmcProfile Player profile
|
||||
*/
|
||||
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* When player logs in, iterate over all active effects and reduce timer
|
||||
* TODO - add body part HP regen
|
||||
|
@ -19,6 +19,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { PmcChatResponseService } from "../services/PmcChatResponseService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -33,6 +34,7 @@ export declare class InraidController {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected pmcChatResponseService: PmcChatResponseService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected questHelper: QuestHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -46,7 +48,7 @@ export declare class InraidController {
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, localeService: LocaleService, pmcChatResponseService: PmcChatResponseService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, notificationSendHelper: NotificationSendHelper, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, localeService: LocaleService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, notificationSendHelper: NotificationSendHelper, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
/**
|
||||
* Save locationId to active profiles inraid object AND app context
|
||||
* @param sessionID Session id
|
||||
|
@ -3,20 +3,28 @@ import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
||||
import { Info } from "../models/eft/profile/IAkiProfile";
|
||||
import { IConnectResponse } from "../models/eft/profile/IConnectResponse";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
export declare class LauncherController {
|
||||
protected hashUtil: HashUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
||||
connect(): any;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
connect(): IConnectResponse;
|
||||
/**
|
||||
* Get descriptive text for each of the profile edtions a player can choose
|
||||
* @returns
|
||||
*/
|
||||
protected getProfileDescriptions(): Record<string, string>;
|
||||
find(sessionIdKey: string): Info;
|
||||
login(info: ILoginRequestData): string;
|
||||
register(info: IRegisterData): string;
|
||||
|
@ -1,9 +1,12 @@
|
||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
||||
import { LootGenerator } from "../generators/LootGenerator";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||
import { LootItem } from "../models/spt/services/LootItem";
|
||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
@ -14,6 +17,7 @@ import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class LocationController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected logger: ILogger;
|
||||
protected locationGenerator: LocationGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
@ -22,14 +26,29 @@ export declare class LocationController {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
get(location: string): ILocationBase;
|
||||
generate(name: string): ILocationBase;
|
||||
/**
|
||||
* Get all maps base location properties without loot data
|
||||
* @returns ILocationsGenerateAllResponse
|
||||
*/
|
||||
generateAll(): ILocationsGenerateAllResponse;
|
||||
/**
|
||||
* Get loot for an airdop container
|
||||
* Generates it randomly based on config/airdrop.json values
|
||||
* @returns Array of LootItem
|
||||
* @returns Array of LootItem objects
|
||||
*/
|
||||
getAirdropLoot(): LootItem[];
|
||||
/**
|
||||
* Randomly pick a type of airdrop loot using weighted values from config
|
||||
* @returns airdrop type value
|
||||
*/
|
||||
protected chooseAirdropType(): AirdropTypeEnum;
|
||||
/**
|
||||
* Get the configuration for a specific type of airdrop
|
||||
* @param airdropType Type of airdrop to get settings for
|
||||
* @returns LootRequest
|
||||
*/
|
||||
protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest;
|
||||
}
|
||||
|
@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -46,10 +47,10 @@ export declare class QuestController {
|
||||
getClientQuests(sessionID: string): IQuest[];
|
||||
/**
|
||||
* Is the quest for the opposite side the player is on
|
||||
* @param side player side (usec/bear)
|
||||
* @param questId questId to check
|
||||
* @param playerSide Player side (usec/bear)
|
||||
* @param questId QuestId to check
|
||||
*/
|
||||
protected questIsForOtherSide(side: string, questId: string): boolean;
|
||||
protected questIsForOtherSide(playerSide: string, questId: string): boolean;
|
||||
/**
|
||||
* Handle the client accepting a quest and starting it
|
||||
* Send starting rewards if any to player and
|
||||
@ -124,6 +125,22 @@ export declare class QuestController {
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log that repeatable quest failed a condition check
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log quest item handed over did not match what is required
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param itemHandedOver Non-matching item found
|
||||
* @param handoverRequirements Quest handover requirements
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Increment a backend counter stored value by an amount,
|
||||
* Create counter if it does not exist
|
||||
|
@ -96,7 +96,7 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
|
||||
/**
|
||||
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
||||
* Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
||||
* never return true for an item that has 0% spawn chance
|
||||
* @param itemSlot slot the item sits in
|
||||
* @param modSlot slot the mod sits in
|
||||
|
@ -2,7 +2,7 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health as PmcHealth, IBaseJsonSkills, IBaseSkill, IBotBase, Info, Skills as botSkills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
@ -84,7 +84,18 @@ export declare class BotGenerator {
|
||||
* @returns PmcHealth object
|
||||
*/
|
||||
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
|
||||
protected generateSkills(skillsObj: Skills): Skills;
|
||||
/**
|
||||
* Get a bots skills with randomsied progress value between the min and max values
|
||||
* @param botSkills Skills that should have their progress value randomised
|
||||
* @returns
|
||||
*/
|
||||
protected generateSkills(botSkills: IBaseJsonSkills): botSkills;
|
||||
/**
|
||||
* Randomise the progress value of passed in skills based on the min/max value
|
||||
* @param skills Skills to randomise
|
||||
* @returns Skills with randomised progress values as an array
|
||||
*/
|
||||
protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[];
|
||||
/**
|
||||
* Generate a random Id for a bot and apply to bots _id and aid value
|
||||
* @param bot bot to update
|
||||
|
@ -34,7 +34,7 @@ export declare class BotInventoryGenerator {
|
||||
/**
|
||||
* Add equipment/weapons/loot to bot
|
||||
* @param sessionId Session id
|
||||
* @param botJsonTemplate bot/x.json data from db
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param botRole Role bot has (assault/pmcBot)
|
||||
* @param isPmc Is bot being converted into a pmc
|
||||
* @param botLevel Level of bot being generated
|
||||
|
@ -3,7 +3,7 @@ import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
@ -33,15 +33,13 @@ export declare class BotLootGenerator {
|
||||
/**
|
||||
* Add loot to bots containers
|
||||
* @param sessionId Session id
|
||||
* @param templateInventory x.json from database/bots
|
||||
* @param itemCounts Liits on item types to be added as loot
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param isPmc Will bot be a pmc
|
||||
* @param botRole Role of bot, e.g. asssult
|
||||
* @param botInventory Inventory to add loot to
|
||||
* @param equipmentChances
|
||||
* @param botLevel Level of bot
|
||||
*/
|
||||
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances, botLevel: number): void;
|
||||
generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
||||
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
||||
/**
|
||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
||||
|
@ -23,7 +23,7 @@ export declare class LootGenerator {
|
||||
* @param options parameters to adjust how loot is generated
|
||||
* @returns An array of loot items
|
||||
*/
|
||||
createRandomloot(options: LootRequest): LootItem[];
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Construct item limit record to hold max and current item count
|
||||
* @param limits limits as defined in config
|
||||
|
@ -31,7 +31,7 @@ export declare class PMCLootGenerator {
|
||||
*/
|
||||
generatePMCVestLootPool(): string[];
|
||||
/**
|
||||
* Check if item has a width/hide that lets it fit into a 1x2 slot
|
||||
* Check if item has a width/height that lets it fit into a 1x2/2x1 slot
|
||||
* 1x1 / 1x2 / 2x1
|
||||
* @param item Item to check size of
|
||||
* @returns true if it fits
|
||||
|
@ -171,17 +171,19 @@ declare class ItemHelper {
|
||||
*/
|
||||
isItemTplStackable(tpl: string): boolean;
|
||||
/**
|
||||
* split item stack if it exceeds StackMaxSize
|
||||
* split item stack if it exceeds its StackMaxSize property
|
||||
* @param itemToSplit item being split into smaller stacks
|
||||
* @returns Array of split items
|
||||
*/
|
||||
splitStack(item: Item): Item[];
|
||||
splitStack(itemToSplit: Item): Item[];
|
||||
/**
|
||||
* Find Barter items in the inventory
|
||||
* @param {string} by
|
||||
* @param {string} by tpl or id
|
||||
* @param {Object} pmcData
|
||||
* @param {string} barterItemId
|
||||
* @returns Array of Item objects
|
||||
*/
|
||||
findBarterItems(by: string, pmcData: IPmcData, barterItemId: string): Item[];
|
||||
findBarterItems(by: "tpl" | "id", pmcData: IPmcData, barterItemId: string): Item[];
|
||||
/**
|
||||
*
|
||||
* @param pmcData
|
||||
|
@ -1,6 +1,11 @@
|
||||
import { IInventoryConfig } from "../models/spt/config/IInventoryConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class PaymentHelper {
|
||||
protected configServer: ConfigServer;
|
||||
protected inventoryConfig: IInventoryConfig;
|
||||
constructor(configServer: ConfigServer);
|
||||
/**
|
||||
* Check whether tpl is Money
|
||||
* Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls)
|
||||
* @param {string} tpl
|
||||
* @returns void
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Quest } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -42,10 +43,10 @@ export declare class QuestHelper {
|
||||
/**
|
||||
* Get status of a quest in player profile by its id
|
||||
* @param pmcData Profile to search
|
||||
* @param questID Quest id to look up
|
||||
* @param questId Quest id to look up
|
||||
* @returns QuestStatus enum
|
||||
*/
|
||||
getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
||||
getQuestStatus(pmcData: IPmcData, questId: string): QuestStatus;
|
||||
/**
|
||||
* returns true is the level condition is satisfied
|
||||
* @param playerLevel Players level
|
||||
@ -81,14 +82,19 @@ export declare class QuestHelper {
|
||||
* @returns true if loyalty is high enough to fulfill quest requirement
|
||||
*/
|
||||
traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean;
|
||||
/**
|
||||
* take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
|
||||
* @param reward Reward item to fix
|
||||
* @returns Fixed rewards
|
||||
*/
|
||||
protected processReward(reward: Reward): Reward[];
|
||||
/**
|
||||
* Gets a flat list of reward items for the given quest at a specific state (e.g. Fail/Success)
|
||||
* @param quest quest to get rewards for
|
||||
* @param state Quest status that holds the items (Started, Success, Fail)
|
||||
* @param status Quest status that holds the items (Started, Success, Fail)
|
||||
* @returns array of items with the correct maxStack
|
||||
*/
|
||||
getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[];
|
||||
getQuestRewardItems(quest: IQuest, status: QuestStatus): Reward[];
|
||||
/**
|
||||
* Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile
|
||||
* @param pmcData Player profile
|
||||
@ -97,19 +103,19 @@ export declare class QuestHelper {
|
||||
*/
|
||||
getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest;
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param acceptedQuestId Quest to add to profile
|
||||
* Get quests that can be shown to player after starting a quest
|
||||
* @param startedQuestId Quest started by player
|
||||
* @param sessionID Session id
|
||||
* @returns Array of quests in profile + quest passed in as param
|
||||
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
|
||||
*/
|
||||
acceptedUnlocked(acceptedQuestId: string, sessionID: string): IQuest[];
|
||||
acceptedUnlocked(startedQuestId: string, sessionID: string): IQuest[];
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param failedQuestId
|
||||
* @param sessionID Session id
|
||||
* Get quests that can be shown to player after failing a quest
|
||||
* @param failedQuestId Id of the quest failed by player
|
||||
* @param sessionId Session id
|
||||
* @returns
|
||||
*/
|
||||
failedUnlocked(failedQuestId: string, sessionID: string): IQuest[];
|
||||
failedUnlocked(failedQuestId: string, sessionId: string): IQuest[];
|
||||
/**
|
||||
* Adjust quest money rewards by passed in multiplier
|
||||
* @param quest Quest to multiple money rewards
|
||||
@ -127,6 +133,13 @@ export declare class QuestHelper {
|
||||
* @param output ItemEvent router response
|
||||
*/
|
||||
changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Add item stack change object into output route event response
|
||||
* @param output Response to add item change event into
|
||||
* @param sessionId Session id
|
||||
* @param item Item that was adjusted
|
||||
*/
|
||||
protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: Item): void;
|
||||
/**
|
||||
* Get quests, strip all requirement conditions except level
|
||||
* @param quests quests to process
|
||||
|
@ -8,8 +8,10 @@ import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { HandbookHelper } from "./HandbookHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
export declare class TraderHelper {
|
||||
protected logger: ILogger;
|
||||
@ -17,15 +19,19 @@ export declare class TraderHelper {
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected fenceService: FenceService;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
/** Dictionary of item tpl and the highest trader rouble price */
|
||||
/** Dictionary of item tpl and the highest trader sell rouble price */
|
||||
protected highestTraderPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
/** Dictionary of item tpl and the highest trader buy back rouble price */
|
||||
protected highestTraderBuyPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer);
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
getTraderAssortsById(traderId: string): ITraderAssort;
|
||||
/**
|
||||
@ -82,8 +88,15 @@ export declare class TraderHelper {
|
||||
}): void;
|
||||
/**
|
||||
* Get the highest rouble price for an item from traders
|
||||
* UNUSED
|
||||
* @param tpl Item to look up highest pride for
|
||||
* @returns highest rouble cost for item
|
||||
*/
|
||||
getHighestTraderPriceRouble(tpl: string): number;
|
||||
/**
|
||||
* Get the highest price item can be sold to trader for (roubles)
|
||||
* @param tpl Item to look up best trader sell-to price
|
||||
* @returns Rouble price
|
||||
*/
|
||||
getHighestSellToTraderPrice(tpl: string): number;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
export declare class WeightedRandomHelper {
|
||||
/**
|
||||
* USE getWeightedValue() WHERE POSSIBLE
|
||||
* Gets a tplId from a weighted dictionary
|
||||
* @param {tplId: weighting[]} itemArray
|
||||
* @returns tplId
|
||||
@ -7,6 +8,9 @@ export declare class WeightedRandomHelper {
|
||||
getWeightedInventoryItem(itemArray: {
|
||||
[tplId: string]: unknown;
|
||||
} | ArrayLike<unknown>): string;
|
||||
getWeightedValue<T>(itemArray: {
|
||||
[key: string]: unknown;
|
||||
} | ArrayLike<unknown>): T;
|
||||
/**
|
||||
* Picks the random item based on its weight.
|
||||
* The items with higher weight will be picked more often (with a higher probability).
|
||||
|
@ -122,24 +122,27 @@ export interface Inventory {
|
||||
questStashItems: string;
|
||||
fastPanel: Record<string, string>;
|
||||
}
|
||||
export interface IBaseJsonSkills {
|
||||
Common: Record<string, Common>;
|
||||
Mastering: Record<string, Mastering>;
|
||||
Points: number;
|
||||
}
|
||||
export interface Skills {
|
||||
Common: Common[];
|
||||
Mastering: Mastering[];
|
||||
Points: number;
|
||||
}
|
||||
export interface Common {
|
||||
export interface IBaseSkill {
|
||||
Id: string;
|
||||
Progress: number;
|
||||
PointsEarnedDuringSession?: number;
|
||||
LastAccess?: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
}
|
||||
export interface Mastering {
|
||||
Id: string;
|
||||
Progress: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
export interface Common extends IBaseSkill {
|
||||
PointsEarnedDuringSession?: number;
|
||||
LastAccess?: number;
|
||||
}
|
||||
export interface Mastering extends IBaseSkill {
|
||||
}
|
||||
export interface Stats {
|
||||
CarriedQuestItems: string[];
|
||||
|
@ -104,13 +104,17 @@ export interface Generation {
|
||||
items: ItemMinMax;
|
||||
}
|
||||
export interface ItemMinMax {
|
||||
grenades: MinMax;
|
||||
healing: MinMax;
|
||||
drugs: MinMax;
|
||||
stims: MinMax;
|
||||
looseLoot: MinMax;
|
||||
magazines: MinMax;
|
||||
specialItems: MinMax;
|
||||
grenades: MinMaxWithWhitelist;
|
||||
healing: MinMaxWithWhitelist;
|
||||
drugs: MinMaxWithWhitelist;
|
||||
stims: MinMaxWithWhitelist;
|
||||
looseLoot: MinMaxWithWhitelist;
|
||||
magazines: MinMaxWithWhitelist;
|
||||
specialItems: MinMaxWithWhitelist;
|
||||
}
|
||||
export interface MinMaxWithWhitelist extends MinMax {
|
||||
/** Array of item tpls */
|
||||
whitelist: string[];
|
||||
}
|
||||
export interface Health {
|
||||
BodyParts: BodyPart[];
|
||||
|
6
TypeScript/10ScopesAndTypes/types/models/eft/profile/IConnectResponse.d.ts
vendored
Normal file
6
TypeScript/10ScopesAndTypes/types/models/eft/profile/IConnectResponse.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export interface IConnectResponse {
|
||||
backendUrl: string;
|
||||
name: string;
|
||||
editions: string[];
|
||||
profileDescriptions: Record<string, string>;
|
||||
}
|
6
TypeScript/10ScopesAndTypes/types/models/enums/AirdropType.d.ts
vendored
Normal file
6
TypeScript/10ScopesAndTypes/types/models/enums/AirdropType.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare enum AirdropTypeEnum {
|
||||
MIXED = "mixed",
|
||||
WEAPONARMOR = "weaponarmor",
|
||||
FOODMEDICAL = "foodmedical",
|
||||
BARTER = "barter"
|
||||
}
|
@ -28,6 +28,6 @@ export declare enum WildSpawnTypeNumber {
|
||||
BOSSKNIGHT = 67108864,
|
||||
FOLLOWERBIGPIPE = 134217728,
|
||||
FOLLOWERBIRDEYE = 268435456,
|
||||
SPTUSEC = 536870912,
|
||||
SPTBEAR = 1073741824
|
||||
BOSSZRYACHIY = 536870912,
|
||||
FOLLOWERZRYACHIY = 1073741824
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ITemplateItem } from "../../eft/common/tables/ITemplateItem";
|
||||
export declare class BotLootCache {
|
||||
export interface IBotLootCache {
|
||||
backpackLoot: ITemplateItem[];
|
||||
pocketLoot: ITemplateItem[];
|
||||
vestLoot: ITemplateItem[];
|
@ -1,8 +1,10 @@
|
||||
import { AirdropTypeEnum } from "../../../models/enums/AirdropType";
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IAirdropConfig extends IBaseConfig {
|
||||
kind: "aki-airdrop";
|
||||
airdropChancePercent: AirdropChancePercent;
|
||||
airdropTypeWeightings: Record<AirdropTypeEnum, number>;
|
||||
planeMinFlyHeight: number;
|
||||
planeMaxFlyHeight: number;
|
||||
planeVolume: number;
|
||||
@ -10,7 +12,7 @@ export interface IAirdropConfig extends IBaseConfig {
|
||||
crateFallSpeed: number;
|
||||
airdropMinStartTimeSeconds: number;
|
||||
airdropMaxStartTimeSeconds: number;
|
||||
loot: AirdropLoot;
|
||||
loot: Record<string, AirdropLoot>;
|
||||
}
|
||||
export interface AirdropChancePercent {
|
||||
bigmap: number;
|
||||
@ -22,12 +24,12 @@ export interface AirdropChancePercent {
|
||||
tarkovStreets: number;
|
||||
}
|
||||
export interface AirdropLoot {
|
||||
presetCount: MinMax;
|
||||
presetCount?: MinMax;
|
||||
itemCount: MinMax;
|
||||
itemBlacklist: string[];
|
||||
itemTypeWhitelist: string[];
|
||||
/** key: item base type: value: max count */
|
||||
itemLimits: Record<string, number>;
|
||||
itemStackLimits: Record<string, MinMax>;
|
||||
armorLevelWhitelist: number[];
|
||||
armorLevelWhitelist?: number[];
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType";
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
import { IBotDurability } from "./IBotDurability";
|
||||
@ -85,7 +86,7 @@ export interface ModLimits {
|
||||
}
|
||||
export interface RandomisationDetails {
|
||||
levelRange: MinMax;
|
||||
generation?: Record<string, MinMax>;
|
||||
generation?: Record<string, MinMaxWithWhitelist>;
|
||||
randomisedWeaponModSlots?: string[];
|
||||
randomisedArmorSlots?: string[];
|
||||
/** Equipment chances */
|
||||
|
@ -4,5 +4,6 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
akiVersion: string;
|
||||
projectName: string;
|
||||
compatibleTarkovVersion: string;
|
||||
serverName: string;
|
||||
commit: string;
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
|
||||
kind: "aki-inventory";
|
||||
newItemsMarkedFound: boolean;
|
||||
randomLootContainers: Record<string, RewardDetails>;
|
||||
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
|
||||
customMoneyTpls: string[];
|
||||
}
|
||||
export interface RewardDetails {
|
||||
rewardCount: number;
|
||||
|
@ -2,16 +2,24 @@ import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IRagfairConfig extends IBaseConfig {
|
||||
kind: "aki-ragfair";
|
||||
/** How many seconds should pass before expired offers and procesed + player offers checked if sold */
|
||||
runIntervalSeconds: number;
|
||||
/** Player listing settings */
|
||||
sell: Sell;
|
||||
/** Trader ids + should their assorts be listed on flea*/
|
||||
traders: Record<string, boolean>;
|
||||
dynamic: Dynamic;
|
||||
}
|
||||
export interface Sell {
|
||||
/** Should a fee be deducted from player when liting an item for sale */
|
||||
fees: boolean;
|
||||
/** Settings to control chances of offer being sold */
|
||||
chance: Chance;
|
||||
/** Settings to control how long it takes for a player offer to sell */
|
||||
time: Time;
|
||||
/** Player offer reputation gain/loss settings */
|
||||
reputation: Reputation;
|
||||
/** How many hours are simulated to figure out if player offer was sold */
|
||||
simulatedSellHours: number;
|
||||
}
|
||||
export interface Chance {
|
||||
@ -32,48 +40,77 @@ export interface Dynamic {
|
||||
purchasesAreFoundInRaid: boolean;
|
||||
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
|
||||
useTraderPriceForOffersIfHigher: boolean;
|
||||
/** Barter offer specific settings */
|
||||
barter: Barter;
|
||||
/** Dynamic offer price below handbook adjustment values */
|
||||
offerAdjustment: OfferAdjustment;
|
||||
/** How many offers should expire before an offer regeneration occurs */
|
||||
expiredOfferThreshold: number;
|
||||
/** How many offers should be listed */
|
||||
offerItemCount: MinMax;
|
||||
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
|
||||
price: MinMax;
|
||||
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
|
||||
presetPrice: MinMax;
|
||||
/** Should default presets to listed only or should non-standard presets found in globals.json be listed too */
|
||||
showDefaultPresetsOnly: boolean;
|
||||
endTimeSeconds: MinMax;
|
||||
/** Settings to control the durability range of item items listed on flea */
|
||||
condition: Condition;
|
||||
/** Size stackable items should be listed for in percent of max stack size */
|
||||
stackablePercent: MinMax;
|
||||
/** Items that cannot be stacked can have multiples sold in one offer, what range of values can be listed */
|
||||
nonStackableCount: MinMax;
|
||||
/** Range of rating offers for items being listed */
|
||||
rating: MinMax;
|
||||
/** Percentages to sell offers in each currency */
|
||||
currencies: Record<string, number>;
|
||||
/** Item tpls that should be forced to sell as a single item */
|
||||
showAsSingleStack: string[];
|
||||
/** Should christmas/halloween items be removed from flea when not within the seasonal bounds */
|
||||
removeSeasonalItemsWhenNotInEvent: boolean;
|
||||
/** Flea blacklist settings */
|
||||
blacklist: Blacklist;
|
||||
}
|
||||
export interface Barter {
|
||||
/** Should barter offers be generated */
|
||||
enable: boolean;
|
||||
/** Percentage change an offer is listed as a barter */
|
||||
chancePercent: number;
|
||||
/** Min number of required items for a barter requirement */
|
||||
itemCountMin: number;
|
||||
/** Max number of required items for a barter requirement */
|
||||
itemCountMax: number;
|
||||
/** How much can the total price of requested items vary from the item offered */
|
||||
priceRangeVariancePercent: number;
|
||||
/** Min rouble price for an offer to be considered for turning into a barter */
|
||||
minRoubleCostToBecomeBarter: number;
|
||||
/** Item Tpls to never be turned into a barter */
|
||||
itemTypeBlacklist: string[];
|
||||
}
|
||||
export interface OfferAdjustment {
|
||||
/** Shuld offer price be adjusted when below handbook price */
|
||||
adjustPriceWhenBelowHandbookPrice: boolean;
|
||||
/** How big a percentage difference does price need to vary from handbook to be considered for adjustment */
|
||||
maxPriceDifferenceBelowHandbookPercent: number;
|
||||
/** How much to multiply the handbook price to get the new price */
|
||||
handbookPriceMultipier: number;
|
||||
/** What is the minimum rouble price to consider adjusting price of item */
|
||||
priceThreshholdRub: number;
|
||||
}
|
||||
export interface Condition {
|
||||
/** Percentage change durability is altered */
|
||||
conditionChance: number;
|
||||
min: number;
|
||||
max: number;
|
||||
}
|
||||
export interface Blacklist {
|
||||
/**
|
||||
* show/hide trader items that are blacklisted by bsg
|
||||
*/
|
||||
traderItems: boolean;
|
||||
/** Custom blacklist for item Tpls */
|
||||
custom: string[];
|
||||
/** BSG blacklist a large number of items from flea, true = use blacklist */
|
||||
enableBsgList: boolean;
|
||||
/** Should quest items be blacklisted from flea */
|
||||
enableQuestList: boolean;
|
||||
/** Should trader items that are blacklisted by bsg */
|
||||
traderItems: boolean;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
export declare class LootRequest {
|
||||
export interface LootRequest {
|
||||
presetCount: MinMax;
|
||||
itemCount: MinMax;
|
||||
itemBlacklist: string[];
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -30,7 +29,7 @@ export declare class BotEquipmentFilterService {
|
||||
* @param generationChanges Changes to apply
|
||||
* @param baseBotGeneration dictionary to update
|
||||
*/
|
||||
protected adjustGenerationChances(generationChanges: Record<string, MinMax>, baseBotGeneration: Generation): void;
|
||||
protected adjustGenerationChances(generationChanges: Record<string, MinMaxWithWhitelist>, baseBotGeneration: Generation): void;
|
||||
/**
|
||||
* Get equipment settings for bot
|
||||
* @param botEquipmentRole equipment role to return
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { PMCLootGenerator } from "../generators/PMCLootGenerator";
|
||||
import { Items } from "../models/eft/common/tables/IBotType";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { ITemplateItem, Props } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache";
|
||||
import { IBotLootCache, LootCacheType } from "../models/spt/bots/IBotLootCache";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
@ -10,12 +11,13 @@ import { RagfairPriceService } from "./RagfairPriceService";
|
||||
export declare class BotLootCacheService {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected pmcLootGenerator: PMCLootGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected lootCache: Record<string, BotLootCache>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
|
||||
protected lootCache: Record<string, IBotLootCache>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
|
||||
/**
|
||||
* Remove all cached bot loot data
|
||||
*/
|
||||
@ -25,17 +27,17 @@ export declare class BotLootCacheService {
|
||||
* @param botRole bot to get loot for
|
||||
* @param isPmc is the bot a pmc
|
||||
* @param lootType what type of loot is needed (backpack/pocket/stim/vest etc)
|
||||
* @param lootPool the full pool of loot (needed when cache is empty)
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @returns ITemplateItem array
|
||||
*/
|
||||
getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, lootPool: Items): ITemplateItem[];
|
||||
getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, botJsonTemplate: IBotType): ITemplateItem[];
|
||||
/**
|
||||
* Generate loot for a bot and store inside a private class property
|
||||
* @param botRole bots role (assault / pmcBot etc)
|
||||
* @param lootPool the full pool of loot we use to create the various sub-categories with
|
||||
* @param isPmc Is the bot a PMC (alteres what loot is cached)
|
||||
* @param botJsonTemplate db template for bot having its loot generated
|
||||
*/
|
||||
protected addLootToCache(botRole: string, isPmc: boolean, lootPool: Items): void;
|
||||
protected addLootToCache(botRole: string, isPmc: boolean, botJsonTemplate: IBotType): void;
|
||||
/**
|
||||
* Sort a pool of item objects by its flea price
|
||||
* @param poolToSort pool of items to sort
|
||||
|
23
TypeScript/10ScopesAndTypes/types/services/MatchBotDetailsCacheService.d.ts
vendored
Normal file
23
TypeScript/10ScopesAndTypes/types/services/MatchBotDetailsCacheService.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
/** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */
|
||||
export declare class MatchBotDetailsCacheService {
|
||||
protected logger: ILogger;
|
||||
protected botDetailsCache: Record<string, IBotBase>;
|
||||
constructor(logger: ILogger);
|
||||
/**
|
||||
* Store a bot in the cache, keyed by its name
|
||||
* @param botToCache Bot details to cache
|
||||
*/
|
||||
cacheBot(botToCache: IBotBase): void;
|
||||
/**
|
||||
* Clean the cache of all bot details
|
||||
*/
|
||||
clearCache(): void;
|
||||
/**
|
||||
* Find a bot in the cache by its name
|
||||
* @param botName Name of bot to find
|
||||
* @returns Bot details
|
||||
*/
|
||||
getBotByName(botName: string): IBotBase;
|
||||
}
|
@ -1,38 +1,45 @@
|
||||
import { NotificationSendHelper } from "../helpers/NotificationSendHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Victim } from "../models/eft/common/tables/IBotBase";
|
||||
import { Aggressor, Victim } from "../models/eft/common/tables/IBotBase";
|
||||
import { IUserDialogInfo } from "../models/eft/profile/IAkiProfile";
|
||||
import { IPmcChatResponse } from "../models/spt/config/IPmChatResponse";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { LocalisationService } from "./LocalisationService";
|
||||
import { MatchBotDetailsCacheService } from "./MatchBotDetailsCacheService";
|
||||
export declare class PmcChatResponseService {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected notificationSendHelper: NotificationSendHelper;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected pmcResponsesConfig: IPmcChatResponse;
|
||||
constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer);
|
||||
/**
|
||||
* Chooses a random victim from those provided and sends a message to the player, can be positive or negative
|
||||
* For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative
|
||||
* @param sessionId Session id
|
||||
* @param pmcVictims Array of bots killed by player
|
||||
* @param pmcData Player profile
|
||||
*/
|
||||
sendVictimResponse(sessionId: string, pmcVictims: Victim[]): void;
|
||||
sendVictimResponse(sessionId: string, pmcVictims: Victim[], pmcData: IPmcData): void;
|
||||
/**
|
||||
* Not fully implemented yet, needs method of acquiring killers details after raid
|
||||
* @param sessionId Session id
|
||||
* @param pmcData Players profile
|
||||
* @param killer The bot who killed the player
|
||||
*/
|
||||
sendKillerResponse(sessionId: string, pmcData: IPmcData): void;
|
||||
sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: Aggressor): void;
|
||||
/**
|
||||
* Choose a localised message to send the player (different if sender was killed or killed player)
|
||||
* @param isVictim
|
||||
* @returns
|
||||
* @param isVictim Is the message coming from a bot killed by the player
|
||||
* @param pmcData Player profile
|
||||
* @returns Message from PMC to player
|
||||
*/
|
||||
protected chooseMessage(isVictim: boolean): string;
|
||||
protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string;
|
||||
/**
|
||||
* Should capitalisation be stripped from the message response before sending
|
||||
* @param isVictim Was responder a victim of player
|
||||
@ -46,11 +53,11 @@ export declare class PmcChatResponseService {
|
||||
*/
|
||||
protected allCaps(isVictim: boolean): boolean;
|
||||
/**
|
||||
* Should the word 'bro' be appended to the message being sent to player
|
||||
* Should a suffix be appended to the end of the message being sent to player
|
||||
* @param isVictim Was responder a victim of player
|
||||
* @returns true = should be stripped
|
||||
*/
|
||||
appendBroToMessageEnd(isVictim: boolean): boolean;
|
||||
appendSuffixToMessageEnd(isVictim: boolean): boolean;
|
||||
/**
|
||||
* Choose a type of response based on the weightings in pmc response config
|
||||
* @param isVictim Was responder killed by player
|
||||
@ -64,10 +71,21 @@ export declare class PmcChatResponseService {
|
||||
* @returns
|
||||
*/
|
||||
protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[];
|
||||
/**
|
||||
* Get all locale keys that start with `pmcresponse-suffix`
|
||||
* @returns array of keys
|
||||
*/
|
||||
protected getResponseSuffixLocaleKeys(): string[];
|
||||
/**
|
||||
* Randomly draw a victim of the the array and return thier details
|
||||
* @param pmcVictims Possible victims to choose from
|
||||
* @returns IUserDialogInfo
|
||||
*/
|
||||
protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo;
|
||||
/**
|
||||
* Convert a victim object into a IUserDialogInfo object
|
||||
* @param pmcVictim victim to convert
|
||||
* @returns IUserDialogInfo
|
||||
*/
|
||||
protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class BotController {
|
||||
protected logger: ILogger;
|
||||
@ -21,6 +22,7 @@ export declare class BotController {
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected botGenerationCacheService: BotGenerationCacheService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected configServer: ConfigServer;
|
||||
@ -28,7 +30,7 @@ export declare class BotController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected botConfig: IBotConfig;
|
||||
static readonly pmcTypeLabel = "PMC";
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Return the number of bot loadout varieties to be generated
|
||||
* @param type bot Type we want the loadout gen count for
|
||||
|
@ -43,6 +43,11 @@ export declare class GameController {
|
||||
protected locationConfig: ILocationConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
/**
|
||||
* Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it
|
||||
* @param pmcProfile Player profile
|
||||
*/
|
||||
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* When player logs in, iterate over all active effects and reduce timer
|
||||
* TODO - add body part HP regen
|
||||
|
@ -19,6 +19,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { PmcChatResponseService } from "../services/PmcChatResponseService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -33,6 +34,7 @@ export declare class InraidController {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected pmcChatResponseService: PmcChatResponseService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected questHelper: QuestHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -46,7 +48,7 @@ export declare class InraidController {
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, localeService: LocaleService, pmcChatResponseService: PmcChatResponseService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, notificationSendHelper: NotificationSendHelper, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, localeService: LocaleService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, notificationSendHelper: NotificationSendHelper, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
/**
|
||||
* Save locationId to active profiles inraid object AND app context
|
||||
* @param sessionID Session id
|
||||
|
@ -3,20 +3,28 @@ import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
||||
import { Info } from "../models/eft/profile/IAkiProfile";
|
||||
import { IConnectResponse } from "../models/eft/profile/IConnectResponse";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
export declare class LauncherController {
|
||||
protected hashUtil: HashUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
||||
connect(): any;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
connect(): IConnectResponse;
|
||||
/**
|
||||
* Get descriptive text for each of the profile edtions a player can choose
|
||||
* @returns
|
||||
*/
|
||||
protected getProfileDescriptions(): Record<string, string>;
|
||||
find(sessionIdKey: string): Info;
|
||||
login(info: ILoginRequestData): string;
|
||||
register(info: IRegisterData): string;
|
||||
|
@ -1,9 +1,12 @@
|
||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
||||
import { LootGenerator } from "../generators/LootGenerator";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||
import { LootItem } from "../models/spt/services/LootItem";
|
||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
@ -14,6 +17,7 @@ import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class LocationController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected logger: ILogger;
|
||||
protected locationGenerator: LocationGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
@ -22,14 +26,29 @@ export declare class LocationController {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
get(location: string): ILocationBase;
|
||||
generate(name: string): ILocationBase;
|
||||
/**
|
||||
* Get all maps base location properties without loot data
|
||||
* @returns ILocationsGenerateAllResponse
|
||||
*/
|
||||
generateAll(): ILocationsGenerateAllResponse;
|
||||
/**
|
||||
* Get loot for an airdop container
|
||||
* Generates it randomly based on config/airdrop.json values
|
||||
* @returns Array of LootItem
|
||||
* @returns Array of LootItem objects
|
||||
*/
|
||||
getAirdropLoot(): LootItem[];
|
||||
/**
|
||||
* Randomly pick a type of airdrop loot using weighted values from config
|
||||
* @returns airdrop type value
|
||||
*/
|
||||
protected chooseAirdropType(): AirdropTypeEnum;
|
||||
/**
|
||||
* Get the configuration for a specific type of airdrop
|
||||
* @param airdropType Type of airdrop to get settings for
|
||||
* @returns LootRequest
|
||||
*/
|
||||
protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest;
|
||||
}
|
||||
|
@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -46,10 +47,10 @@ export declare class QuestController {
|
||||
getClientQuests(sessionID: string): IQuest[];
|
||||
/**
|
||||
* Is the quest for the opposite side the player is on
|
||||
* @param side player side (usec/bear)
|
||||
* @param questId questId to check
|
||||
* @param playerSide Player side (usec/bear)
|
||||
* @param questId QuestId to check
|
||||
*/
|
||||
protected questIsForOtherSide(side: string, questId: string): boolean;
|
||||
protected questIsForOtherSide(playerSide: string, questId: string): boolean;
|
||||
/**
|
||||
* Handle the client accepting a quest and starting it
|
||||
* Send starting rewards if any to player and
|
||||
@ -124,6 +125,22 @@ export declare class QuestController {
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log that repeatable quest failed a condition check
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log quest item handed over did not match what is required
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param itemHandedOver Non-matching item found
|
||||
* @param handoverRequirements Quest handover requirements
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Increment a backend counter stored value by an amount,
|
||||
* Create counter if it does not exist
|
||||
|
@ -96,7 +96,7 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
|
||||
/**
|
||||
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
||||
* Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
||||
* never return true for an item that has 0% spawn chance
|
||||
* @param itemSlot slot the item sits in
|
||||
* @param modSlot slot the mod sits in
|
||||
|
@ -2,7 +2,7 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health as PmcHealth, IBaseJsonSkills, IBaseSkill, IBotBase, Info, Skills as botSkills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
@ -84,7 +84,18 @@ export declare class BotGenerator {
|
||||
* @returns PmcHealth object
|
||||
*/
|
||||
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
|
||||
protected generateSkills(skillsObj: Skills): Skills;
|
||||
/**
|
||||
* Get a bots skills with randomsied progress value between the min and max values
|
||||
* @param botSkills Skills that should have their progress value randomised
|
||||
* @returns
|
||||
*/
|
||||
protected generateSkills(botSkills: IBaseJsonSkills): botSkills;
|
||||
/**
|
||||
* Randomise the progress value of passed in skills based on the min/max value
|
||||
* @param skills Skills to randomise
|
||||
* @returns Skills with randomised progress values as an array
|
||||
*/
|
||||
protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[];
|
||||
/**
|
||||
* Generate a random Id for a bot and apply to bots _id and aid value
|
||||
* @param bot bot to update
|
||||
|
@ -34,7 +34,7 @@ export declare class BotInventoryGenerator {
|
||||
/**
|
||||
* Add equipment/weapons/loot to bot
|
||||
* @param sessionId Session id
|
||||
* @param botJsonTemplate bot/x.json data from db
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param botRole Role bot has (assault/pmcBot)
|
||||
* @param isPmc Is bot being converted into a pmc
|
||||
* @param botLevel Level of bot being generated
|
||||
|
@ -3,7 +3,7 @@ import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
@ -33,15 +33,13 @@ export declare class BotLootGenerator {
|
||||
/**
|
||||
* Add loot to bots containers
|
||||
* @param sessionId Session id
|
||||
* @param templateInventory x.json from database/bots
|
||||
* @param itemCounts Liits on item types to be added as loot
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param isPmc Will bot be a pmc
|
||||
* @param botRole Role of bot, e.g. asssult
|
||||
* @param botInventory Inventory to add loot to
|
||||
* @param equipmentChances
|
||||
* @param botLevel Level of bot
|
||||
*/
|
||||
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances, botLevel: number): void;
|
||||
generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
||||
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
||||
/**
|
||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
||||
|
@ -23,7 +23,7 @@ export declare class LootGenerator {
|
||||
* @param options parameters to adjust how loot is generated
|
||||
* @returns An array of loot items
|
||||
*/
|
||||
createRandomloot(options: LootRequest): LootItem[];
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Construct item limit record to hold max and current item count
|
||||
* @param limits limits as defined in config
|
||||
|
@ -31,7 +31,7 @@ export declare class PMCLootGenerator {
|
||||
*/
|
||||
generatePMCVestLootPool(): string[];
|
||||
/**
|
||||
* Check if item has a width/hide that lets it fit into a 1x2 slot
|
||||
* Check if item has a width/height that lets it fit into a 1x2/2x1 slot
|
||||
* 1x1 / 1x2 / 2x1
|
||||
* @param item Item to check size of
|
||||
* @returns true if it fits
|
||||
|
@ -171,17 +171,19 @@ declare class ItemHelper {
|
||||
*/
|
||||
isItemTplStackable(tpl: string): boolean;
|
||||
/**
|
||||
* split item stack if it exceeds StackMaxSize
|
||||
* split item stack if it exceeds its StackMaxSize property
|
||||
* @param itemToSplit item being split into smaller stacks
|
||||
* @returns Array of split items
|
||||
*/
|
||||
splitStack(item: Item): Item[];
|
||||
splitStack(itemToSplit: Item): Item[];
|
||||
/**
|
||||
* Find Barter items in the inventory
|
||||
* @param {string} by
|
||||
* @param {string} by tpl or id
|
||||
* @param {Object} pmcData
|
||||
* @param {string} barterItemId
|
||||
* @returns Array of Item objects
|
||||
*/
|
||||
findBarterItems(by: string, pmcData: IPmcData, barterItemId: string): Item[];
|
||||
findBarterItems(by: "tpl" | "id", pmcData: IPmcData, barterItemId: string): Item[];
|
||||
/**
|
||||
*
|
||||
* @param pmcData
|
||||
|
@ -1,6 +1,11 @@
|
||||
import { IInventoryConfig } from "../models/spt/config/IInventoryConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class PaymentHelper {
|
||||
protected configServer: ConfigServer;
|
||||
protected inventoryConfig: IInventoryConfig;
|
||||
constructor(configServer: ConfigServer);
|
||||
/**
|
||||
* Check whether tpl is Money
|
||||
* Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls)
|
||||
* @param {string} tpl
|
||||
* @returns void
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Quest } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -42,10 +43,10 @@ export declare class QuestHelper {
|
||||
/**
|
||||
* Get status of a quest in player profile by its id
|
||||
* @param pmcData Profile to search
|
||||
* @param questID Quest id to look up
|
||||
* @param questId Quest id to look up
|
||||
* @returns QuestStatus enum
|
||||
*/
|
||||
getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
||||
getQuestStatus(pmcData: IPmcData, questId: string): QuestStatus;
|
||||
/**
|
||||
* returns true is the level condition is satisfied
|
||||
* @param playerLevel Players level
|
||||
@ -81,14 +82,19 @@ export declare class QuestHelper {
|
||||
* @returns true if loyalty is high enough to fulfill quest requirement
|
||||
*/
|
||||
traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean;
|
||||
/**
|
||||
* take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
|
||||
* @param reward Reward item to fix
|
||||
* @returns Fixed rewards
|
||||
*/
|
||||
protected processReward(reward: Reward): Reward[];
|
||||
/**
|
||||
* Gets a flat list of reward items for the given quest at a specific state (e.g. Fail/Success)
|
||||
* @param quest quest to get rewards for
|
||||
* @param state Quest status that holds the items (Started, Success, Fail)
|
||||
* @param status Quest status that holds the items (Started, Success, Fail)
|
||||
* @returns array of items with the correct maxStack
|
||||
*/
|
||||
getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[];
|
||||
getQuestRewardItems(quest: IQuest, status: QuestStatus): Reward[];
|
||||
/**
|
||||
* Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile
|
||||
* @param pmcData Player profile
|
||||
@ -97,19 +103,19 @@ export declare class QuestHelper {
|
||||
*/
|
||||
getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest;
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param acceptedQuestId Quest to add to profile
|
||||
* Get quests that can be shown to player after starting a quest
|
||||
* @param startedQuestId Quest started by player
|
||||
* @param sessionID Session id
|
||||
* @returns Array of quests in profile + quest passed in as param
|
||||
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
|
||||
*/
|
||||
acceptedUnlocked(acceptedQuestId: string, sessionID: string): IQuest[];
|
||||
acceptedUnlocked(startedQuestId: string, sessionID: string): IQuest[];
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param failedQuestId
|
||||
* @param sessionID Session id
|
||||
* Get quests that can be shown to player after failing a quest
|
||||
* @param failedQuestId Id of the quest failed by player
|
||||
* @param sessionId Session id
|
||||
* @returns
|
||||
*/
|
||||
failedUnlocked(failedQuestId: string, sessionID: string): IQuest[];
|
||||
failedUnlocked(failedQuestId: string, sessionId: string): IQuest[];
|
||||
/**
|
||||
* Adjust quest money rewards by passed in multiplier
|
||||
* @param quest Quest to multiple money rewards
|
||||
@ -127,6 +133,13 @@ export declare class QuestHelper {
|
||||
* @param output ItemEvent router response
|
||||
*/
|
||||
changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Add item stack change object into output route event response
|
||||
* @param output Response to add item change event into
|
||||
* @param sessionId Session id
|
||||
* @param item Item that was adjusted
|
||||
*/
|
||||
protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: Item): void;
|
||||
/**
|
||||
* Get quests, strip all requirement conditions except level
|
||||
* @param quests quests to process
|
||||
|
@ -8,8 +8,10 @@ import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { HandbookHelper } from "./HandbookHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
export declare class TraderHelper {
|
||||
protected logger: ILogger;
|
||||
@ -17,15 +19,19 @@ export declare class TraderHelper {
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected fenceService: FenceService;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
/** Dictionary of item tpl and the highest trader rouble price */
|
||||
/** Dictionary of item tpl and the highest trader sell rouble price */
|
||||
protected highestTraderPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
/** Dictionary of item tpl and the highest trader buy back rouble price */
|
||||
protected highestTraderBuyPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer);
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
getTraderAssortsById(traderId: string): ITraderAssort;
|
||||
/**
|
||||
@ -82,8 +88,15 @@ export declare class TraderHelper {
|
||||
}): void;
|
||||
/**
|
||||
* Get the highest rouble price for an item from traders
|
||||
* UNUSED
|
||||
* @param tpl Item to look up highest pride for
|
||||
* @returns highest rouble cost for item
|
||||
*/
|
||||
getHighestTraderPriceRouble(tpl: string): number;
|
||||
/**
|
||||
* Get the highest price item can be sold to trader for (roubles)
|
||||
* @param tpl Item to look up best trader sell-to price
|
||||
* @returns Rouble price
|
||||
*/
|
||||
getHighestSellToTraderPrice(tpl: string): number;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
export declare class WeightedRandomHelper {
|
||||
/**
|
||||
* USE getWeightedValue() WHERE POSSIBLE
|
||||
* Gets a tplId from a weighted dictionary
|
||||
* @param {tplId: weighting[]} itemArray
|
||||
* @returns tplId
|
||||
@ -7,6 +8,9 @@ export declare class WeightedRandomHelper {
|
||||
getWeightedInventoryItem(itemArray: {
|
||||
[tplId: string]: unknown;
|
||||
} | ArrayLike<unknown>): string;
|
||||
getWeightedValue<T>(itemArray: {
|
||||
[key: string]: unknown;
|
||||
} | ArrayLike<unknown>): T;
|
||||
/**
|
||||
* Picks the random item based on its weight.
|
||||
* The items with higher weight will be picked more often (with a higher probability).
|
||||
|
@ -122,24 +122,27 @@ export interface Inventory {
|
||||
questStashItems: string;
|
||||
fastPanel: Record<string, string>;
|
||||
}
|
||||
export interface IBaseJsonSkills {
|
||||
Common: Record<string, Common>;
|
||||
Mastering: Record<string, Mastering>;
|
||||
Points: number;
|
||||
}
|
||||
export interface Skills {
|
||||
Common: Common[];
|
||||
Mastering: Mastering[];
|
||||
Points: number;
|
||||
}
|
||||
export interface Common {
|
||||
export interface IBaseSkill {
|
||||
Id: string;
|
||||
Progress: number;
|
||||
PointsEarnedDuringSession?: number;
|
||||
LastAccess?: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
}
|
||||
export interface Mastering {
|
||||
Id: string;
|
||||
Progress: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
export interface Common extends IBaseSkill {
|
||||
PointsEarnedDuringSession?: number;
|
||||
LastAccess?: number;
|
||||
}
|
||||
export interface Mastering extends IBaseSkill {
|
||||
}
|
||||
export interface Stats {
|
||||
CarriedQuestItems: string[];
|
||||
|
@ -104,13 +104,17 @@ export interface Generation {
|
||||
items: ItemMinMax;
|
||||
}
|
||||
export interface ItemMinMax {
|
||||
grenades: MinMax;
|
||||
healing: MinMax;
|
||||
drugs: MinMax;
|
||||
stims: MinMax;
|
||||
looseLoot: MinMax;
|
||||
magazines: MinMax;
|
||||
specialItems: MinMax;
|
||||
grenades: MinMaxWithWhitelist;
|
||||
healing: MinMaxWithWhitelist;
|
||||
drugs: MinMaxWithWhitelist;
|
||||
stims: MinMaxWithWhitelist;
|
||||
looseLoot: MinMaxWithWhitelist;
|
||||
magazines: MinMaxWithWhitelist;
|
||||
specialItems: MinMaxWithWhitelist;
|
||||
}
|
||||
export interface MinMaxWithWhitelist extends MinMax {
|
||||
/** Array of item tpls */
|
||||
whitelist: string[];
|
||||
}
|
||||
export interface Health {
|
||||
BodyParts: BodyPart[];
|
||||
|
6
TypeScript/11BundleLoadingSample/types/models/eft/profile/IConnectResponse.d.ts
vendored
Normal file
6
TypeScript/11BundleLoadingSample/types/models/eft/profile/IConnectResponse.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export interface IConnectResponse {
|
||||
backendUrl: string;
|
||||
name: string;
|
||||
editions: string[];
|
||||
profileDescriptions: Record<string, string>;
|
||||
}
|
6
TypeScript/11BundleLoadingSample/types/models/enums/AirdropType.d.ts
vendored
Normal file
6
TypeScript/11BundleLoadingSample/types/models/enums/AirdropType.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare enum AirdropTypeEnum {
|
||||
MIXED = "mixed",
|
||||
WEAPONARMOR = "weaponarmor",
|
||||
FOODMEDICAL = "foodmedical",
|
||||
BARTER = "barter"
|
||||
}
|
@ -28,6 +28,6 @@ export declare enum WildSpawnTypeNumber {
|
||||
BOSSKNIGHT = 67108864,
|
||||
FOLLOWERBIGPIPE = 134217728,
|
||||
FOLLOWERBIRDEYE = 268435456,
|
||||
SPTUSEC = 536870912,
|
||||
SPTBEAR = 1073741824
|
||||
BOSSZRYACHIY = 536870912,
|
||||
FOLLOWERZRYACHIY = 1073741824
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ITemplateItem } from "../../eft/common/tables/ITemplateItem";
|
||||
export declare class BotLootCache {
|
||||
export interface IBotLootCache {
|
||||
backpackLoot: ITemplateItem[];
|
||||
pocketLoot: ITemplateItem[];
|
||||
vestLoot: ITemplateItem[];
|
@ -1,8 +1,10 @@
|
||||
import { AirdropTypeEnum } from "../../../models/enums/AirdropType";
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IAirdropConfig extends IBaseConfig {
|
||||
kind: "aki-airdrop";
|
||||
airdropChancePercent: AirdropChancePercent;
|
||||
airdropTypeWeightings: Record<AirdropTypeEnum, number>;
|
||||
planeMinFlyHeight: number;
|
||||
planeMaxFlyHeight: number;
|
||||
planeVolume: number;
|
||||
@ -10,7 +12,7 @@ export interface IAirdropConfig extends IBaseConfig {
|
||||
crateFallSpeed: number;
|
||||
airdropMinStartTimeSeconds: number;
|
||||
airdropMaxStartTimeSeconds: number;
|
||||
loot: AirdropLoot;
|
||||
loot: Record<string, AirdropLoot>;
|
||||
}
|
||||
export interface AirdropChancePercent {
|
||||
bigmap: number;
|
||||
@ -22,12 +24,12 @@ export interface AirdropChancePercent {
|
||||
tarkovStreets: number;
|
||||
}
|
||||
export interface AirdropLoot {
|
||||
presetCount: MinMax;
|
||||
presetCount?: MinMax;
|
||||
itemCount: MinMax;
|
||||
itemBlacklist: string[];
|
||||
itemTypeWhitelist: string[];
|
||||
/** key: item base type: value: max count */
|
||||
itemLimits: Record<string, number>;
|
||||
itemStackLimits: Record<string, MinMax>;
|
||||
armorLevelWhitelist: number[];
|
||||
armorLevelWhitelist?: number[];
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType";
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
import { IBotDurability } from "./IBotDurability";
|
||||
@ -85,7 +86,7 @@ export interface ModLimits {
|
||||
}
|
||||
export interface RandomisationDetails {
|
||||
levelRange: MinMax;
|
||||
generation?: Record<string, MinMax>;
|
||||
generation?: Record<string, MinMaxWithWhitelist>;
|
||||
randomisedWeaponModSlots?: string[];
|
||||
randomisedArmorSlots?: string[];
|
||||
/** Equipment chances */
|
||||
|
@ -4,5 +4,6 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
akiVersion: string;
|
||||
projectName: string;
|
||||
compatibleTarkovVersion: string;
|
||||
serverName: string;
|
||||
commit: string;
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
|
||||
kind: "aki-inventory";
|
||||
newItemsMarkedFound: boolean;
|
||||
randomLootContainers: Record<string, RewardDetails>;
|
||||
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
|
||||
customMoneyTpls: string[];
|
||||
}
|
||||
export interface RewardDetails {
|
||||
rewardCount: number;
|
||||
|
@ -2,16 +2,24 @@ import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IRagfairConfig extends IBaseConfig {
|
||||
kind: "aki-ragfair";
|
||||
/** How many seconds should pass before expired offers and procesed + player offers checked if sold */
|
||||
runIntervalSeconds: number;
|
||||
/** Player listing settings */
|
||||
sell: Sell;
|
||||
/** Trader ids + should their assorts be listed on flea*/
|
||||
traders: Record<string, boolean>;
|
||||
dynamic: Dynamic;
|
||||
}
|
||||
export interface Sell {
|
||||
/** Should a fee be deducted from player when liting an item for sale */
|
||||
fees: boolean;
|
||||
/** Settings to control chances of offer being sold */
|
||||
chance: Chance;
|
||||
/** Settings to control how long it takes for a player offer to sell */
|
||||
time: Time;
|
||||
/** Player offer reputation gain/loss settings */
|
||||
reputation: Reputation;
|
||||
/** How many hours are simulated to figure out if player offer was sold */
|
||||
simulatedSellHours: number;
|
||||
}
|
||||
export interface Chance {
|
||||
@ -32,48 +40,77 @@ export interface Dynamic {
|
||||
purchasesAreFoundInRaid: boolean;
|
||||
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
|
||||
useTraderPriceForOffersIfHigher: boolean;
|
||||
/** Barter offer specific settings */
|
||||
barter: Barter;
|
||||
/** Dynamic offer price below handbook adjustment values */
|
||||
offerAdjustment: OfferAdjustment;
|
||||
/** How many offers should expire before an offer regeneration occurs */
|
||||
expiredOfferThreshold: number;
|
||||
/** How many offers should be listed */
|
||||
offerItemCount: MinMax;
|
||||
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
|
||||
price: MinMax;
|
||||
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
|
||||
presetPrice: MinMax;
|
||||
/** Should default presets to listed only or should non-standard presets found in globals.json be listed too */
|
||||
showDefaultPresetsOnly: boolean;
|
||||
endTimeSeconds: MinMax;
|
||||
/** Settings to control the durability range of item items listed on flea */
|
||||
condition: Condition;
|
||||
/** Size stackable items should be listed for in percent of max stack size */
|
||||
stackablePercent: MinMax;
|
||||
/** Items that cannot be stacked can have multiples sold in one offer, what range of values can be listed */
|
||||
nonStackableCount: MinMax;
|
||||
/** Range of rating offers for items being listed */
|
||||
rating: MinMax;
|
||||
/** Percentages to sell offers in each currency */
|
||||
currencies: Record<string, number>;
|
||||
/** Item tpls that should be forced to sell as a single item */
|
||||
showAsSingleStack: string[];
|
||||
/** Should christmas/halloween items be removed from flea when not within the seasonal bounds */
|
||||
removeSeasonalItemsWhenNotInEvent: boolean;
|
||||
/** Flea blacklist settings */
|
||||
blacklist: Blacklist;
|
||||
}
|
||||
export interface Barter {
|
||||
/** Should barter offers be generated */
|
||||
enable: boolean;
|
||||
/** Percentage change an offer is listed as a barter */
|
||||
chancePercent: number;
|
||||
/** Min number of required items for a barter requirement */
|
||||
itemCountMin: number;
|
||||
/** Max number of required items for a barter requirement */
|
||||
itemCountMax: number;
|
||||
/** How much can the total price of requested items vary from the item offered */
|
||||
priceRangeVariancePercent: number;
|
||||
/** Min rouble price for an offer to be considered for turning into a barter */
|
||||
minRoubleCostToBecomeBarter: number;
|
||||
/** Item Tpls to never be turned into a barter */
|
||||
itemTypeBlacklist: string[];
|
||||
}
|
||||
export interface OfferAdjustment {
|
||||
/** Shuld offer price be adjusted when below handbook price */
|
||||
adjustPriceWhenBelowHandbookPrice: boolean;
|
||||
/** How big a percentage difference does price need to vary from handbook to be considered for adjustment */
|
||||
maxPriceDifferenceBelowHandbookPercent: number;
|
||||
/** How much to multiply the handbook price to get the new price */
|
||||
handbookPriceMultipier: number;
|
||||
/** What is the minimum rouble price to consider adjusting price of item */
|
||||
priceThreshholdRub: number;
|
||||
}
|
||||
export interface Condition {
|
||||
/** Percentage change durability is altered */
|
||||
conditionChance: number;
|
||||
min: number;
|
||||
max: number;
|
||||
}
|
||||
export interface Blacklist {
|
||||
/**
|
||||
* show/hide trader items that are blacklisted by bsg
|
||||
*/
|
||||
traderItems: boolean;
|
||||
/** Custom blacklist for item Tpls */
|
||||
custom: string[];
|
||||
/** BSG blacklist a large number of items from flea, true = use blacklist */
|
||||
enableBsgList: boolean;
|
||||
/** Should quest items be blacklisted from flea */
|
||||
enableQuestList: boolean;
|
||||
/** Should trader items that are blacklisted by bsg */
|
||||
traderItems: boolean;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
export declare class LootRequest {
|
||||
export interface LootRequest {
|
||||
presetCount: MinMax;
|
||||
itemCount: MinMax;
|
||||
itemBlacklist: string[];
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -30,7 +29,7 @@ export declare class BotEquipmentFilterService {
|
||||
* @param generationChanges Changes to apply
|
||||
* @param baseBotGeneration dictionary to update
|
||||
*/
|
||||
protected adjustGenerationChances(generationChanges: Record<string, MinMax>, baseBotGeneration: Generation): void;
|
||||
protected adjustGenerationChances(generationChanges: Record<string, MinMaxWithWhitelist>, baseBotGeneration: Generation): void;
|
||||
/**
|
||||
* Get equipment settings for bot
|
||||
* @param botEquipmentRole equipment role to return
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { PMCLootGenerator } from "../generators/PMCLootGenerator";
|
||||
import { Items } from "../models/eft/common/tables/IBotType";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { ITemplateItem, Props } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache";
|
||||
import { IBotLootCache, LootCacheType } from "../models/spt/bots/IBotLootCache";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
@ -10,12 +11,13 @@ import { RagfairPriceService } from "./RagfairPriceService";
|
||||
export declare class BotLootCacheService {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected pmcLootGenerator: PMCLootGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected lootCache: Record<string, BotLootCache>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
|
||||
protected lootCache: Record<string, IBotLootCache>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
|
||||
/**
|
||||
* Remove all cached bot loot data
|
||||
*/
|
||||
@ -25,17 +27,17 @@ export declare class BotLootCacheService {
|
||||
* @param botRole bot to get loot for
|
||||
* @param isPmc is the bot a pmc
|
||||
* @param lootType what type of loot is needed (backpack/pocket/stim/vest etc)
|
||||
* @param lootPool the full pool of loot (needed when cache is empty)
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @returns ITemplateItem array
|
||||
*/
|
||||
getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, lootPool: Items): ITemplateItem[];
|
||||
getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, botJsonTemplate: IBotType): ITemplateItem[];
|
||||
/**
|
||||
* Generate loot for a bot and store inside a private class property
|
||||
* @param botRole bots role (assault / pmcBot etc)
|
||||
* @param lootPool the full pool of loot we use to create the various sub-categories with
|
||||
* @param isPmc Is the bot a PMC (alteres what loot is cached)
|
||||
* @param botJsonTemplate db template for bot having its loot generated
|
||||
*/
|
||||
protected addLootToCache(botRole: string, isPmc: boolean, lootPool: Items): void;
|
||||
protected addLootToCache(botRole: string, isPmc: boolean, botJsonTemplate: IBotType): void;
|
||||
/**
|
||||
* Sort a pool of item objects by its flea price
|
||||
* @param poolToSort pool of items to sort
|
||||
|
23
TypeScript/11BundleLoadingSample/types/services/MatchBotDetailsCacheService.d.ts
vendored
Normal file
23
TypeScript/11BundleLoadingSample/types/services/MatchBotDetailsCacheService.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
/** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */
|
||||
export declare class MatchBotDetailsCacheService {
|
||||
protected logger: ILogger;
|
||||
protected botDetailsCache: Record<string, IBotBase>;
|
||||
constructor(logger: ILogger);
|
||||
/**
|
||||
* Store a bot in the cache, keyed by its name
|
||||
* @param botToCache Bot details to cache
|
||||
*/
|
||||
cacheBot(botToCache: IBotBase): void;
|
||||
/**
|
||||
* Clean the cache of all bot details
|
||||
*/
|
||||
clearCache(): void;
|
||||
/**
|
||||
* Find a bot in the cache by its name
|
||||
* @param botName Name of bot to find
|
||||
* @returns Bot details
|
||||
*/
|
||||
getBotByName(botName: string): IBotBase;
|
||||
}
|
@ -1,38 +1,45 @@
|
||||
import { NotificationSendHelper } from "../helpers/NotificationSendHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Victim } from "../models/eft/common/tables/IBotBase";
|
||||
import { Aggressor, Victim } from "../models/eft/common/tables/IBotBase";
|
||||
import { IUserDialogInfo } from "../models/eft/profile/IAkiProfile";
|
||||
import { IPmcChatResponse } from "../models/spt/config/IPmChatResponse";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { LocalisationService } from "./LocalisationService";
|
||||
import { MatchBotDetailsCacheService } from "./MatchBotDetailsCacheService";
|
||||
export declare class PmcChatResponseService {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected notificationSendHelper: NotificationSendHelper;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected pmcResponsesConfig: IPmcChatResponse;
|
||||
constructor(randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer);
|
||||
/**
|
||||
* Chooses a random victim from those provided and sends a message to the player, can be positive or negative
|
||||
* For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative
|
||||
* @param sessionId Session id
|
||||
* @param pmcVictims Array of bots killed by player
|
||||
* @param pmcData Player profile
|
||||
*/
|
||||
sendVictimResponse(sessionId: string, pmcVictims: Victim[]): void;
|
||||
sendVictimResponse(sessionId: string, pmcVictims: Victim[], pmcData: IPmcData): void;
|
||||
/**
|
||||
* Not fully implemented yet, needs method of acquiring killers details after raid
|
||||
* @param sessionId Session id
|
||||
* @param pmcData Players profile
|
||||
* @param killer The bot who killed the player
|
||||
*/
|
||||
sendKillerResponse(sessionId: string, pmcData: IPmcData): void;
|
||||
sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: Aggressor): void;
|
||||
/**
|
||||
* Choose a localised message to send the player (different if sender was killed or killed player)
|
||||
* @param isVictim
|
||||
* @returns
|
||||
* @param isVictim Is the message coming from a bot killed by the player
|
||||
* @param pmcData Player profile
|
||||
* @returns Message from PMC to player
|
||||
*/
|
||||
protected chooseMessage(isVictim: boolean): string;
|
||||
protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string;
|
||||
/**
|
||||
* Should capitalisation be stripped from the message response before sending
|
||||
* @param isVictim Was responder a victim of player
|
||||
@ -46,11 +53,11 @@ export declare class PmcChatResponseService {
|
||||
*/
|
||||
protected allCaps(isVictim: boolean): boolean;
|
||||
/**
|
||||
* Should the word 'bro' be appended to the message being sent to player
|
||||
* Should a suffix be appended to the end of the message being sent to player
|
||||
* @param isVictim Was responder a victim of player
|
||||
* @returns true = should be stripped
|
||||
*/
|
||||
appendBroToMessageEnd(isVictim: boolean): boolean;
|
||||
appendSuffixToMessageEnd(isVictim: boolean): boolean;
|
||||
/**
|
||||
* Choose a type of response based on the weightings in pmc response config
|
||||
* @param isVictim Was responder killed by player
|
||||
@ -64,10 +71,21 @@ export declare class PmcChatResponseService {
|
||||
* @returns
|
||||
*/
|
||||
protected getResponseLocaleKeys(keyType: string, isVictim?: boolean): string[];
|
||||
/**
|
||||
* Get all locale keys that start with `pmcresponse-suffix`
|
||||
* @returns array of keys
|
||||
*/
|
||||
protected getResponseSuffixLocaleKeys(): string[];
|
||||
/**
|
||||
* Randomly draw a victim of the the array and return thier details
|
||||
* @param pmcVictims Possible victims to choose from
|
||||
* @returns IUserDialogInfo
|
||||
*/
|
||||
protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo;
|
||||
/**
|
||||
* Convert a victim object into a IUserDialogInfo object
|
||||
* @param pmcVictim victim to convert
|
||||
* @returns IUserDialogInfo
|
||||
*/
|
||||
protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class BotController {
|
||||
protected logger: ILogger;
|
||||
@ -21,6 +22,7 @@ export declare class BotController {
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected botGenerationCacheService: BotGenerationCacheService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected configServer: ConfigServer;
|
||||
@ -28,7 +30,7 @@ export declare class BotController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected botConfig: IBotConfig;
|
||||
static readonly pmcTypeLabel = "PMC";
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Return the number of bot loadout varieties to be generated
|
||||
* @param type bot Type we want the loadout gen count for
|
||||
|
@ -43,6 +43,11 @@ export declare class GameController {
|
||||
protected locationConfig: ILocationConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
/**
|
||||
* Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it
|
||||
* @param pmcProfile Player profile
|
||||
*/
|
||||
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* When player logs in, iterate over all active effects and reduce timer
|
||||
* TODO - add body part HP regen
|
||||
|
@ -19,6 +19,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { PmcChatResponseService } from "../services/PmcChatResponseService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -33,6 +34,7 @@ export declare class InraidController {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected pmcChatResponseService: PmcChatResponseService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected questHelper: QuestHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -46,7 +48,7 @@ export declare class InraidController {
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, localeService: LocaleService, pmcChatResponseService: PmcChatResponseService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, notificationSendHelper: NotificationSendHelper, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, localeService: LocaleService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, notificationSendHelper: NotificationSendHelper, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
/**
|
||||
* Save locationId to active profiles inraid object AND app context
|
||||
* @param sessionID Session id
|
||||
|
@ -3,20 +3,28 @@ import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
||||
import { Info } from "../models/eft/profile/IAkiProfile";
|
||||
import { IConnectResponse } from "../models/eft/profile/IConnectResponse";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
export declare class LauncherController {
|
||||
protected hashUtil: HashUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
|
||||
connect(): any;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
connect(): IConnectResponse;
|
||||
/**
|
||||
* Get descriptive text for each of the profile edtions a player can choose
|
||||
* @returns
|
||||
*/
|
||||
protected getProfileDescriptions(): Record<string, string>;
|
||||
find(sessionIdKey: string): Info;
|
||||
login(info: ILoginRequestData): string;
|
||||
register(info: IRegisterData): string;
|
||||
|
@ -1,9 +1,12 @@
|
||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
||||
import { LootGenerator } from "../generators/LootGenerator";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||
import { LootItem } from "../models/spt/services/LootItem";
|
||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
@ -14,6 +17,7 @@ import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class LocationController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected logger: ILogger;
|
||||
protected locationGenerator: LocationGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
@ -22,14 +26,29 @@ export declare class LocationController {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
get(location: string): ILocationBase;
|
||||
generate(name: string): ILocationBase;
|
||||
/**
|
||||
* Get all maps base location properties without loot data
|
||||
* @returns ILocationsGenerateAllResponse
|
||||
*/
|
||||
generateAll(): ILocationsGenerateAllResponse;
|
||||
/**
|
||||
* Get loot for an airdop container
|
||||
* Generates it randomly based on config/airdrop.json values
|
||||
* @returns Array of LootItem
|
||||
* @returns Array of LootItem objects
|
||||
*/
|
||||
getAirdropLoot(): LootItem[];
|
||||
/**
|
||||
* Randomly pick a type of airdrop loot using weighted values from config
|
||||
* @returns airdrop type value
|
||||
*/
|
||||
protected chooseAirdropType(): AirdropTypeEnum;
|
||||
/**
|
||||
* Get the configuration for a specific type of airdrop
|
||||
* @param airdropType Type of airdrop to get settings for
|
||||
* @returns LootRequest
|
||||
*/
|
||||
protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest;
|
||||
}
|
||||
|
@ -4,7 +4,8 @@ import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -46,10 +47,10 @@ export declare class QuestController {
|
||||
getClientQuests(sessionID: string): IQuest[];
|
||||
/**
|
||||
* Is the quest for the opposite side the player is on
|
||||
* @param side player side (usec/bear)
|
||||
* @param questId questId to check
|
||||
* @param playerSide Player side (usec/bear)
|
||||
* @param questId QuestId to check
|
||||
*/
|
||||
protected questIsForOtherSide(side: string, questId: string): boolean;
|
||||
protected questIsForOtherSide(playerSide: string, questId: string): boolean;
|
||||
/**
|
||||
* Handle the client accepting a quest and starting it
|
||||
* Send starting rewards if any to player and
|
||||
@ -124,6 +125,22 @@ export declare class QuestController {
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log that repeatable quest failed a condition check
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log quest item handed over did not match what is required
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param itemHandedOver Non-matching item found
|
||||
* @param handoverRequirements Quest handover requirements
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Increment a backend counter stored value by an amount,
|
||||
* Create counter if it does not exist
|
||||
|
@ -96,7 +96,7 @@ export declare class BotEquipmentModGenerator {
|
||||
*/
|
||||
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
|
||||
/**
|
||||
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
||||
* Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
|
||||
* never return true for an item that has 0% spawn chance
|
||||
* @param itemSlot slot the item sits in
|
||||
* @param modSlot slot the mod sits in
|
||||
|
@ -2,7 +2,7 @@ import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health as PmcHealth, IBaseJsonSkills, IBaseSkill, IBotBase, Info, Skills as botSkills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
@ -84,7 +84,18 @@ export declare class BotGenerator {
|
||||
* @returns PmcHealth object
|
||||
*/
|
||||
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
|
||||
protected generateSkills(skillsObj: Skills): Skills;
|
||||
/**
|
||||
* Get a bots skills with randomsied progress value between the min and max values
|
||||
* @param botSkills Skills that should have their progress value randomised
|
||||
* @returns
|
||||
*/
|
||||
protected generateSkills(botSkills: IBaseJsonSkills): botSkills;
|
||||
/**
|
||||
* Randomise the progress value of passed in skills based on the min/max value
|
||||
* @param skills Skills to randomise
|
||||
* @returns Skills with randomised progress values as an array
|
||||
*/
|
||||
protected getSkillsWithRandomisedProgressValue(skills: IBaseSkill[]): IBaseSkill[];
|
||||
/**
|
||||
* Generate a random Id for a bot and apply to bots _id and aid value
|
||||
* @param bot bot to update
|
||||
|
@ -34,7 +34,7 @@ export declare class BotInventoryGenerator {
|
||||
/**
|
||||
* Add equipment/weapons/loot to bot
|
||||
* @param sessionId Session id
|
||||
* @param botJsonTemplate bot/x.json data from db
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param botRole Role bot has (assault/pmcBot)
|
||||
* @param isPmc Is bot being converted into a pmc
|
||||
* @param botLevel Level of bot being generated
|
||||
|
@ -3,7 +3,7 @@ import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
@ -33,15 +33,13 @@ export declare class BotLootGenerator {
|
||||
/**
|
||||
* Add loot to bots containers
|
||||
* @param sessionId Session id
|
||||
* @param templateInventory x.json from database/bots
|
||||
* @param itemCounts Liits on item types to be added as loot
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param isPmc Will bot be a pmc
|
||||
* @param botRole Role of bot, e.g. asssult
|
||||
* @param botInventory Inventory to add loot to
|
||||
* @param equipmentChances
|
||||
* @param botLevel Level of bot
|
||||
*/
|
||||
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances, botLevel: number): void;
|
||||
generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
||||
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
||||
/**
|
||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
||||
|
@ -23,7 +23,7 @@ export declare class LootGenerator {
|
||||
* @param options parameters to adjust how loot is generated
|
||||
* @returns An array of loot items
|
||||
*/
|
||||
createRandomloot(options: LootRequest): LootItem[];
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Construct item limit record to hold max and current item count
|
||||
* @param limits limits as defined in config
|
||||
|
@ -31,7 +31,7 @@ export declare class PMCLootGenerator {
|
||||
*/
|
||||
generatePMCVestLootPool(): string[];
|
||||
/**
|
||||
* Check if item has a width/hide that lets it fit into a 1x2 slot
|
||||
* Check if item has a width/height that lets it fit into a 1x2/2x1 slot
|
||||
* 1x1 / 1x2 / 2x1
|
||||
* @param item Item to check size of
|
||||
* @returns true if it fits
|
||||
|
@ -171,17 +171,19 @@ declare class ItemHelper {
|
||||
*/
|
||||
isItemTplStackable(tpl: string): boolean;
|
||||
/**
|
||||
* split item stack if it exceeds StackMaxSize
|
||||
* split item stack if it exceeds its StackMaxSize property
|
||||
* @param itemToSplit item being split into smaller stacks
|
||||
* @returns Array of split items
|
||||
*/
|
||||
splitStack(item: Item): Item[];
|
||||
splitStack(itemToSplit: Item): Item[];
|
||||
/**
|
||||
* Find Barter items in the inventory
|
||||
* @param {string} by
|
||||
* @param {string} by tpl or id
|
||||
* @param {Object} pmcData
|
||||
* @param {string} barterItemId
|
||||
* @returns Array of Item objects
|
||||
*/
|
||||
findBarterItems(by: string, pmcData: IPmcData, barterItemId: string): Item[];
|
||||
findBarterItems(by: "tpl" | "id", pmcData: IPmcData, barterItemId: string): Item[];
|
||||
/**
|
||||
*
|
||||
* @param pmcData
|
||||
|
@ -1,6 +1,11 @@
|
||||
import { IInventoryConfig } from "../models/spt/config/IInventoryConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class PaymentHelper {
|
||||
protected configServer: ConfigServer;
|
||||
protected inventoryConfig: IInventoryConfig;
|
||||
constructor(configServer: ConfigServer);
|
||||
/**
|
||||
* Check whether tpl is Money
|
||||
* Is the passed in tpl money (also checks custom currencies in inventoryConfig.customMoneyTpls)
|
||||
* @param {string} tpl
|
||||
* @returns void
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Quest } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, AvailableForProps, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
@ -42,10 +43,10 @@ export declare class QuestHelper {
|
||||
/**
|
||||
* Get status of a quest in player profile by its id
|
||||
* @param pmcData Profile to search
|
||||
* @param questID Quest id to look up
|
||||
* @param questId Quest id to look up
|
||||
* @returns QuestStatus enum
|
||||
*/
|
||||
getQuestStatus(pmcData: IPmcData, questID: string): QuestStatus;
|
||||
getQuestStatus(pmcData: IPmcData, questId: string): QuestStatus;
|
||||
/**
|
||||
* returns true is the level condition is satisfied
|
||||
* @param playerLevel Players level
|
||||
@ -81,14 +82,19 @@ export declare class QuestHelper {
|
||||
* @returns true if loyalty is high enough to fulfill quest requirement
|
||||
*/
|
||||
traderStandingRequirementCheck(questProperties: AvailableForProps, profile: IPmcData): boolean;
|
||||
/**
|
||||
* take reward item from quest and set FiR status + fix stack sizes + fix mod Ids
|
||||
* @param reward Reward item to fix
|
||||
* @returns Fixed rewards
|
||||
*/
|
||||
protected processReward(reward: Reward): Reward[];
|
||||
/**
|
||||
* Gets a flat list of reward items for the given quest at a specific state (e.g. Fail/Success)
|
||||
* @param quest quest to get rewards for
|
||||
* @param state Quest status that holds the items (Started, Success, Fail)
|
||||
* @param status Quest status that holds the items (Started, Success, Fail)
|
||||
* @returns array of items with the correct maxStack
|
||||
*/
|
||||
getQuestRewardItems(quest: IQuest, state: QuestStatus): Reward[];
|
||||
getQuestRewardItems(quest: IQuest, status: QuestStatus): Reward[];
|
||||
/**
|
||||
* Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile
|
||||
* @param pmcData Player profile
|
||||
@ -97,19 +103,19 @@ export declare class QuestHelper {
|
||||
*/
|
||||
getQuestReadyForProfile(pmcData: IPmcData, newState: QuestStatus, acceptedQuest: IAcceptQuestRequestData): Quest;
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param acceptedQuestId Quest to add to profile
|
||||
* Get quests that can be shown to player after starting a quest
|
||||
* @param startedQuestId Quest started by player
|
||||
* @param sessionID Session id
|
||||
* @returns Array of quests in profile + quest passed in as param
|
||||
* @returns Quests accessible to player incuding newly unlocked quests now quest (startedQuestId) was started
|
||||
*/
|
||||
acceptedUnlocked(acceptedQuestId: string, sessionID: string): IQuest[];
|
||||
acceptedUnlocked(startedQuestId: string, sessionID: string): IQuest[];
|
||||
/**
|
||||
* TODO: what is going on here
|
||||
* @param failedQuestId
|
||||
* @param sessionID Session id
|
||||
* Get quests that can be shown to player after failing a quest
|
||||
* @param failedQuestId Id of the quest failed by player
|
||||
* @param sessionId Session id
|
||||
* @returns
|
||||
*/
|
||||
failedUnlocked(failedQuestId: string, sessionID: string): IQuest[];
|
||||
failedUnlocked(failedQuestId: string, sessionId: string): IQuest[];
|
||||
/**
|
||||
* Adjust quest money rewards by passed in multiplier
|
||||
* @param quest Quest to multiple money rewards
|
||||
@ -127,6 +133,13 @@ export declare class QuestHelper {
|
||||
* @param output ItemEvent router response
|
||||
*/
|
||||
changeItemStack(pmcData: IPmcData, itemId: string, newStackSize: number, sessionID: string, output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Add item stack change object into output route event response
|
||||
* @param output Response to add item change event into
|
||||
* @param sessionId Session id
|
||||
* @param item Item that was adjusted
|
||||
*/
|
||||
protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: Item): void;
|
||||
/**
|
||||
* Get quests, strip all requirement conditions except level
|
||||
* @param quests quests to process
|
||||
|
@ -8,8 +8,10 @@ import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { HandbookHelper } from "./HandbookHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
export declare class TraderHelper {
|
||||
protected logger: ILogger;
|
||||
@ -17,15 +19,19 @@ export declare class TraderHelper {
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected fenceService: FenceService;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
/** Dictionary of item tpl and the highest trader rouble price */
|
||||
/** Dictionary of item tpl and the highest trader sell rouble price */
|
||||
protected highestTraderPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
/** Dictionary of item tpl and the highest trader buy back rouble price */
|
||||
protected highestTraderBuyPriceItems: Record<string, number>;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer);
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
getTraderAssortsById(traderId: string): ITraderAssort;
|
||||
/**
|
||||
@ -82,8 +88,15 @@ export declare class TraderHelper {
|
||||
}): void;
|
||||
/**
|
||||
* Get the highest rouble price for an item from traders
|
||||
* UNUSED
|
||||
* @param tpl Item to look up highest pride for
|
||||
* @returns highest rouble cost for item
|
||||
*/
|
||||
getHighestTraderPriceRouble(tpl: string): number;
|
||||
/**
|
||||
* Get the highest price item can be sold to trader for (roubles)
|
||||
* @param tpl Item to look up best trader sell-to price
|
||||
* @returns Rouble price
|
||||
*/
|
||||
getHighestSellToTraderPrice(tpl: string): number;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
export declare class WeightedRandomHelper {
|
||||
/**
|
||||
* USE getWeightedValue() WHERE POSSIBLE
|
||||
* Gets a tplId from a weighted dictionary
|
||||
* @param {tplId: weighting[]} itemArray
|
||||
* @returns tplId
|
||||
@ -7,6 +8,9 @@ export declare class WeightedRandomHelper {
|
||||
getWeightedInventoryItem(itemArray: {
|
||||
[tplId: string]: unknown;
|
||||
} | ArrayLike<unknown>): string;
|
||||
getWeightedValue<T>(itemArray: {
|
||||
[key: string]: unknown;
|
||||
} | ArrayLike<unknown>): T;
|
||||
/**
|
||||
* Picks the random item based on its weight.
|
||||
* The items with higher weight will be picked more often (with a higher probability).
|
||||
|
@ -122,24 +122,27 @@ export interface Inventory {
|
||||
questStashItems: string;
|
||||
fastPanel: Record<string, string>;
|
||||
}
|
||||
export interface IBaseJsonSkills {
|
||||
Common: Record<string, Common>;
|
||||
Mastering: Record<string, Mastering>;
|
||||
Points: number;
|
||||
}
|
||||
export interface Skills {
|
||||
Common: Common[];
|
||||
Mastering: Mastering[];
|
||||
Points: number;
|
||||
}
|
||||
export interface Common {
|
||||
export interface IBaseSkill {
|
||||
Id: string;
|
||||
Progress: number;
|
||||
PointsEarnedDuringSession?: number;
|
||||
LastAccess?: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
}
|
||||
export interface Mastering {
|
||||
Id: string;
|
||||
Progress: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
export interface Common extends IBaseSkill {
|
||||
PointsEarnedDuringSession?: number;
|
||||
LastAccess?: number;
|
||||
}
|
||||
export interface Mastering extends IBaseSkill {
|
||||
}
|
||||
export interface Stats {
|
||||
CarriedQuestItems: string[];
|
||||
|
@ -104,13 +104,17 @@ export interface Generation {
|
||||
items: ItemMinMax;
|
||||
}
|
||||
export interface ItemMinMax {
|
||||
grenades: MinMax;
|
||||
healing: MinMax;
|
||||
drugs: MinMax;
|
||||
stims: MinMax;
|
||||
looseLoot: MinMax;
|
||||
magazines: MinMax;
|
||||
specialItems: MinMax;
|
||||
grenades: MinMaxWithWhitelist;
|
||||
healing: MinMaxWithWhitelist;
|
||||
drugs: MinMaxWithWhitelist;
|
||||
stims: MinMaxWithWhitelist;
|
||||
looseLoot: MinMaxWithWhitelist;
|
||||
magazines: MinMaxWithWhitelist;
|
||||
specialItems: MinMaxWithWhitelist;
|
||||
}
|
||||
export interface MinMaxWithWhitelist extends MinMax {
|
||||
/** Array of item tpls */
|
||||
whitelist: string[];
|
||||
}
|
||||
export interface Health {
|
||||
BodyParts: BodyPart[];
|
||||
|
6
TypeScript/12ClassExtensionOverride/types/models/eft/profile/IConnectResponse.d.ts
vendored
Normal file
6
TypeScript/12ClassExtensionOverride/types/models/eft/profile/IConnectResponse.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export interface IConnectResponse {
|
||||
backendUrl: string;
|
||||
name: string;
|
||||
editions: string[];
|
||||
profileDescriptions: Record<string, string>;
|
||||
}
|
6
TypeScript/12ClassExtensionOverride/types/models/enums/AirdropType.d.ts
vendored
Normal file
6
TypeScript/12ClassExtensionOverride/types/models/enums/AirdropType.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare enum AirdropTypeEnum {
|
||||
MIXED = "mixed",
|
||||
WEAPONARMOR = "weaponarmor",
|
||||
FOODMEDICAL = "foodmedical",
|
||||
BARTER = "barter"
|
||||
}
|
@ -28,6 +28,6 @@ export declare enum WildSpawnTypeNumber {
|
||||
BOSSKNIGHT = 67108864,
|
||||
FOLLOWERBIGPIPE = 134217728,
|
||||
FOLLOWERBIRDEYE = 268435456,
|
||||
SPTUSEC = 536870912,
|
||||
SPTBEAR = 1073741824
|
||||
BOSSZRYACHIY = 536870912,
|
||||
FOLLOWERZRYACHIY = 1073741824
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ITemplateItem } from "../../eft/common/tables/ITemplateItem";
|
||||
export declare class BotLootCache {
|
||||
export interface IBotLootCache {
|
||||
backpackLoot: ITemplateItem[];
|
||||
pocketLoot: ITemplateItem[];
|
||||
vestLoot: ITemplateItem[];
|
@ -1,8 +1,10 @@
|
||||
import { AirdropTypeEnum } from "../../../models/enums/AirdropType";
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IAirdropConfig extends IBaseConfig {
|
||||
kind: "aki-airdrop";
|
||||
airdropChancePercent: AirdropChancePercent;
|
||||
airdropTypeWeightings: Record<AirdropTypeEnum, number>;
|
||||
planeMinFlyHeight: number;
|
||||
planeMaxFlyHeight: number;
|
||||
planeVolume: number;
|
||||
@ -10,7 +12,7 @@ export interface IAirdropConfig extends IBaseConfig {
|
||||
crateFallSpeed: number;
|
||||
airdropMinStartTimeSeconds: number;
|
||||
airdropMaxStartTimeSeconds: number;
|
||||
loot: AirdropLoot;
|
||||
loot: Record<string, AirdropLoot>;
|
||||
}
|
||||
export interface AirdropChancePercent {
|
||||
bigmap: number;
|
||||
@ -22,12 +24,12 @@ export interface AirdropChancePercent {
|
||||
tarkovStreets: number;
|
||||
}
|
||||
export interface AirdropLoot {
|
||||
presetCount: MinMax;
|
||||
presetCount?: MinMax;
|
||||
itemCount: MinMax;
|
||||
itemBlacklist: string[];
|
||||
itemTypeWhitelist: string[];
|
||||
/** key: item base type: value: max count */
|
||||
itemLimits: Record<string, number>;
|
||||
itemStackLimits: Record<string, MinMax>;
|
||||
armorLevelWhitelist: number[];
|
||||
armorLevelWhitelist?: number[];
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { MinMaxWithWhitelist } from "../../../models/eft/common/tables/IBotType";
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
import { IBotDurability } from "./IBotDurability";
|
||||
@ -85,7 +86,7 @@ export interface ModLimits {
|
||||
}
|
||||
export interface RandomisationDetails {
|
||||
levelRange: MinMax;
|
||||
generation?: Record<string, MinMax>;
|
||||
generation?: Record<string, MinMaxWithWhitelist>;
|
||||
randomisedWeaponModSlots?: string[];
|
||||
randomisedArmorSlots?: string[];
|
||||
/** Equipment chances */
|
||||
|
@ -4,5 +4,6 @@ export interface ICoreConfig extends IBaseConfig {
|
||||
akiVersion: string;
|
||||
projectName: string;
|
||||
compatibleTarkovVersion: string;
|
||||
serverName: string;
|
||||
commit: string;
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ export interface IInventoryConfig extends IBaseConfig {
|
||||
kind: "aki-inventory";
|
||||
newItemsMarkedFound: boolean;
|
||||
randomLootContainers: Record<string, RewardDetails>;
|
||||
/** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */
|
||||
customMoneyTpls: string[];
|
||||
}
|
||||
export interface RewardDetails {
|
||||
rewardCount: number;
|
||||
|
@ -2,16 +2,24 @@ import { MinMax } from "../../common/MinMax";
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IRagfairConfig extends IBaseConfig {
|
||||
kind: "aki-ragfair";
|
||||
/** How many seconds should pass before expired offers and procesed + player offers checked if sold */
|
||||
runIntervalSeconds: number;
|
||||
/** Player listing settings */
|
||||
sell: Sell;
|
||||
/** Trader ids + should their assorts be listed on flea*/
|
||||
traders: Record<string, boolean>;
|
||||
dynamic: Dynamic;
|
||||
}
|
||||
export interface Sell {
|
||||
/** Should a fee be deducted from player when liting an item for sale */
|
||||
fees: boolean;
|
||||
/** Settings to control chances of offer being sold */
|
||||
chance: Chance;
|
||||
/** Settings to control how long it takes for a player offer to sell */
|
||||
time: Time;
|
||||
/** Player offer reputation gain/loss settings */
|
||||
reputation: Reputation;
|
||||
/** How many hours are simulated to figure out if player offer was sold */
|
||||
simulatedSellHours: number;
|
||||
}
|
||||
export interface Chance {
|
||||
@ -32,48 +40,77 @@ export interface Dynamic {
|
||||
purchasesAreFoundInRaid: boolean;
|
||||
/** Use the highest trader price for an offer if its greater than the price in templates/prices.json */
|
||||
useTraderPriceForOffersIfHigher: boolean;
|
||||
/** Barter offer specific settings */
|
||||
barter: Barter;
|
||||
/** Dynamic offer price below handbook adjustment values */
|
||||
offerAdjustment: OfferAdjustment;
|
||||
/** How many offers should expire before an offer regeneration occurs */
|
||||
expiredOfferThreshold: number;
|
||||
/** How many offers should be listed */
|
||||
offerItemCount: MinMax;
|
||||
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
|
||||
price: MinMax;
|
||||
/** How much should the price of an offer vary by (percent 0.8 = 80%, 1.2 = 120%) */
|
||||
presetPrice: MinMax;
|
||||
/** Should default presets to listed only or should non-standard presets found in globals.json be listed too */
|
||||
showDefaultPresetsOnly: boolean;
|
||||
endTimeSeconds: MinMax;
|
||||
/** Settings to control the durability range of item items listed on flea */
|
||||
condition: Condition;
|
||||
/** Size stackable items should be listed for in percent of max stack size */
|
||||
stackablePercent: MinMax;
|
||||
/** Items that cannot be stacked can have multiples sold in one offer, what range of values can be listed */
|
||||
nonStackableCount: MinMax;
|
||||
/** Range of rating offers for items being listed */
|
||||
rating: MinMax;
|
||||
/** Percentages to sell offers in each currency */
|
||||
currencies: Record<string, number>;
|
||||
/** Item tpls that should be forced to sell as a single item */
|
||||
showAsSingleStack: string[];
|
||||
/** Should christmas/halloween items be removed from flea when not within the seasonal bounds */
|
||||
removeSeasonalItemsWhenNotInEvent: boolean;
|
||||
/** Flea blacklist settings */
|
||||
blacklist: Blacklist;
|
||||
}
|
||||
export interface Barter {
|
||||
/** Should barter offers be generated */
|
||||
enable: boolean;
|
||||
/** Percentage change an offer is listed as a barter */
|
||||
chancePercent: number;
|
||||
/** Min number of required items for a barter requirement */
|
||||
itemCountMin: number;
|
||||
/** Max number of required items for a barter requirement */
|
||||
itemCountMax: number;
|
||||
/** How much can the total price of requested items vary from the item offered */
|
||||
priceRangeVariancePercent: number;
|
||||
/** Min rouble price for an offer to be considered for turning into a barter */
|
||||
minRoubleCostToBecomeBarter: number;
|
||||
/** Item Tpls to never be turned into a barter */
|
||||
itemTypeBlacklist: string[];
|
||||
}
|
||||
export interface OfferAdjustment {
|
||||
/** Shuld offer price be adjusted when below handbook price */
|
||||
adjustPriceWhenBelowHandbookPrice: boolean;
|
||||
/** How big a percentage difference does price need to vary from handbook to be considered for adjustment */
|
||||
maxPriceDifferenceBelowHandbookPercent: number;
|
||||
/** How much to multiply the handbook price to get the new price */
|
||||
handbookPriceMultipier: number;
|
||||
/** What is the minimum rouble price to consider adjusting price of item */
|
||||
priceThreshholdRub: number;
|
||||
}
|
||||
export interface Condition {
|
||||
/** Percentage change durability is altered */
|
||||
conditionChance: number;
|
||||
min: number;
|
||||
max: number;
|
||||
}
|
||||
export interface Blacklist {
|
||||
/**
|
||||
* show/hide trader items that are blacklisted by bsg
|
||||
*/
|
||||
traderItems: boolean;
|
||||
/** Custom blacklist for item Tpls */
|
||||
custom: string[];
|
||||
/** BSG blacklist a large number of items from flea, true = use blacklist */
|
||||
enableBsgList: boolean;
|
||||
/** Should quest items be blacklisted from flea */
|
||||
enableQuestList: boolean;
|
||||
/** Should trader items that are blacklisted by bsg */
|
||||
traderItems: boolean;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MinMax } from "../../common/MinMax";
|
||||
export declare class LootRequest {
|
||||
export interface LootRequest {
|
||||
presetCount: MinMax;
|
||||
itemCount: MinMax;
|
||||
itemBlacklist: string[];
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { EquipmentChances, Generation, IBotType, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { EquipmentChances, Generation, IBotType, MinMaxWithWhitelist, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { AdjustmentDetails, EquipmentFilterDetails, EquipmentFilters, IBotConfig, WeightingAdjustmentDetails } from "../models/spt/config/IBotConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -30,7 +29,7 @@ export declare class BotEquipmentFilterService {
|
||||
* @param generationChanges Changes to apply
|
||||
* @param baseBotGeneration dictionary to update
|
||||
*/
|
||||
protected adjustGenerationChances(generationChanges: Record<string, MinMax>, baseBotGeneration: Generation): void;
|
||||
protected adjustGenerationChances(generationChanges: Record<string, MinMaxWithWhitelist>, baseBotGeneration: Generation): void;
|
||||
/**
|
||||
* Get equipment settings for bot
|
||||
* @param botEquipmentRole equipment role to return
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { PMCLootGenerator } from "../generators/PMCLootGenerator";
|
||||
import { Items } from "../models/eft/common/tables/IBotType";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { ITemplateItem, Props } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache";
|
||||
import { IBotLootCache, LootCacheType } from "../models/spt/bots/IBotLootCache";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
@ -10,12 +11,13 @@ import { RagfairPriceService } from "./RagfairPriceService";
|
||||
export declare class BotLootCacheService {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected pmcLootGenerator: PMCLootGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected lootCache: Record<string, BotLootCache>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
|
||||
protected lootCache: Record<string, IBotLootCache>;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
|
||||
/**
|
||||
* Remove all cached bot loot data
|
||||
*/
|
||||
@ -25,17 +27,17 @@ export declare class BotLootCacheService {
|
||||
* @param botRole bot to get loot for
|
||||
* @param isPmc is the bot a pmc
|
||||
* @param lootType what type of loot is needed (backpack/pocket/stim/vest etc)
|
||||
* @param lootPool the full pool of loot (needed when cache is empty)
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @returns ITemplateItem array
|
||||
*/
|
||||
getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, lootPool: Items): ITemplateItem[];
|
||||
getLootFromCache(botRole: string, isPmc: boolean, lootType: LootCacheType, botJsonTemplate: IBotType): ITemplateItem[];
|
||||
/**
|
||||
* Generate loot for a bot and store inside a private class property
|
||||
* @param botRole bots role (assault / pmcBot etc)
|
||||
* @param lootPool the full pool of loot we use to create the various sub-categories with
|
||||
* @param isPmc Is the bot a PMC (alteres what loot is cached)
|
||||
* @param botJsonTemplate db template for bot having its loot generated
|
||||
*/
|
||||
protected addLootToCache(botRole: string, isPmc: boolean, lootPool: Items): void;
|
||||
protected addLootToCache(botRole: string, isPmc: boolean, botJsonTemplate: IBotType): void;
|
||||
/**
|
||||
* Sort a pool of item objects by its flea price
|
||||
* @param poolToSort pool of items to sort
|
||||
|
23
TypeScript/12ClassExtensionOverride/types/services/MatchBotDetailsCacheService.d.ts
vendored
Normal file
23
TypeScript/12ClassExtensionOverride/types/services/MatchBotDetailsCacheService.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
/** Cache bots in a dictionary, keyed by the bots name, keying by name isnt idea as its not unique but this is used by the post-raid system which doesnt have any bot ids, only name */
|
||||
export declare class MatchBotDetailsCacheService {
|
||||
protected logger: ILogger;
|
||||
protected botDetailsCache: Record<string, IBotBase>;
|
||||
constructor(logger: ILogger);
|
||||
/**
|
||||
* Store a bot in the cache, keyed by its name
|
||||
* @param botToCache Bot details to cache
|
||||
*/
|
||||
cacheBot(botToCache: IBotBase): void;
|
||||
/**
|
||||
* Clean the cache of all bot details
|
||||
*/
|
||||
clearCache(): void;
|
||||
/**
|
||||
* Find a bot in the cache by its name
|
||||
* @param botName Name of bot to find
|
||||
* @returns Bot details
|
||||
*/
|
||||
getBotByName(botName: string): IBotBase;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user